Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package test provides methods and message types of the test v1 API.
Index ¶
- Constants
 - type API
 - func (s *API) CreateHuman(req *CreateHumanRequest, opts ...scw.RequestOption) (*Human, error)
 - func (s *API) DeleteHuman(req *DeleteHumanRequest, opts ...scw.RequestOption) (*Human, error)
 - func (s *API) GetHuman(req *GetHumanRequest, opts ...scw.RequestOption) (*Human, error)
 - func (s *API) ListHumans(req *ListHumansRequest, opts ...scw.RequestOption) (*ListHumansResponse, error)
 - func (s *API) Register(req *RegisterRequest, opts ...scw.RequestOption) (*RegisterResponse, error)
 - func (s *API) RunHuman(req *RunHumanRequest, opts ...scw.RequestOption) (*Human, error)
 - func (s *API) SmokeHuman(req *SmokeHumanRequest, opts ...scw.RequestOption) (*Human, error)deprecated
 - func (s *API) UpdateHuman(req *UpdateHumanRequest, opts ...scw.RequestOption) (*Human, error)
 
- type CreateHumanRequest
 - type DeleteHumanRequest
 - type EyeColors
 - type GetHumanRequest
 - type Human
 - type HumanStatus
 - type ListHumansRequest
 - type ListHumansRequestOrderBy
 - type ListHumansResponse
 - type RegisterRequest
 - type RegisterResponse
 - type RunHumanRequest
 - type SmokeHumanRequest
 - type UpdateHumanRequest
 
Constants ¶
const ( // Unknown color. EyeColorsUnknown = EyeColors("unknown") // Rare and striking shade that typically features a golden or yellowish-brown hue. EyeColorsAmber = EyeColors("amber") // Relatively rare, with the highest frequency found in eastern Europe. EyeColorsBlue = EyeColors("blue") // Most common eye color in the world caused by a high concentration of melanin in the iris. EyeColorsBrown = EyeColors("brown") // Relatively rare color which can change depending on the lighting conditions. EyeColorsGray = EyeColors("gray") // Rare and unique color characterized by a combination of yellow, brown, and blue pigments. EyeColorsGreen = EyeColors("green") // Brownish-yellow or greenish-brown with a hint of gold. EyeColorsHazel = EyeColors("hazel") // Rare mutation that results in a reddish-pink hue. EyeColorsRed = EyeColors("red") // Rare and striking shade that appears to be a mix of blue and purple. EyeColorsViolet = EyeColors("violet") )
const ( // Unknown status. HumanStatusUnknown = HumanStatus("unknown") // The human is stopped. HumanStatusStopped = HumanStatus("stopped") // The human is running. HumanStatusRunning = HumanStatus("running") )
const ( // Ascending creation date. ListHumansRequestOrderByCreatedAtAsc = ListHumansRequestOrderBy("created_at_asc") // Descending creation date. ListHumansRequestOrderByCreatedAtDesc = ListHumansRequestOrderBy("created_at_desc") // Ascending update date. ListHumansRequestOrderByUpdatedAtAsc = ListHumansRequestOrderBy("updated_at_asc") // Descending update date. ListHumansRequestOrderByUpdatedAtDesc = ListHumansRequestOrderBy("updated_at_desc") // Ascending height. ListHumansRequestOrderByHeightAsc = ListHumansRequestOrderBy("height_asc") // Descending height. ListHumansRequestOrderByHeightDesc = ListHumansRequestOrderBy("height_desc") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
	// contains filtered or unexported fields
}
    No Auth Service for end-to-end testing.
func (*API) CreateHuman ¶
func (s *API) CreateHuman(req *CreateHumanRequest, opts ...scw.RequestOption) (*Human, error)
CreateHuman: Create a new human.
func (*API) DeleteHuman ¶
func (s *API) DeleteHuman(req *DeleteHumanRequest, opts ...scw.RequestOption) (*Human, error)
DeleteHuman: Delete the human associated with the given id.
func (*API) GetHuman ¶
func (s *API) GetHuman(req *GetHumanRequest, opts ...scw.RequestOption) (*Human, error)
GetHuman: Get the human details associated with the given id.
func (*API) ListHumans ¶
func (s *API) ListHumans(req *ListHumansRequest, opts ...scw.RequestOption) (*ListHumansResponse, error)
ListHumans: List all your humans.
func (*API) Register ¶
func (s *API) Register(req *RegisterRequest, opts ...scw.RequestOption) (*RegisterResponse, error)
Register: Register a human and return a access-key and a secret-key that must be used in all other commands.
Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable.
func (*API) RunHuman ¶
func (s *API) RunHuman(req *RunHumanRequest, opts ...scw.RequestOption) (*Human, error)
RunHuman: Start a one hour running for the given human.
        
          
            func (*API) SmokeHuman
            deprecated
            
          
  
    
  
      
      func (s *API) SmokeHuman(req *SmokeHumanRequest, opts ...scw.RequestOption) (*Human, error)
Deprecated: SmokeHuman: Make a human smoke.
func (*API) UpdateHuman ¶
func (s *API) UpdateHuman(req *UpdateHumanRequest, opts ...scw.RequestOption) (*Human, error)
UpdateHuman: Update the human associated with the given id.
type CreateHumanRequest ¶
type CreateHumanRequest struct {
	Height float64 `json:"height"`
	ShoeSize float32 `json:"shoe_size"`
	AltitudeInMeter int32 `json:"altitude_in_meter"`
	AltitudeInMillimeter int64 `json:"altitude_in_millimeter"`
	FingersCount uint32 `json:"fingers_count"`
	HairCount uint64 `json:"hair_count"`
	IsHappy bool `json:"is_happy"`
	// EyesColor: default value: unknown
	EyesColor EyeColors `json:"eyes_color"`
	// Deprecated
	// Precisely one of ProjectID, OrganizationID must be set.
	OrganizationID *string `json:"organization_id,omitempty"`
	Name string `json:"name"`
	// Precisely one of ProjectID, OrganizationID must be set.
	ProjectID *string `json:"project_id,omitempty"`
}
    CreateHumanRequest: create human request.
type DeleteHumanRequest ¶
type DeleteHumanRequest struct {
	// HumanID: UUID of the human you want to delete.
	HumanID string `json:"-"`
}
    DeleteHumanRequest: delete human request.
type EyeColors ¶
type EyeColors string
func (EyeColors) MarshalJSON ¶
func (*EyeColors) UnmarshalJSON ¶
type GetHumanRequest ¶
type GetHumanRequest struct {
	// HumanID: UUID of the human you want to get.
	HumanID string `json:"-"`
}
    GetHumanRequest: get human request.
type Human ¶
type Human struct {
	ID string `json:"id"`
	OrganizationID string `json:"organization_id"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	Height float64 `json:"height"`
	ShoeSize float32 `json:"shoe_size"`
	AltitudeInMeter int32 `json:"altitude_in_meter"`
	AltitudeInMillimeter int64 `json:"altitude_in_millimeter"`
	FingersCount uint32 `json:"fingers_count"`
	HairCount uint64 `json:"hair_count"`
	IsHappy bool `json:"is_happy"`
	// EyesColor: default value: unknown
	EyesColor EyeColors `json:"eyes_color"`
	// Status: default value: unknown
	Status HumanStatus `json:"status"`
	Name string `json:"name"`
	ProjectID string `json:"project_id"`
}
    Human: human.
type HumanStatus ¶
type HumanStatus string
func (HumanStatus) MarshalJSON ¶
func (enum HumanStatus) MarshalJSON() ([]byte, error)
func (HumanStatus) String ¶
func (enum HumanStatus) String() string
func (*HumanStatus) UnmarshalJSON ¶
func (enum *HumanStatus) UnmarshalJSON(data []byte) error
func (HumanStatus) Values ¶
func (enum HumanStatus) Values() []HumanStatus
type ListHumansRequest ¶
type ListHumansRequest struct {
	Page *int32 `json:"-"`
	PageSize *uint32 `json:"-"`
	// OrderBy: default value: created_at_asc
	OrderBy ListHumansRequestOrderBy `json:"-"`
	OrganizationID *string `json:"-"`
	ProjectID *string `json:"-"`
}
    ListHumansRequest: list humans request.
type ListHumansRequestOrderBy ¶
type ListHumansRequestOrderBy string
func (ListHumansRequestOrderBy) MarshalJSON ¶
func (enum ListHumansRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListHumansRequestOrderBy) String ¶
func (enum ListHumansRequestOrderBy) String() string
func (*ListHumansRequestOrderBy) UnmarshalJSON ¶
func (enum *ListHumansRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListHumansRequestOrderBy) Values ¶
func (enum ListHumansRequestOrderBy) Values() []ListHumansRequestOrderBy
type ListHumansResponse ¶
type ListHumansResponse struct {
	TotalCount uint32 `json:"total_count"`
	Humans []*Human `json:"humans"`
}
    ListHumansResponse: list humans response.
func (*ListHumansResponse) UnsafeAppend ¶
func (r *ListHumansResponse) UnsafeAppend(res interface{}) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListHumansResponse) UnsafeGetTotalCount ¶
func (r *ListHumansResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type RegisterRequest ¶
type RegisterRequest struct {
	Username string `json:"username"`
}
    RegisterRequest: register request.
type RegisterResponse ¶
type RegisterResponse struct {
	SecretKey string `json:"secret_key"`
	AccessKey string `json:"access_key"`
}
    RegisterResponse: register response.
type RunHumanRequest ¶
type RunHumanRequest struct {
	// HumanID: UUID of the human you want to make run.
	HumanID string `json:"-"`
}
    RunHumanRequest: run human request.
type SmokeHumanRequest ¶
type SmokeHumanRequest struct {
	// Deprecated: HumanID: UUID of the human you want to make smoking.
	HumanID string `json:"-"`
}
    SmokeHumanRequest: smoke human request.
type UpdateHumanRequest ¶
type UpdateHumanRequest struct {
	// HumanID: UUID of the human you want to update.
	HumanID string `json:"-"`
	// Height: height of the human in meters.
	Height *float64 `json:"height,omitempty"`
	ShoeSize *float32 `json:"shoe_size,omitempty"`
	AltitudeInMeter *int32 `json:"altitude_in_meter,omitempty"`
	AltitudeInMillimeter *int64 `json:"altitude_in_millimeter,omitempty"`
	FingersCount *uint32 `json:"fingers_count,omitempty"`
	HairCount *uint64 `json:"hair_count,omitempty"`
	IsHappy *bool `json:"is_happy,omitempty"`
	// EyesColor: default value: unknown
	EyesColor EyeColors `json:"eyes_color"`
	Name *string `json:"name,omitempty"`
}
    UpdateHumanRequest: update human request.