Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type DepartmentListParams
- type DepartmentListResponse
- type DepartmentNewParams
- type DepartmentNewResponse
- type DepartmentService
- func (r *DepartmentService) List(ctx context.Context, query DepartmentListParams, opts ...option.RequestOption) (res *pagination.CursorPage[DepartmentListResponse], err error)
- func (r *DepartmentService) ListAutoPaging(ctx context.Context, query DepartmentListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[DepartmentListResponse]
- func (r *DepartmentService) New(ctx context.Context, body DepartmentNewParams, opts ...option.RequestOption) (res *DepartmentNewResponse, err error)
- func (r *DepartmentService) Update(ctx context.Context, id string, body DepartmentUpdateParams, ...) (res *DepartmentUpdateResponse, err error)
- type DepartmentUpdateParams
- type DepartmentUpdateResponse
- type Error
- type TimeOffListAssignmentsParams
- type TimeOffListAssignmentsResponse
- type TimeOffListBalancesParams
- type TimeOffListBalancesResponse
- type TimeOffListRequestsParams
- type TimeOffListRequestsResponse
- type TimeOffListRequestsResponseStatus
- type TimeOffPolicyGetResponse
- type TimeOffPolicyGetResponseSchedule
- type TimeOffPolicyGetResponseUnit
- type TimeOffPolicyListParams
- type TimeOffPolicyListResponse
- type TimeOffPolicyListResponseSchedule
- type TimeOffPolicyListResponseUnit
- type TimeOffPolicyService
- func (r *TimeOffPolicyService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *TimeOffPolicyGetResponse, err error)
- func (r *TimeOffPolicyService) List(ctx context.Context, query TimeOffPolicyListParams, ...) (res *pagination.CursorPage[TimeOffPolicyListResponse], err error)
- func (r *TimeOffPolicyService) ListAutoPaging(ctx context.Context, query TimeOffPolicyListParams, ...) *pagination.CursorPageAutoPager[TimeOffPolicyListResponse]
- type TimeOffService
- func (r *TimeOffService) ListAssignments(ctx context.Context, query TimeOffListAssignmentsParams, ...) (res *pagination.CursorPage[TimeOffListAssignmentsResponse], err error)
- func (r *TimeOffService) ListAssignmentsAutoPaging(ctx context.Context, query TimeOffListAssignmentsParams, ...) *pagination.CursorPageAutoPager[TimeOffListAssignmentsResponse]
- func (r *TimeOffService) ListBalances(ctx context.Context, query TimeOffListBalancesParams, ...) (res *pagination.CursorPage[TimeOffListBalancesResponse], err error)
- func (r *TimeOffService) ListBalancesAutoPaging(ctx context.Context, query TimeOffListBalancesParams, ...) *pagination.CursorPageAutoPager[TimeOffListBalancesResponse]
- func (r *TimeOffService) ListRequests(ctx context.Context, query TimeOffListRequestsParams, ...) (res *pagination.CursorPage[TimeOffListRequestsResponse], err error)
- func (r *TimeOffService) ListRequestsAutoPaging(ctx context.Context, query TimeOffListRequestsParams, ...) *pagination.CursorPageAutoPager[TimeOffListRequestsResponse]
- type WorkerGetResponse
- type WorkerGetResponseDepartment
- type WorkerGetResponseStatus
- type WorkerGetResponseType
- type WorkerInviteResponse
- type WorkerInviteResponseDepartment
- type WorkerInviteResponseStatus
- type WorkerInviteResponseType
- type WorkerListParams
- type WorkerListResponse
- type WorkerListResponseDepartment
- type WorkerListResponseStatus
- type WorkerListResponseType
- type WorkerNewContractorParams
- type WorkerNewContractorParamsCompensation
- type WorkerNewContractorParamsEntityType
- type WorkerNewContractorParamsPaySchedule
- type WorkerNewContractorParamsWorkCountry
- type WorkerNewContractorResponse
- type WorkerNewContractorResponseDepartment
- type WorkerNewContractorResponseStatus
- type WorkerNewContractorResponseType
- type WorkerNewEmployeeParams
- type WorkerNewEmployeeParamsCompensation
- type WorkerNewEmployeeParamsPaySchedule
- type WorkerNewEmployeeParamsStateRegistration
- type WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation
- type WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation
- type WorkerNewEmployeeParamsWorkLocationUnion
- type WorkerNewEmployeeResponse
- type WorkerNewEmployeeResponseDepartment
- type WorkerNewEmployeeResponseStatus
- type WorkerNewEmployeeResponseType
- type WorkerService
- func (r *WorkerService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *WorkerService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkerGetResponse, err error)
- func (r *WorkerService) Invite(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkerInviteResponse, err error)
- func (r *WorkerService) List(ctx context.Context, query WorkerListParams, opts ...option.RequestOption) (res *pagination.CursorPage[WorkerListResponse], err error)
- func (r *WorkerService) ListAutoPaging(ctx context.Context, query WorkerListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[WorkerListResponse]
- func (r *WorkerService) NewContractor(ctx context.Context, body WorkerNewContractorParams, ...) (res *WorkerNewContractorResponse, err error)
- func (r *WorkerService) NewEmployee(ctx context.Context, body WorkerNewEmployeeParams, ...) (res *WorkerNewEmployeeResponse, err error)
- type WorkplaceListParams
- type WorkplaceListResponse
- type WorkplaceListResponseAddress
- type WorkplaceListResponseStatus
- type WorkplaceListResponseType
- type WorkplaceNewParams
- type WorkplaceNewParamsAddress
- type WorkplaceNewParamsType
- type WorkplaceNewResponse
- type WorkplaceNewResponseAddress
- type WorkplaceNewResponseStatus
- type WorkplaceNewResponseType
- type WorkplaceService
- func (r *WorkplaceService) List(ctx context.Context, query WorkplaceListParams, opts ...option.RequestOption) (res *pagination.CursorPage[WorkplaceListResponse], err error)
- func (r *WorkplaceService) ListAutoPaging(ctx context.Context, query WorkplaceListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[WorkplaceListResponse]
- func (r *WorkplaceService) New(ctx context.Context, body WorkplaceNewParams, opts ...option.RequestOption) (res *WorkplaceNewResponse, err error)
- func (r *WorkplaceService) Update(ctx context.Context, id string, body WorkplaceUpdateParams, ...) (res *WorkplaceUpdateResponse, err error)
- type WorkplaceUpdateParams
- type WorkplaceUpdateResponse
- type WorkplaceUpdateResponseAddress
- type WorkplaceUpdateResponseStatus
- type WorkplaceUpdateResponseType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (WARP_API_KEY, WARP_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Client ¶
type Client struct {
// Endpoints for worker time off management. See time off requests, which workers
// are assigned to which policies, or worker remaining balances.
TimeOff TimeOffService
// Endpoints for worker management. "Workers" include anyone employed by your
// company, whether US or international, full-time employees or contractors.
Workers WorkerService
// Endpoints for department management. Create, list, and update departments within
// your company.
Departments DepartmentService
// Endpoints for workplace management. Create, list, and update workplaces within
// your company.
Workplaces WorkplaceService
// contains filtered or unexported fields
}
Client creates a struct with services and top level methods that help with interacting with the warp API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (WARP_API_KEY, WARP_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type DepartmentListParams ¶
type DepartmentListParams struct {
// The unique public id of the department
AfterID param.Opt[string] `query:"afterId,omitzero" json:"-"`
// The unique public id of the department
BeforeID param.Opt[string] `query:"beforeId,omitzero" json:"-"`
// a number less than or equal to 100
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (DepartmentListParams) URLQuery ¶
func (r DepartmentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes DepartmentListParams's query parameters as `url.Values`.
type DepartmentListResponse ¶
type DepartmentListResponse struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
// a string to be decoded into a Date
CreatedAt string `json:"createdAt" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DepartmentListResponse) RawJSON ¶
func (r DepartmentListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DepartmentListResponse) UnmarshalJSON ¶
func (r *DepartmentListResponse) UnmarshalJSON(data []byte) error
type DepartmentNewParams ¶
type DepartmentNewParams struct {
// a non empty string
Name string `json:"name" api:"required"`
// contains filtered or unexported fields
}
func (DepartmentNewParams) MarshalJSON ¶
func (r DepartmentNewParams) MarshalJSON() (data []byte, err error)
func (*DepartmentNewParams) UnmarshalJSON ¶
func (r *DepartmentNewParams) UnmarshalJSON(data []byte) error
type DepartmentNewResponse ¶
type DepartmentNewResponse struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
// a string to be decoded into a Date
CreatedAt string `json:"createdAt" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DepartmentNewResponse) RawJSON ¶
func (r DepartmentNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DepartmentNewResponse) UnmarshalJSON ¶
func (r *DepartmentNewResponse) UnmarshalJSON(data []byte) error
type DepartmentService ¶
type DepartmentService struct {
// contains filtered or unexported fields
}
Endpoints for department management. Create, list, and update departments within your company.
DepartmentService contains methods and other services that help with interacting with the warp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDepartmentService method instead.
func NewDepartmentService ¶
func NewDepartmentService(opts ...option.RequestOption) (r DepartmentService)
NewDepartmentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DepartmentService) List ¶
func (r *DepartmentService) List(ctx context.Context, query DepartmentListParams, opts ...option.RequestOption) (res *pagination.CursorPage[DepartmentListResponse], err error)
List all departments for your company.
func (*DepartmentService) ListAutoPaging ¶
func (r *DepartmentService) ListAutoPaging(ctx context.Context, query DepartmentListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[DepartmentListResponse]
List all departments for your company.
func (*DepartmentService) New ¶
func (r *DepartmentService) New(ctx context.Context, body DepartmentNewParams, opts ...option.RequestOption) (res *DepartmentNewResponse, err error)
Create a new department.
func (*DepartmentService) Update ¶
func (r *DepartmentService) Update(ctx context.Context, id string, body DepartmentUpdateParams, opts ...option.RequestOption) (res *DepartmentUpdateResponse, err error)
Update an existing department.
type DepartmentUpdateParams ¶
type DepartmentUpdateParams struct {
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (DepartmentUpdateParams) MarshalJSON ¶
func (r DepartmentUpdateParams) MarshalJSON() (data []byte, err error)
func (*DepartmentUpdateParams) UnmarshalJSON ¶
func (r *DepartmentUpdateParams) UnmarshalJSON(data []byte) error
type DepartmentUpdateResponse ¶
type DepartmentUpdateResponse struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
// a string to be decoded into a Date
CreatedAt string `json:"createdAt" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DepartmentUpdateResponse) RawJSON ¶
func (r DepartmentUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DepartmentUpdateResponse) UnmarshalJSON ¶
func (r *DepartmentUpdateResponse) UnmarshalJSON(data []byte) error
type TimeOffListAssignmentsParams ¶
type TimeOffListAssignmentsParams struct {
AfterID param.Opt[string] `query:"afterId,omitzero" json:"-"`
BeforeID param.Opt[string] `query:"beforeId,omitzero" json:"-"`
// a number less than or equal to 100
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
PolicyIDs []string `query:"policyIds,omitzero" json:"-"`
WorkerIDs []string `query:"workerIds,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TimeOffListAssignmentsParams) URLQuery ¶
func (r TimeOffListAssignmentsParams) URLQuery() (v url.Values, err error)
URLQuery serializes TimeOffListAssignmentsParams's query parameters as `url.Values`.
type TimeOffListAssignmentsResponse ¶
type TimeOffListAssignmentsResponse struct {
ID string `json:"id" api:"required"`
// a string to be decoded into a Date
AssignedAt string `json:"assignedAt" api:"required"`
// a string starting with "top\_"
PolicyID string `json:"policyId" api:"required"`
// The id of the worker.
WorkerID string `json:"workerId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssignedAt respjson.Field
PolicyID respjson.Field
WorkerID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TimeOffListAssignmentsResponse) RawJSON ¶
func (r TimeOffListAssignmentsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TimeOffListAssignmentsResponse) UnmarshalJSON ¶
func (r *TimeOffListAssignmentsResponse) UnmarshalJSON(data []byte) error
type TimeOffListBalancesParams ¶
type TimeOffListBalancesParams struct {
AfterID param.Opt[string] `query:"afterId,omitzero" json:"-"`
BeforeID param.Opt[string] `query:"beforeId,omitzero" json:"-"`
// a string to be decoded into a Date
EndDate param.Opt[string] `query:"endDate,omitzero" json:"-"`
// a number less than or equal to 100
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
// a string to be decoded into a Date
StartDate param.Opt[string] `query:"startDate,omitzero" json:"-"`
PolicyIDs []string `query:"policyIds,omitzero" json:"-"`
WorkerIDs []string `query:"workerIds,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TimeOffListBalancesParams) URLQuery ¶
func (r TimeOffListBalancesParams) URLQuery() (v url.Values, err error)
URLQuery serializes TimeOffListBalancesParams's query parameters as `url.Values`.
type TimeOffListBalancesResponse ¶
type TimeOffListBalancesResponse struct {
ID string `json:"id" api:"required"`
AccruedLocked float64 `json:"accruedLocked" api:"required"`
AccruedUnlocked float64 `json:"accruedUnlocked" api:"required"`
Available float64 `json:"available" api:"required"`
Holds float64 `json:"holds" api:"required"`
LegacyWorkerID string `json:"legacyWorkerId" api:"required"`
// a string starting with "top\_"
PolicyID string `json:"policyId" api:"required"`
Used float64 `json:"used" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccruedLocked respjson.Field
AccruedUnlocked respjson.Field
Available respjson.Field
Holds respjson.Field
LegacyWorkerID respjson.Field
PolicyID respjson.Field
Used respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TimeOffListBalancesResponse) RawJSON ¶
func (r TimeOffListBalancesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TimeOffListBalancesResponse) UnmarshalJSON ¶
func (r *TimeOffListBalancesResponse) UnmarshalJSON(data []byte) error
type TimeOffListRequestsParams ¶
type TimeOffListRequestsParams struct {
AfterID param.Opt[string] `query:"afterId,omitzero" json:"-"`
BeforeID param.Opt[string] `query:"beforeId,omitzero" json:"-"`
// a string to be decoded into a Date
EndsBefore param.Opt[string] `query:"endsBefore,omitzero" json:"-"`
// a string to be decoded into a Date
EndsOnOrAfter param.Opt[string] `query:"endsOnOrAfter,omitzero" json:"-"`
// a number less than or equal to 100
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
// a string to be decoded into a Date
StartsBefore param.Opt[string] `query:"startsBefore,omitzero" json:"-"`
// a string to be decoded into a Date
StartsOnOrAfter param.Opt[string] `query:"startsOnOrAfter,omitzero" json:"-"`
PolicyIDs []string `query:"policyIds,omitzero" json:"-"`
// Any of "pending", "approved", "denied".
Statuses []string `query:"statuses,omitzero" json:"-"`
WorkerIDs []string `query:"workerIds,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TimeOffListRequestsParams) URLQuery ¶
func (r TimeOffListRequestsParams) URLQuery() (v url.Values, err error)
URLQuery serializes TimeOffListRequestsParams's query parameters as `url.Values`.
type TimeOffListRequestsResponse ¶
type TimeOffListRequestsResponse struct {
ID string `json:"id" api:"required"`
// a string to be decoded into a Date
CreatedAt string `json:"createdAt" api:"required"`
// a string to be decoded into a Date
EndAt string `json:"endAt" api:"required"`
Reason string `json:"reason" api:"required"`
RequestedMinutes float64 `json:"requestedMinutes" api:"required"`
// a string to be decoded into a Date
StartAt string `json:"startAt" api:"required"`
// Any of "pending", "approved", "denied".
Status TimeOffListRequestsResponseStatus `json:"status" api:"required"`
// a string starting with "top\_"
TimeOffPolicyID string `json:"timeOffPolicyId" api:"required"`
// The time zone that the worker is requesting time off in.
TimeZone string `json:"timeZone" api:"required"`
// The id of the worker.
WorkerID string `json:"workerId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
EndAt respjson.Field
Reason respjson.Field
RequestedMinutes respjson.Field
StartAt respjson.Field
Status respjson.Field
TimeOffPolicyID respjson.Field
TimeZone respjson.Field
WorkerID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TimeOffListRequestsResponse) RawJSON ¶
func (r TimeOffListRequestsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TimeOffListRequestsResponse) UnmarshalJSON ¶
func (r *TimeOffListRequestsResponse) UnmarshalJSON(data []byte) error
type TimeOffListRequestsResponseStatus ¶
type TimeOffListRequestsResponseStatus string
const ( TimeOffListRequestsResponseStatusPending TimeOffListRequestsResponseStatus = "pending" TimeOffListRequestsResponseStatusApproved TimeOffListRequestsResponseStatus = "approved" TimeOffListRequestsResponseStatusDenied TimeOffListRequestsResponseStatus = "denied" )
type TimeOffPolicyGetResponse ¶
type TimeOffPolicyGetResponse struct {
// a string starting with "top\_"
ID string `json:"id" api:"required"`
Description string `json:"description" api:"required"`
HoursWorkedPerChunk float64 `json:"hoursWorkedPerChunk" api:"required"`
IsUnlimited bool `json:"isUnlimited" api:"required"`
MinutesPerChunk float64 `json:"minutesPerChunk" api:"required"`
MinutesPerPeriod float64 `json:"minutesPerPeriod" api:"required"`
Name string `json:"name" api:"required"`
Paid bool `json:"paid" api:"required"`
// Any of "per_hour_worked", "monthly", "yearly", "unlimited".
Schedule TimeOffPolicyGetResponseSchedule `json:"schedule" api:"required"`
// a string starting with "tot\_"
TimeOffTypeID string `json:"timeOffTypeId" api:"required"`
TimeOffTypeName string `json:"timeOffTypeName" api:"required"`
// Any of "hour", "day".
Unit TimeOffPolicyGetResponseUnit `json:"unit" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Description respjson.Field
HoursWorkedPerChunk respjson.Field
IsUnlimited respjson.Field
MinutesPerChunk respjson.Field
MinutesPerPeriod respjson.Field
Name respjson.Field
Paid respjson.Field
Schedule respjson.Field
TimeOffTypeID respjson.Field
TimeOffTypeName respjson.Field
Unit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TimeOffPolicyGetResponse) RawJSON ¶
func (r TimeOffPolicyGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TimeOffPolicyGetResponse) UnmarshalJSON ¶
func (r *TimeOffPolicyGetResponse) UnmarshalJSON(data []byte) error
type TimeOffPolicyGetResponseSchedule ¶
type TimeOffPolicyGetResponseSchedule string
const ( TimeOffPolicyGetResponseSchedulePerHourWorked TimeOffPolicyGetResponseSchedule = "per_hour_worked" TimeOffPolicyGetResponseScheduleMonthly TimeOffPolicyGetResponseSchedule = "monthly" TimeOffPolicyGetResponseScheduleYearly TimeOffPolicyGetResponseSchedule = "yearly" TimeOffPolicyGetResponseScheduleUnlimited TimeOffPolicyGetResponseSchedule = "unlimited" )
type TimeOffPolicyGetResponseUnit ¶
type TimeOffPolicyGetResponseUnit string
const ( TimeOffPolicyGetResponseUnitHour TimeOffPolicyGetResponseUnit = "hour" TimeOffPolicyGetResponseUnitDay TimeOffPolicyGetResponseUnit = "day" )
type TimeOffPolicyListParams ¶
type TimeOffPolicyListParams struct {
// a string starting with "top\_"
AfterID param.Opt[string] `query:"afterId,omitzero" json:"-"`
// a string starting with "top\_"
BeforeID param.Opt[string] `query:"beforeId,omitzero" json:"-"`
// a number less than or equal to 100
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TimeOffPolicyListParams) URLQuery ¶
func (r TimeOffPolicyListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TimeOffPolicyListParams's query parameters as `url.Values`.
type TimeOffPolicyListResponse ¶
type TimeOffPolicyListResponse struct {
// a string starting with "top\_"
ID string `json:"id" api:"required"`
Description string `json:"description" api:"required"`
HoursWorkedPerChunk float64 `json:"hoursWorkedPerChunk" api:"required"`
IsUnlimited bool `json:"isUnlimited" api:"required"`
MinutesPerChunk float64 `json:"minutesPerChunk" api:"required"`
MinutesPerPeriod float64 `json:"minutesPerPeriod" api:"required"`
Name string `json:"name" api:"required"`
Paid bool `json:"paid" api:"required"`
// Any of "per_hour_worked", "monthly", "yearly", "unlimited".
Schedule TimeOffPolicyListResponseSchedule `json:"schedule" api:"required"`
// a string starting with "tot\_"
TimeOffTypeID string `json:"timeOffTypeId" api:"required"`
TimeOffTypeName string `json:"timeOffTypeName" api:"required"`
// Any of "hour", "day".
Unit TimeOffPolicyListResponseUnit `json:"unit" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Description respjson.Field
HoursWorkedPerChunk respjson.Field
IsUnlimited respjson.Field
MinutesPerChunk respjson.Field
MinutesPerPeriod respjson.Field
Name respjson.Field
Paid respjson.Field
Schedule respjson.Field
TimeOffTypeID respjson.Field
TimeOffTypeName respjson.Field
Unit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TimeOffPolicyListResponse) RawJSON ¶
func (r TimeOffPolicyListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TimeOffPolicyListResponse) UnmarshalJSON ¶
func (r *TimeOffPolicyListResponse) UnmarshalJSON(data []byte) error
type TimeOffPolicyListResponseSchedule ¶
type TimeOffPolicyListResponseSchedule string
const ( TimeOffPolicyListResponseSchedulePerHourWorked TimeOffPolicyListResponseSchedule = "per_hour_worked" TimeOffPolicyListResponseScheduleMonthly TimeOffPolicyListResponseSchedule = "monthly" TimeOffPolicyListResponseScheduleYearly TimeOffPolicyListResponseSchedule = "yearly" TimeOffPolicyListResponseScheduleUnlimited TimeOffPolicyListResponseSchedule = "unlimited" )
type TimeOffPolicyListResponseUnit ¶
type TimeOffPolicyListResponseUnit string
const ( TimeOffPolicyListResponseUnitHour TimeOffPolicyListResponseUnit = "hour" TimeOffPolicyListResponseUnitDay TimeOffPolicyListResponseUnit = "day" )
type TimeOffPolicyService ¶
type TimeOffPolicyService struct {
// contains filtered or unexported fields
}
Endpoints for worker time off management. See time off requests, which workers are assigned to which policies, or worker remaining balances.
TimeOffPolicyService contains methods and other services that help with interacting with the warp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTimeOffPolicyService method instead.
func NewTimeOffPolicyService ¶
func NewTimeOffPolicyService(opts ...option.RequestOption) (r TimeOffPolicyService)
NewTimeOffPolicyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TimeOffPolicyService) Get ¶
func (r *TimeOffPolicyService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *TimeOffPolicyGetResponse, err error)
Get a specific time off policy by id
func (*TimeOffPolicyService) List ¶
func (r *TimeOffPolicyService) List(ctx context.Context, query TimeOffPolicyListParams, opts ...option.RequestOption) (res *pagination.CursorPage[TimeOffPolicyListResponse], err error)
Get the time off policies for your company
func (*TimeOffPolicyService) ListAutoPaging ¶
func (r *TimeOffPolicyService) ListAutoPaging(ctx context.Context, query TimeOffPolicyListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[TimeOffPolicyListResponse]
Get the time off policies for your company
type TimeOffService ¶
type TimeOffService struct {
// Endpoints for worker time off management. See time off requests, which workers
// are assigned to which policies, or worker remaining balances.
Policies TimeOffPolicyService
// contains filtered or unexported fields
}
Endpoints for worker time off management. See time off requests, which workers are assigned to which policies, or worker remaining balances.
TimeOffService contains methods and other services that help with interacting with the warp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTimeOffService method instead.
func NewTimeOffService ¶
func NewTimeOffService(opts ...option.RequestOption) (r TimeOffService)
NewTimeOffService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TimeOffService) ListAssignments ¶
func (r *TimeOffService) ListAssignments(ctx context.Context, query TimeOffListAssignmentsParams, opts ...option.RequestOption) (res *pagination.CursorPage[TimeOffListAssignmentsResponse], err error)
Time off assignments are mappings between workers and time off policies. Useful for finding out which policies a worker is assigned to, or which workers are assigned to a given policy.
func (*TimeOffService) ListAssignmentsAutoPaging ¶
func (r *TimeOffService) ListAssignmentsAutoPaging(ctx context.Context, query TimeOffListAssignmentsParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[TimeOffListAssignmentsResponse]
Time off assignments are mappings between workers and time off policies. Useful for finding out which policies a worker is assigned to, or which workers are assigned to a given policy.
func (*TimeOffService) ListBalances ¶
func (r *TimeOffService) ListBalances(ctx context.Context, query TimeOffListBalancesParams, opts ...option.RequestOption) (res *pagination.CursorPage[TimeOffListBalancesResponse], err error)
Get worker remaining time-off balances.
func (*TimeOffService) ListBalancesAutoPaging ¶
func (r *TimeOffService) ListBalancesAutoPaging(ctx context.Context, query TimeOffListBalancesParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[TimeOffListBalancesResponse]
Get worker remaining time-off balances.
func (*TimeOffService) ListRequests ¶
func (r *TimeOffService) ListRequests(ctx context.Context, query TimeOffListRequestsParams, opts ...option.RequestOption) (res *pagination.CursorPage[TimeOffListRequestsResponse], err error)
Get the time off requests that workers in your company have made.
func (*TimeOffService) ListRequestsAutoPaging ¶
func (r *TimeOffService) ListRequestsAutoPaging(ctx context.Context, query TimeOffListRequestsParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[TimeOffListRequestsResponse]
Get the time off requests that workers in your company have made.
type WorkerGetResponse ¶
type WorkerGetResponse struct {
// The id of the worker.
ID string `json:"id" api:"required"`
BusinessName string `json:"businessName" api:"required"`
// The department the worker belongs to, or null if unassigned.
Department WorkerGetResponseDepartment `json:"department" api:"required"`
// The "ui" name of a worker. If it's a business contractor business name is used.
// Otherwise we default to preferred name, then first-last.
DisplayName string `json:"displayName" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
Email string `json:"email" api:"required"`
// A date string in the form YYYY-MM-DD
EndDate string `json:"endDate" api:"required"`
FirstName string `json:"firstName" api:"required"`
IsBusiness bool `json:"isBusiness" api:"required"`
LastName string `json:"lastName" api:"required"`
Position string `json:"position" api:"required"`
PreferredName string `json:"preferredName" api:"required"`
// A date string in the form YYYY-MM-DD
StartDate string `json:"startDate" api:"required"`
// Any of "draft", "invited", "onboarding", "active", "offboarding", "inactive".
Status WorkerGetResponseStatus `json:"status" api:"required"`
// The IANA timezone of the worker (e.g., America/New_York).
TimeZone string `json:"timeZone" api:"required"`
// Any of "employee", "contractor".
Type WorkerGetResponseType `json:"type" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
WorkEmail string `json:"workEmail" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BusinessName respjson.Field
Department respjson.Field
DisplayName respjson.Field
Email respjson.Field
EndDate respjson.Field
FirstName respjson.Field
IsBusiness respjson.Field
LastName respjson.Field
Position respjson.Field
PreferredName respjson.Field
StartDate respjson.Field
Status respjson.Field
TimeZone respjson.Field
Type respjson.Field
WorkEmail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkerGetResponse) RawJSON ¶
func (r WorkerGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerGetResponse) UnmarshalJSON ¶
func (r *WorkerGetResponse) UnmarshalJSON(data []byte) error
type WorkerGetResponseDepartment ¶
type WorkerGetResponseDepartment struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The department the worker belongs to, or null if unassigned.
func (WorkerGetResponseDepartment) RawJSON ¶
func (r WorkerGetResponseDepartment) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerGetResponseDepartment) UnmarshalJSON ¶
func (r *WorkerGetResponseDepartment) UnmarshalJSON(data []byte) error
type WorkerGetResponseStatus ¶
type WorkerGetResponseStatus string
const ( WorkerGetResponseStatusDraft WorkerGetResponseStatus = "draft" WorkerGetResponseStatusInvited WorkerGetResponseStatus = "invited" WorkerGetResponseStatusOnboarding WorkerGetResponseStatus = "onboarding" WorkerGetResponseStatusActive WorkerGetResponseStatus = "active" WorkerGetResponseStatusOffboarding WorkerGetResponseStatus = "offboarding" WorkerGetResponseStatusInactive WorkerGetResponseStatus = "inactive" )
type WorkerGetResponseType ¶
type WorkerGetResponseType string
const ( WorkerGetResponseTypeEmployee WorkerGetResponseType = "employee" WorkerGetResponseTypeContractor WorkerGetResponseType = "contractor" )
type WorkerInviteResponse ¶
type WorkerInviteResponse struct {
// The id of the worker.
ID string `json:"id" api:"required"`
BusinessName string `json:"businessName" api:"required"`
// The department the worker belongs to, or null if unassigned.
Department WorkerInviteResponseDepartment `json:"department" api:"required"`
// The "ui" name of a worker. If it's a business contractor business name is used.
// Otherwise we default to preferred name, then first-last.
DisplayName string `json:"displayName" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
Email string `json:"email" api:"required"`
// A date string in the form YYYY-MM-DD
EndDate string `json:"endDate" api:"required"`
FirstName string `json:"firstName" api:"required"`
IsBusiness bool `json:"isBusiness" api:"required"`
LastName string `json:"lastName" api:"required"`
Position string `json:"position" api:"required"`
PreferredName string `json:"preferredName" api:"required"`
// A date string in the form YYYY-MM-DD
StartDate string `json:"startDate" api:"required"`
// Any of "draft", "invited", "onboarding", "active", "offboarding", "inactive".
Status WorkerInviteResponseStatus `json:"status" api:"required"`
// The IANA timezone of the worker (e.g., America/New_York).
TimeZone string `json:"timeZone" api:"required"`
// Any of "employee", "contractor".
Type WorkerInviteResponseType `json:"type" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
WorkEmail string `json:"workEmail" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BusinessName respjson.Field
Department respjson.Field
DisplayName respjson.Field
Email respjson.Field
EndDate respjson.Field
FirstName respjson.Field
IsBusiness respjson.Field
LastName respjson.Field
Position respjson.Field
PreferredName respjson.Field
StartDate respjson.Field
Status respjson.Field
TimeZone respjson.Field
Type respjson.Field
WorkEmail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkerInviteResponse) RawJSON ¶
func (r WorkerInviteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerInviteResponse) UnmarshalJSON ¶
func (r *WorkerInviteResponse) UnmarshalJSON(data []byte) error
type WorkerInviteResponseDepartment ¶
type WorkerInviteResponseDepartment struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The department the worker belongs to, or null if unassigned.
func (WorkerInviteResponseDepartment) RawJSON ¶
func (r WorkerInviteResponseDepartment) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerInviteResponseDepartment) UnmarshalJSON ¶
func (r *WorkerInviteResponseDepartment) UnmarshalJSON(data []byte) error
type WorkerInviteResponseStatus ¶
type WorkerInviteResponseStatus string
const ( WorkerInviteResponseStatusDraft WorkerInviteResponseStatus = "draft" WorkerInviteResponseStatusInvited WorkerInviteResponseStatus = "invited" WorkerInviteResponseStatusOnboarding WorkerInviteResponseStatus = "onboarding" WorkerInviteResponseStatusActive WorkerInviteResponseStatus = "active" WorkerInviteResponseStatusOffboarding WorkerInviteResponseStatus = "offboarding" WorkerInviteResponseStatusInactive WorkerInviteResponseStatus = "inactive" )
type WorkerInviteResponseType ¶
type WorkerInviteResponseType string
const ( WorkerInviteResponseTypeEmployee WorkerInviteResponseType = "employee" WorkerInviteResponseTypeContractor WorkerInviteResponseType = "contractor" )
type WorkerListParams ¶
type WorkerListParams struct {
// The id of the worker.
AfterID param.Opt[string] `query:"afterId,omitzero" json:"-"`
// The id of the worker.
BeforeID param.Opt[string] `query:"beforeId,omitzero" json:"-"`
// a number less than or equal to 100
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
WorkEmail param.Opt[string] `query:"workEmail,omitzero" json:"-"`
// Any of "draft", "invited", "onboarding", "active", "offboarding", "inactive".
Statuses []string `query:"statuses,omitzero" json:"-"`
// Any of "employee", "contractor".
Types []string `query:"types,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkerListParams) URLQuery ¶
func (r WorkerListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkerListParams's query parameters as `url.Values`.
type WorkerListResponse ¶
type WorkerListResponse struct {
// The id of the worker.
ID string `json:"id" api:"required"`
BusinessName string `json:"businessName" api:"required"`
// The department the worker belongs to, or null if unassigned.
Department WorkerListResponseDepartment `json:"department" api:"required"`
// The "ui" name of a worker. If it's a business contractor business name is used.
// Otherwise we default to preferred name, then first-last.
DisplayName string `json:"displayName" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
Email string `json:"email" api:"required"`
// A date string in the form YYYY-MM-DD
EndDate string `json:"endDate" api:"required"`
FirstName string `json:"firstName" api:"required"`
IsBusiness bool `json:"isBusiness" api:"required"`
LastName string `json:"lastName" api:"required"`
Position string `json:"position" api:"required"`
PreferredName string `json:"preferredName" api:"required"`
// A date string in the form YYYY-MM-DD
StartDate string `json:"startDate" api:"required"`
// Any of "draft", "invited", "onboarding", "active", "offboarding", "inactive".
Status WorkerListResponseStatus `json:"status" api:"required"`
// The IANA timezone of the worker (e.g., America/New_York).
TimeZone string `json:"timeZone" api:"required"`
// Any of "employee", "contractor".
Type WorkerListResponseType `json:"type" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
WorkEmail string `json:"workEmail" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BusinessName respjson.Field
Department respjson.Field
DisplayName respjson.Field
Email respjson.Field
EndDate respjson.Field
FirstName respjson.Field
IsBusiness respjson.Field
LastName respjson.Field
Position respjson.Field
PreferredName respjson.Field
StartDate respjson.Field
Status respjson.Field
TimeZone respjson.Field
Type respjson.Field
WorkEmail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkerListResponse) RawJSON ¶
func (r WorkerListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerListResponse) UnmarshalJSON ¶
func (r *WorkerListResponse) UnmarshalJSON(data []byte) error
type WorkerListResponseDepartment ¶
type WorkerListResponseDepartment struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The department the worker belongs to, or null if unassigned.
func (WorkerListResponseDepartment) RawJSON ¶
func (r WorkerListResponseDepartment) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerListResponseDepartment) UnmarshalJSON ¶
func (r *WorkerListResponseDepartment) UnmarshalJSON(data []byte) error
type WorkerListResponseStatus ¶
type WorkerListResponseStatus string
const ( WorkerListResponseStatusDraft WorkerListResponseStatus = "draft" WorkerListResponseStatusInvited WorkerListResponseStatus = "invited" WorkerListResponseStatusOnboarding WorkerListResponseStatus = "onboarding" WorkerListResponseStatusActive WorkerListResponseStatus = "active" WorkerListResponseStatusOffboarding WorkerListResponseStatus = "offboarding" WorkerListResponseStatusInactive WorkerListResponseStatus = "inactive" )
type WorkerListResponseType ¶
type WorkerListResponseType string
const ( WorkerListResponseTypeEmployee WorkerListResponseType = "employee" WorkerListResponseTypeContractor WorkerListResponseType = "contractor" )
type WorkerNewContractorParams ¶
type WorkerNewContractorParams struct {
// The department to assign this contractor to.
DepartmentID string `json:"departmentId" api:"required"`
// Personal email address. The invite will be sent here.
Email string `json:"email" api:"required"`
// Whether the contractor is an individual person or a business entity.
//
// Any of "individual", "business".
EntityType WorkerNewContractorParamsEntityType `json:"entityType,omitzero" api:"required"`
// a non empty string
FirstName string `json:"firstName" api:"required"`
// a non empty string
LastName string `json:"lastName" api:"required"`
// The worker id of this contractor's direct manager.
ManagerID string `json:"managerId" api:"required"`
// The contractor's role or job title.
Position string `json:"position" api:"required"`
// A date string in the form YYYY-MM-DD
StartDate string `json:"startDate" api:"required"`
// Any of "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT",
// "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ",
// "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA",
// "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU",
// "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE",
// "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB",
// "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS",
// "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL",
// "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG",
// "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI",
// "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG",
// "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV",
// "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP",
// "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN",
// "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB",
// "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR",
// "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK",
// "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US",
// "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE",
// "YT", "ZA", "ZM", "ZW".
WorkCountry WorkerNewContractorParamsWorkCountry `json:"workCountry,omitzero" api:"required"`
// A description of the work the contractor will perform.
ScopeOfWork param.Opt[string] `json:"scopeOfWork,omitzero"`
// An email with a reasonably valid regex (shamelessly taken from zod)
WorkEmail param.Opt[string] `json:"workEmail,omitzero"`
// Required when entityType is "business". The legal name of the contractor's
// business.
BusinessName param.Opt[string] `json:"businessName,omitzero"`
// The pay rate for the contractor. Leave this blank if you'd like to pay this
// contractor on-demand or via invoicing.
Compensation WorkerNewContractorParamsCompensation `json:"compensation,omitzero"`
// The contractor's pay schedule. Must be a pay schedule that the company has
// configured.
//
// Any of "weekly", "biweekly", "monthly", "semimonthly", "quarterly", "annually".
PaySchedule WorkerNewContractorParamsPaySchedule `json:"paySchedule,omitzero"`
// contains filtered or unexported fields
}
func (WorkerNewContractorParams) MarshalJSON ¶
func (r WorkerNewContractorParams) MarshalJSON() (data []byte, err error)
func (*WorkerNewContractorParams) UnmarshalJSON ¶
func (r *WorkerNewContractorParams) UnmarshalJSON(data []byte) error
type WorkerNewContractorParamsCompensation ¶
type WorkerNewContractorParamsCompensation struct {
// a positive number
Amount float64 `json:"amount" api:"required"`
// Any of "USD", "AUD", "BGN", "BRL", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP",
// "HKD", "HUF", "IDR", "INR", "JPY", "MYR", "NOK", "NZD", "CNY", "PLN", "RON",
// "TRY", "SEK", "SGD", "AED", "ARS", "BDT", "BWP", "CLP", "COP", "CRC", "EGP",
// "FJD", "GEL", "GHS", "ILS", "KES", "KRW", "LKR", "MAD", "MXN", "NPR", "PHP",
// "PKR", "THB", "UAH", "UGX", "UYU", "VND", "ZAR", "ZMW", "TND", "NGN", "RSD",
// "TWD", "GTQ", "HNL", "DOP", "SAR", "XAF", "PEN".
Currency string `json:"currency,omitzero" api:"required"`
// The pay period for the compensation amount.
//
// Any of "hour", "year", "month", "week".
Per string `json:"per,omitzero" api:"required"`
// contains filtered or unexported fields
}
The pay rate for the contractor. Leave this blank if you'd like to pay this contractor on-demand or via invoicing.
The properties Amount, Currency, Per are required.
func (WorkerNewContractorParamsCompensation) MarshalJSON ¶
func (r WorkerNewContractorParamsCompensation) MarshalJSON() (data []byte, err error)
func (*WorkerNewContractorParamsCompensation) UnmarshalJSON ¶
func (r *WorkerNewContractorParamsCompensation) UnmarshalJSON(data []byte) error
type WorkerNewContractorParamsEntityType ¶
type WorkerNewContractorParamsEntityType string
Whether the contractor is an individual person or a business entity.
const ( WorkerNewContractorParamsEntityTypeIndividual WorkerNewContractorParamsEntityType = "individual" WorkerNewContractorParamsEntityTypeBusiness WorkerNewContractorParamsEntityType = "business" )
type WorkerNewContractorParamsPaySchedule ¶
type WorkerNewContractorParamsPaySchedule string
The contractor's pay schedule. Must be a pay schedule that the company has configured.
const ( WorkerNewContractorParamsPayScheduleWeekly WorkerNewContractorParamsPaySchedule = "weekly" WorkerNewContractorParamsPayScheduleBiweekly WorkerNewContractorParamsPaySchedule = "biweekly" WorkerNewContractorParamsPayScheduleMonthly WorkerNewContractorParamsPaySchedule = "monthly" WorkerNewContractorParamsPayScheduleSemimonthly WorkerNewContractorParamsPaySchedule = "semimonthly" WorkerNewContractorParamsPayScheduleQuarterly WorkerNewContractorParamsPaySchedule = "quarterly" WorkerNewContractorParamsPayScheduleAnnually WorkerNewContractorParamsPaySchedule = "annually" )
type WorkerNewContractorParamsWorkCountry ¶
type WorkerNewContractorParamsWorkCountry string
const ( WorkerNewContractorParamsWorkCountryAd WorkerNewContractorParamsWorkCountry = "AD" WorkerNewContractorParamsWorkCountryAe WorkerNewContractorParamsWorkCountry = "AE" WorkerNewContractorParamsWorkCountryAf WorkerNewContractorParamsWorkCountry = "AF" WorkerNewContractorParamsWorkCountryAg WorkerNewContractorParamsWorkCountry = "AG" WorkerNewContractorParamsWorkCountryAI WorkerNewContractorParamsWorkCountry = "AI" WorkerNewContractorParamsWorkCountryAl WorkerNewContractorParamsWorkCountry = "AL" WorkerNewContractorParamsWorkCountryAm WorkerNewContractorParamsWorkCountry = "AM" WorkerNewContractorParamsWorkCountryAo WorkerNewContractorParamsWorkCountry = "AO" WorkerNewContractorParamsWorkCountryAq WorkerNewContractorParamsWorkCountry = "AQ" WorkerNewContractorParamsWorkCountryAr WorkerNewContractorParamsWorkCountry = "AR" WorkerNewContractorParamsWorkCountryAs WorkerNewContractorParamsWorkCountry = "AS" WorkerNewContractorParamsWorkCountryAt WorkerNewContractorParamsWorkCountry = "AT" WorkerNewContractorParamsWorkCountryAu WorkerNewContractorParamsWorkCountry = "AU" WorkerNewContractorParamsWorkCountryAw WorkerNewContractorParamsWorkCountry = "AW" WorkerNewContractorParamsWorkCountryAx WorkerNewContractorParamsWorkCountry = "AX" WorkerNewContractorParamsWorkCountryAz WorkerNewContractorParamsWorkCountry = "AZ" WorkerNewContractorParamsWorkCountryBa WorkerNewContractorParamsWorkCountry = "BA" WorkerNewContractorParamsWorkCountryBb WorkerNewContractorParamsWorkCountry = "BB" WorkerNewContractorParamsWorkCountryBd WorkerNewContractorParamsWorkCountry = "BD" WorkerNewContractorParamsWorkCountryBe WorkerNewContractorParamsWorkCountry = "BE" WorkerNewContractorParamsWorkCountryBf WorkerNewContractorParamsWorkCountry = "BF" WorkerNewContractorParamsWorkCountryBg WorkerNewContractorParamsWorkCountry = "BG" WorkerNewContractorParamsWorkCountryBh WorkerNewContractorParamsWorkCountry = "BH" WorkerNewContractorParamsWorkCountryBi WorkerNewContractorParamsWorkCountry = "BI" WorkerNewContractorParamsWorkCountryBj WorkerNewContractorParamsWorkCountry = "BJ" WorkerNewContractorParamsWorkCountryBl WorkerNewContractorParamsWorkCountry = "BL" WorkerNewContractorParamsWorkCountryBm WorkerNewContractorParamsWorkCountry = "BM" WorkerNewContractorParamsWorkCountryBn WorkerNewContractorParamsWorkCountry = "BN" WorkerNewContractorParamsWorkCountryBo WorkerNewContractorParamsWorkCountry = "BO" WorkerNewContractorParamsWorkCountryBq WorkerNewContractorParamsWorkCountry = "BQ" WorkerNewContractorParamsWorkCountryBr WorkerNewContractorParamsWorkCountry = "BR" WorkerNewContractorParamsWorkCountryBs WorkerNewContractorParamsWorkCountry = "BS" WorkerNewContractorParamsWorkCountryBt WorkerNewContractorParamsWorkCountry = "BT" WorkerNewContractorParamsWorkCountryBv WorkerNewContractorParamsWorkCountry = "BV" WorkerNewContractorParamsWorkCountryBw WorkerNewContractorParamsWorkCountry = "BW" WorkerNewContractorParamsWorkCountryBy WorkerNewContractorParamsWorkCountry = "BY" WorkerNewContractorParamsWorkCountryBz WorkerNewContractorParamsWorkCountry = "BZ" WorkerNewContractorParamsWorkCountryCa WorkerNewContractorParamsWorkCountry = "CA" WorkerNewContractorParamsWorkCountryCc WorkerNewContractorParamsWorkCountry = "CC" WorkerNewContractorParamsWorkCountryCd WorkerNewContractorParamsWorkCountry = "CD" WorkerNewContractorParamsWorkCountryCf WorkerNewContractorParamsWorkCountry = "CF" WorkerNewContractorParamsWorkCountryCg WorkerNewContractorParamsWorkCountry = "CG" WorkerNewContractorParamsWorkCountryCh WorkerNewContractorParamsWorkCountry = "CH" WorkerNewContractorParamsWorkCountryCi WorkerNewContractorParamsWorkCountry = "CI" WorkerNewContractorParamsWorkCountryCk WorkerNewContractorParamsWorkCountry = "CK" WorkerNewContractorParamsWorkCountryCl WorkerNewContractorParamsWorkCountry = "CL" WorkerNewContractorParamsWorkCountryCm WorkerNewContractorParamsWorkCountry = "CM" WorkerNewContractorParamsWorkCountryCn WorkerNewContractorParamsWorkCountry = "CN" WorkerNewContractorParamsWorkCountryCo WorkerNewContractorParamsWorkCountry = "CO" WorkerNewContractorParamsWorkCountryCr WorkerNewContractorParamsWorkCountry = "CR" WorkerNewContractorParamsWorkCountryCu WorkerNewContractorParamsWorkCountry = "CU" WorkerNewContractorParamsWorkCountryCv WorkerNewContractorParamsWorkCountry = "CV" WorkerNewContractorParamsWorkCountryCw WorkerNewContractorParamsWorkCountry = "CW" WorkerNewContractorParamsWorkCountryCx WorkerNewContractorParamsWorkCountry = "CX" WorkerNewContractorParamsWorkCountryCy WorkerNewContractorParamsWorkCountry = "CY" WorkerNewContractorParamsWorkCountryCz WorkerNewContractorParamsWorkCountry = "CZ" WorkerNewContractorParamsWorkCountryDe WorkerNewContractorParamsWorkCountry = "DE" WorkerNewContractorParamsWorkCountryDj WorkerNewContractorParamsWorkCountry = "DJ" WorkerNewContractorParamsWorkCountryDk WorkerNewContractorParamsWorkCountry = "DK" WorkerNewContractorParamsWorkCountryDm WorkerNewContractorParamsWorkCountry = "DM" WorkerNewContractorParamsWorkCountryDo WorkerNewContractorParamsWorkCountry = "DO" WorkerNewContractorParamsWorkCountryDz WorkerNewContractorParamsWorkCountry = "DZ" WorkerNewContractorParamsWorkCountryEc WorkerNewContractorParamsWorkCountry = "EC" WorkerNewContractorParamsWorkCountryEe WorkerNewContractorParamsWorkCountry = "EE" WorkerNewContractorParamsWorkCountryEg WorkerNewContractorParamsWorkCountry = "EG" WorkerNewContractorParamsWorkCountryEh WorkerNewContractorParamsWorkCountry = "EH" WorkerNewContractorParamsWorkCountryEr WorkerNewContractorParamsWorkCountry = "ER" WorkerNewContractorParamsWorkCountryEs WorkerNewContractorParamsWorkCountry = "ES" WorkerNewContractorParamsWorkCountryEt WorkerNewContractorParamsWorkCountry = "ET" WorkerNewContractorParamsWorkCountryFi WorkerNewContractorParamsWorkCountry = "FI" WorkerNewContractorParamsWorkCountryFj WorkerNewContractorParamsWorkCountry = "FJ" WorkerNewContractorParamsWorkCountryFk WorkerNewContractorParamsWorkCountry = "FK" WorkerNewContractorParamsWorkCountryFm WorkerNewContractorParamsWorkCountry = "FM" WorkerNewContractorParamsWorkCountryFo WorkerNewContractorParamsWorkCountry = "FO" WorkerNewContractorParamsWorkCountryFr WorkerNewContractorParamsWorkCountry = "FR" WorkerNewContractorParamsWorkCountryGa WorkerNewContractorParamsWorkCountry = "GA" WorkerNewContractorParamsWorkCountryGB WorkerNewContractorParamsWorkCountry = "GB" WorkerNewContractorParamsWorkCountryGd WorkerNewContractorParamsWorkCountry = "GD" WorkerNewContractorParamsWorkCountryGe WorkerNewContractorParamsWorkCountry = "GE" WorkerNewContractorParamsWorkCountryGf WorkerNewContractorParamsWorkCountry = "GF" WorkerNewContractorParamsWorkCountryGg WorkerNewContractorParamsWorkCountry = "GG" WorkerNewContractorParamsWorkCountryGh WorkerNewContractorParamsWorkCountry = "GH" WorkerNewContractorParamsWorkCountryGi WorkerNewContractorParamsWorkCountry = "GI" WorkerNewContractorParamsWorkCountryGl WorkerNewContractorParamsWorkCountry = "GL" WorkerNewContractorParamsWorkCountryGm WorkerNewContractorParamsWorkCountry = "GM" WorkerNewContractorParamsWorkCountryGn WorkerNewContractorParamsWorkCountry = "GN" WorkerNewContractorParamsWorkCountryGp WorkerNewContractorParamsWorkCountry = "GP" WorkerNewContractorParamsWorkCountryGq WorkerNewContractorParamsWorkCountry = "GQ" WorkerNewContractorParamsWorkCountryGr WorkerNewContractorParamsWorkCountry = "GR" WorkerNewContractorParamsWorkCountryGs WorkerNewContractorParamsWorkCountry = "GS" WorkerNewContractorParamsWorkCountryGt WorkerNewContractorParamsWorkCountry = "GT" WorkerNewContractorParamsWorkCountryGu WorkerNewContractorParamsWorkCountry = "GU" WorkerNewContractorParamsWorkCountryGw WorkerNewContractorParamsWorkCountry = "GW" WorkerNewContractorParamsWorkCountryGy WorkerNewContractorParamsWorkCountry = "GY" WorkerNewContractorParamsWorkCountryHk WorkerNewContractorParamsWorkCountry = "HK" WorkerNewContractorParamsWorkCountryHm WorkerNewContractorParamsWorkCountry = "HM" WorkerNewContractorParamsWorkCountryHn WorkerNewContractorParamsWorkCountry = "HN" WorkerNewContractorParamsWorkCountryHr WorkerNewContractorParamsWorkCountry = "HR" WorkerNewContractorParamsWorkCountryHt WorkerNewContractorParamsWorkCountry = "HT" WorkerNewContractorParamsWorkCountryHu WorkerNewContractorParamsWorkCountry = "HU" WorkerNewContractorParamsWorkCountryID WorkerNewContractorParamsWorkCountry = "ID" WorkerNewContractorParamsWorkCountryIe WorkerNewContractorParamsWorkCountry = "IE" WorkerNewContractorParamsWorkCountryIl WorkerNewContractorParamsWorkCountry = "IL" WorkerNewContractorParamsWorkCountryIm WorkerNewContractorParamsWorkCountry = "IM" WorkerNewContractorParamsWorkCountryIn WorkerNewContractorParamsWorkCountry = "IN" WorkerNewContractorParamsWorkCountryIo WorkerNewContractorParamsWorkCountry = "IO" WorkerNewContractorParamsWorkCountryIq WorkerNewContractorParamsWorkCountry = "IQ" WorkerNewContractorParamsWorkCountryIr WorkerNewContractorParamsWorkCountry = "IR" WorkerNewContractorParamsWorkCountryIs WorkerNewContractorParamsWorkCountry = "IS" WorkerNewContractorParamsWorkCountryIt WorkerNewContractorParamsWorkCountry = "IT" WorkerNewContractorParamsWorkCountryJe WorkerNewContractorParamsWorkCountry = "JE" WorkerNewContractorParamsWorkCountryJm WorkerNewContractorParamsWorkCountry = "JM" WorkerNewContractorParamsWorkCountryJo WorkerNewContractorParamsWorkCountry = "JO" WorkerNewContractorParamsWorkCountryJp WorkerNewContractorParamsWorkCountry = "JP" WorkerNewContractorParamsWorkCountryKe WorkerNewContractorParamsWorkCountry = "KE" WorkerNewContractorParamsWorkCountryKg WorkerNewContractorParamsWorkCountry = "KG" WorkerNewContractorParamsWorkCountryKh WorkerNewContractorParamsWorkCountry = "KH" WorkerNewContractorParamsWorkCountryKi WorkerNewContractorParamsWorkCountry = "KI" WorkerNewContractorParamsWorkCountryKm WorkerNewContractorParamsWorkCountry = "KM" WorkerNewContractorParamsWorkCountryKn WorkerNewContractorParamsWorkCountry = "KN" WorkerNewContractorParamsWorkCountryKp WorkerNewContractorParamsWorkCountry = "KP" WorkerNewContractorParamsWorkCountryKr WorkerNewContractorParamsWorkCountry = "KR" WorkerNewContractorParamsWorkCountryKw WorkerNewContractorParamsWorkCountry = "KW" WorkerNewContractorParamsWorkCountryKy WorkerNewContractorParamsWorkCountry = "KY" WorkerNewContractorParamsWorkCountryKz WorkerNewContractorParamsWorkCountry = "KZ" WorkerNewContractorParamsWorkCountryLa WorkerNewContractorParamsWorkCountry = "LA" WorkerNewContractorParamsWorkCountryLb WorkerNewContractorParamsWorkCountry = "LB" WorkerNewContractorParamsWorkCountryLc WorkerNewContractorParamsWorkCountry = "LC" WorkerNewContractorParamsWorkCountryLi WorkerNewContractorParamsWorkCountry = "LI" WorkerNewContractorParamsWorkCountryLk WorkerNewContractorParamsWorkCountry = "LK" WorkerNewContractorParamsWorkCountryLr WorkerNewContractorParamsWorkCountry = "LR" WorkerNewContractorParamsWorkCountryLs WorkerNewContractorParamsWorkCountry = "LS" WorkerNewContractorParamsWorkCountryLt WorkerNewContractorParamsWorkCountry = "LT" WorkerNewContractorParamsWorkCountryLu WorkerNewContractorParamsWorkCountry = "LU" WorkerNewContractorParamsWorkCountryLv WorkerNewContractorParamsWorkCountry = "LV" WorkerNewContractorParamsWorkCountryLy WorkerNewContractorParamsWorkCountry = "LY" WorkerNewContractorParamsWorkCountryMa WorkerNewContractorParamsWorkCountry = "MA" WorkerNewContractorParamsWorkCountryMc WorkerNewContractorParamsWorkCountry = "MC" WorkerNewContractorParamsWorkCountryMd WorkerNewContractorParamsWorkCountry = "MD" WorkerNewContractorParamsWorkCountryMe WorkerNewContractorParamsWorkCountry = "ME" WorkerNewContractorParamsWorkCountryMf WorkerNewContractorParamsWorkCountry = "MF" WorkerNewContractorParamsWorkCountryMg WorkerNewContractorParamsWorkCountry = "MG" WorkerNewContractorParamsWorkCountryMh WorkerNewContractorParamsWorkCountry = "MH" WorkerNewContractorParamsWorkCountryMk WorkerNewContractorParamsWorkCountry = "MK" WorkerNewContractorParamsWorkCountryMl WorkerNewContractorParamsWorkCountry = "ML" WorkerNewContractorParamsWorkCountryMm WorkerNewContractorParamsWorkCountry = "MM" WorkerNewContractorParamsWorkCountryMn WorkerNewContractorParamsWorkCountry = "MN" WorkerNewContractorParamsWorkCountryMo WorkerNewContractorParamsWorkCountry = "MO" WorkerNewContractorParamsWorkCountryMp WorkerNewContractorParamsWorkCountry = "MP" WorkerNewContractorParamsWorkCountryMq WorkerNewContractorParamsWorkCountry = "MQ" WorkerNewContractorParamsWorkCountryMr WorkerNewContractorParamsWorkCountry = "MR" WorkerNewContractorParamsWorkCountryMs WorkerNewContractorParamsWorkCountry = "MS" WorkerNewContractorParamsWorkCountryMt WorkerNewContractorParamsWorkCountry = "MT" WorkerNewContractorParamsWorkCountryMu WorkerNewContractorParamsWorkCountry = "MU" WorkerNewContractorParamsWorkCountryMv WorkerNewContractorParamsWorkCountry = "MV" WorkerNewContractorParamsWorkCountryMw WorkerNewContractorParamsWorkCountry = "MW" WorkerNewContractorParamsWorkCountryMx WorkerNewContractorParamsWorkCountry = "MX" WorkerNewContractorParamsWorkCountryMy WorkerNewContractorParamsWorkCountry = "MY" WorkerNewContractorParamsWorkCountryMz WorkerNewContractorParamsWorkCountry = "MZ" WorkerNewContractorParamsWorkCountryNa WorkerNewContractorParamsWorkCountry = "NA" WorkerNewContractorParamsWorkCountryNc WorkerNewContractorParamsWorkCountry = "NC" WorkerNewContractorParamsWorkCountryNe WorkerNewContractorParamsWorkCountry = "NE" WorkerNewContractorParamsWorkCountryNf WorkerNewContractorParamsWorkCountry = "NF" WorkerNewContractorParamsWorkCountryNg WorkerNewContractorParamsWorkCountry = "NG" WorkerNewContractorParamsWorkCountryNi WorkerNewContractorParamsWorkCountry = "NI" WorkerNewContractorParamsWorkCountryNl WorkerNewContractorParamsWorkCountry = "NL" WorkerNewContractorParamsWorkCountryNo WorkerNewContractorParamsWorkCountry = "NO" WorkerNewContractorParamsWorkCountryNp WorkerNewContractorParamsWorkCountry = "NP" WorkerNewContractorParamsWorkCountryNr WorkerNewContractorParamsWorkCountry = "NR" WorkerNewContractorParamsWorkCountryNu WorkerNewContractorParamsWorkCountry = "NU" WorkerNewContractorParamsWorkCountryNz WorkerNewContractorParamsWorkCountry = "NZ" WorkerNewContractorParamsWorkCountryOm WorkerNewContractorParamsWorkCountry = "OM" WorkerNewContractorParamsWorkCountryPa WorkerNewContractorParamsWorkCountry = "PA" WorkerNewContractorParamsWorkCountryPe WorkerNewContractorParamsWorkCountry = "PE" WorkerNewContractorParamsWorkCountryPf WorkerNewContractorParamsWorkCountry = "PF" WorkerNewContractorParamsWorkCountryPg WorkerNewContractorParamsWorkCountry = "PG" WorkerNewContractorParamsWorkCountryPh WorkerNewContractorParamsWorkCountry = "PH" WorkerNewContractorParamsWorkCountryPk WorkerNewContractorParamsWorkCountry = "PK" WorkerNewContractorParamsWorkCountryPl WorkerNewContractorParamsWorkCountry = "PL" WorkerNewContractorParamsWorkCountryPm WorkerNewContractorParamsWorkCountry = "PM" WorkerNewContractorParamsWorkCountryPn WorkerNewContractorParamsWorkCountry = "PN" WorkerNewContractorParamsWorkCountryPr WorkerNewContractorParamsWorkCountry = "PR" WorkerNewContractorParamsWorkCountryPs WorkerNewContractorParamsWorkCountry = "PS" WorkerNewContractorParamsWorkCountryPt WorkerNewContractorParamsWorkCountry = "PT" WorkerNewContractorParamsWorkCountryPw WorkerNewContractorParamsWorkCountry = "PW" WorkerNewContractorParamsWorkCountryPy WorkerNewContractorParamsWorkCountry = "PY" WorkerNewContractorParamsWorkCountryQa WorkerNewContractorParamsWorkCountry = "QA" WorkerNewContractorParamsWorkCountryRe WorkerNewContractorParamsWorkCountry = "RE" WorkerNewContractorParamsWorkCountryRo WorkerNewContractorParamsWorkCountry = "RO" WorkerNewContractorParamsWorkCountryRs WorkerNewContractorParamsWorkCountry = "RS" WorkerNewContractorParamsWorkCountryRu WorkerNewContractorParamsWorkCountry = "RU" WorkerNewContractorParamsWorkCountryRw WorkerNewContractorParamsWorkCountry = "RW" WorkerNewContractorParamsWorkCountrySa WorkerNewContractorParamsWorkCountry = "SA" WorkerNewContractorParamsWorkCountrySb WorkerNewContractorParamsWorkCountry = "SB" WorkerNewContractorParamsWorkCountrySc WorkerNewContractorParamsWorkCountry = "SC" WorkerNewContractorParamsWorkCountrySd WorkerNewContractorParamsWorkCountry = "SD" WorkerNewContractorParamsWorkCountrySe WorkerNewContractorParamsWorkCountry = "SE" WorkerNewContractorParamsWorkCountrySg WorkerNewContractorParamsWorkCountry = "SG" WorkerNewContractorParamsWorkCountrySh WorkerNewContractorParamsWorkCountry = "SH" WorkerNewContractorParamsWorkCountrySi WorkerNewContractorParamsWorkCountry = "SI" WorkerNewContractorParamsWorkCountrySj WorkerNewContractorParamsWorkCountry = "SJ" WorkerNewContractorParamsWorkCountrySk WorkerNewContractorParamsWorkCountry = "SK" WorkerNewContractorParamsWorkCountrySl WorkerNewContractorParamsWorkCountry = "SL" WorkerNewContractorParamsWorkCountrySm WorkerNewContractorParamsWorkCountry = "SM" WorkerNewContractorParamsWorkCountrySn WorkerNewContractorParamsWorkCountry = "SN" WorkerNewContractorParamsWorkCountrySo WorkerNewContractorParamsWorkCountry = "SO" WorkerNewContractorParamsWorkCountrySr WorkerNewContractorParamsWorkCountry = "SR" WorkerNewContractorParamsWorkCountrySS WorkerNewContractorParamsWorkCountry = "SS" WorkerNewContractorParamsWorkCountrySt WorkerNewContractorParamsWorkCountry = "ST" WorkerNewContractorParamsWorkCountrySv WorkerNewContractorParamsWorkCountry = "SV" WorkerNewContractorParamsWorkCountrySx WorkerNewContractorParamsWorkCountry = "SX" WorkerNewContractorParamsWorkCountrySy WorkerNewContractorParamsWorkCountry = "SY" WorkerNewContractorParamsWorkCountrySz WorkerNewContractorParamsWorkCountry = "SZ" WorkerNewContractorParamsWorkCountryTc WorkerNewContractorParamsWorkCountry = "TC" WorkerNewContractorParamsWorkCountryTd WorkerNewContractorParamsWorkCountry = "TD" WorkerNewContractorParamsWorkCountryTf WorkerNewContractorParamsWorkCountry = "TF" WorkerNewContractorParamsWorkCountryTg WorkerNewContractorParamsWorkCountry = "TG" WorkerNewContractorParamsWorkCountryTh WorkerNewContractorParamsWorkCountry = "TH" WorkerNewContractorParamsWorkCountryTj WorkerNewContractorParamsWorkCountry = "TJ" WorkerNewContractorParamsWorkCountryTk WorkerNewContractorParamsWorkCountry = "TK" WorkerNewContractorParamsWorkCountryTl WorkerNewContractorParamsWorkCountry = "TL" WorkerNewContractorParamsWorkCountryTm WorkerNewContractorParamsWorkCountry = "TM" WorkerNewContractorParamsWorkCountryTn WorkerNewContractorParamsWorkCountry = "TN" WorkerNewContractorParamsWorkCountryTo WorkerNewContractorParamsWorkCountry = "TO" WorkerNewContractorParamsWorkCountryTr WorkerNewContractorParamsWorkCountry = "TR" WorkerNewContractorParamsWorkCountryTt WorkerNewContractorParamsWorkCountry = "TT" WorkerNewContractorParamsWorkCountryTv WorkerNewContractorParamsWorkCountry = "TV" WorkerNewContractorParamsWorkCountryTw WorkerNewContractorParamsWorkCountry = "TW" WorkerNewContractorParamsWorkCountryTz WorkerNewContractorParamsWorkCountry = "TZ" WorkerNewContractorParamsWorkCountryUa WorkerNewContractorParamsWorkCountry = "UA" WorkerNewContractorParamsWorkCountryUg WorkerNewContractorParamsWorkCountry = "UG" WorkerNewContractorParamsWorkCountryUm WorkerNewContractorParamsWorkCountry = "UM" WorkerNewContractorParamsWorkCountryUs WorkerNewContractorParamsWorkCountry = "US" WorkerNewContractorParamsWorkCountryUy WorkerNewContractorParamsWorkCountry = "UY" WorkerNewContractorParamsWorkCountryUz WorkerNewContractorParamsWorkCountry = "UZ" WorkerNewContractorParamsWorkCountryVa WorkerNewContractorParamsWorkCountry = "VA" WorkerNewContractorParamsWorkCountryVc WorkerNewContractorParamsWorkCountry = "VC" WorkerNewContractorParamsWorkCountryVe WorkerNewContractorParamsWorkCountry = "VE" WorkerNewContractorParamsWorkCountryVg WorkerNewContractorParamsWorkCountry = "VG" WorkerNewContractorParamsWorkCountryVi WorkerNewContractorParamsWorkCountry = "VI" WorkerNewContractorParamsWorkCountryVn WorkerNewContractorParamsWorkCountry = "VN" WorkerNewContractorParamsWorkCountryVu WorkerNewContractorParamsWorkCountry = "VU" WorkerNewContractorParamsWorkCountryWf WorkerNewContractorParamsWorkCountry = "WF" WorkerNewContractorParamsWorkCountryWs WorkerNewContractorParamsWorkCountry = "WS" WorkerNewContractorParamsWorkCountryXk WorkerNewContractorParamsWorkCountry = "XK" WorkerNewContractorParamsWorkCountryYe WorkerNewContractorParamsWorkCountry = "YE" WorkerNewContractorParamsWorkCountryYt WorkerNewContractorParamsWorkCountry = "YT" WorkerNewContractorParamsWorkCountryZa WorkerNewContractorParamsWorkCountry = "ZA" WorkerNewContractorParamsWorkCountryZm WorkerNewContractorParamsWorkCountry = "ZM" WorkerNewContractorParamsWorkCountryZw WorkerNewContractorParamsWorkCountry = "ZW" )
type WorkerNewContractorResponse ¶
type WorkerNewContractorResponse struct {
// The id of the worker.
ID string `json:"id" api:"required"`
BusinessName string `json:"businessName" api:"required"`
// The department the worker belongs to, or null if unassigned.
Department WorkerNewContractorResponseDepartment `json:"department" api:"required"`
// The "ui" name of a worker. If it's a business contractor business name is used.
// Otherwise we default to preferred name, then first-last.
DisplayName string `json:"displayName" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
Email string `json:"email" api:"required"`
// A date string in the form YYYY-MM-DD
EndDate string `json:"endDate" api:"required"`
FirstName string `json:"firstName" api:"required"`
IsBusiness bool `json:"isBusiness" api:"required"`
LastName string `json:"lastName" api:"required"`
Position string `json:"position" api:"required"`
PreferredName string `json:"preferredName" api:"required"`
// A date string in the form YYYY-MM-DD
StartDate string `json:"startDate" api:"required"`
// Any of "draft", "invited", "onboarding", "active", "offboarding", "inactive".
Status WorkerNewContractorResponseStatus `json:"status" api:"required"`
// The IANA timezone of the worker (e.g., America/New_York).
TimeZone string `json:"timeZone" api:"required"`
// Any of "employee", "contractor".
Type WorkerNewContractorResponseType `json:"type" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
WorkEmail string `json:"workEmail" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BusinessName respjson.Field
Department respjson.Field
DisplayName respjson.Field
Email respjson.Field
EndDate respjson.Field
FirstName respjson.Field
IsBusiness respjson.Field
LastName respjson.Field
Position respjson.Field
PreferredName respjson.Field
StartDate respjson.Field
Status respjson.Field
TimeZone respjson.Field
Type respjson.Field
WorkEmail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkerNewContractorResponse) RawJSON ¶
func (r WorkerNewContractorResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerNewContractorResponse) UnmarshalJSON ¶
func (r *WorkerNewContractorResponse) UnmarshalJSON(data []byte) error
type WorkerNewContractorResponseDepartment ¶
type WorkerNewContractorResponseDepartment struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The department the worker belongs to, or null if unassigned.
func (WorkerNewContractorResponseDepartment) RawJSON ¶
func (r WorkerNewContractorResponseDepartment) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerNewContractorResponseDepartment) UnmarshalJSON ¶
func (r *WorkerNewContractorResponseDepartment) UnmarshalJSON(data []byte) error
type WorkerNewContractorResponseStatus ¶
type WorkerNewContractorResponseStatus string
const ( WorkerNewContractorResponseStatusDraft WorkerNewContractorResponseStatus = "draft" WorkerNewContractorResponseStatusInvited WorkerNewContractorResponseStatus = "invited" WorkerNewContractorResponseStatusOnboarding WorkerNewContractorResponseStatus = "onboarding" WorkerNewContractorResponseStatusActive WorkerNewContractorResponseStatus = "active" WorkerNewContractorResponseStatusOffboarding WorkerNewContractorResponseStatus = "offboarding" WorkerNewContractorResponseStatusInactive WorkerNewContractorResponseStatus = "inactive" )
type WorkerNewContractorResponseType ¶
type WorkerNewContractorResponseType string
const ( WorkerNewContractorResponseTypeEmployee WorkerNewContractorResponseType = "employee" WorkerNewContractorResponseTypeContractor WorkerNewContractorResponseType = "contractor" )
type WorkerNewEmployeeParams ¶
type WorkerNewEmployeeParams struct {
// The employee's base compensation.
Compensation WorkerNewEmployeeParamsCompensation `json:"compensation,omitzero" api:"required"`
// The department to assign this employee to.
DepartmentID string `json:"departmentId" api:"required"`
// Personal email address. The invite will be sent here.
Email string `json:"email" api:"required"`
// a non empty string
FirstName string `json:"firstName" api:"required"`
// a non empty string
LastName string `json:"lastName" api:"required"`
// The worker id of this employee's direct manager.
ManagerID string `json:"managerId" api:"required"`
// The employee's job title.
Position string `json:"position" api:"required"`
// A date string in the form YYYY-MM-DD
StartDate string `json:"startDate" api:"required"`
// Where the employee will work. Either an existing company workplace or a remote
// US state.
WorkLocation WorkerNewEmployeeParamsWorkLocationUnion `json:"workLocation,omitzero" api:"required"`
// a non-negative number
StockOptions param.Opt[float64] `json:"stockOptions,omitzero"`
// An email with a reasonably valid regex (shamelessly taken from zod)
WorkEmail param.Opt[string] `json:"workEmail,omitzero"`
// Whether the employee is required to complete I-9 work authorization. Set to
// false if the employee has already been verified off-platform. Defaults to true.
RequireI9 param.Opt[bool] `json:"requireI9,omitzero"`
// The employee's pay schedule. Must be a pay schedule that the company has
// configured.
//
// Any of "weekly", "biweekly", "monthly", "semimonthly", "quarterly", "annually".
PaySchedule WorkerNewEmployeeParamsPaySchedule `json:"paySchedule,omitzero"`
// How state tax registration is handled for this employee's work state. Required
// when hiring in a state where your company doesn't have an existing registration.
// Use 'self_managed' if you've already registered in this state, or 'warp_managed'
// for Warp to handle registration on your behalf.
//
// Any of "self_managed", "warp_managed".
StateRegistration WorkerNewEmployeeParamsStateRegistration `json:"stateRegistration,omitzero"`
// contains filtered or unexported fields
}
func (WorkerNewEmployeeParams) MarshalJSON ¶
func (r WorkerNewEmployeeParams) MarshalJSON() (data []byte, err error)
func (*WorkerNewEmployeeParams) UnmarshalJSON ¶
func (r *WorkerNewEmployeeParams) UnmarshalJSON(data []byte) error
type WorkerNewEmployeeParamsCompensation ¶
type WorkerNewEmployeeParamsCompensation struct {
// a positive number
Amount float64 `json:"amount" api:"required"`
// Whether the amount is per hour or per year.
//
// Any of "hour", "year".
Per string `json:"per,omitzero" api:"required"`
// contains filtered or unexported fields
}
The employee's base compensation.
The properties Amount, Per are required.
func (WorkerNewEmployeeParamsCompensation) MarshalJSON ¶
func (r WorkerNewEmployeeParamsCompensation) MarshalJSON() (data []byte, err error)
func (*WorkerNewEmployeeParamsCompensation) UnmarshalJSON ¶
func (r *WorkerNewEmployeeParamsCompensation) UnmarshalJSON(data []byte) error
type WorkerNewEmployeeParamsPaySchedule ¶
type WorkerNewEmployeeParamsPaySchedule string
The employee's pay schedule. Must be a pay schedule that the company has configured.
const ( WorkerNewEmployeeParamsPayScheduleWeekly WorkerNewEmployeeParamsPaySchedule = "weekly" WorkerNewEmployeeParamsPayScheduleBiweekly WorkerNewEmployeeParamsPaySchedule = "biweekly" WorkerNewEmployeeParamsPayScheduleMonthly WorkerNewEmployeeParamsPaySchedule = "monthly" WorkerNewEmployeeParamsPayScheduleSemimonthly WorkerNewEmployeeParamsPaySchedule = "semimonthly" WorkerNewEmployeeParamsPayScheduleQuarterly WorkerNewEmployeeParamsPaySchedule = "quarterly" WorkerNewEmployeeParamsPayScheduleAnnually WorkerNewEmployeeParamsPaySchedule = "annually" )
type WorkerNewEmployeeParamsStateRegistration ¶
type WorkerNewEmployeeParamsStateRegistration string
How state tax registration is handled for this employee's work state. Required when hiring in a state where your company doesn't have an existing registration. Use 'self_managed' if you've already registered in this state, or 'warp_managed' for Warp to handle registration on your behalf.
const ( WorkerNewEmployeeParamsStateRegistrationSelfManaged WorkerNewEmployeeParamsStateRegistration = "self_managed" WorkerNewEmployeeParamsStateRegistrationWarpManaged WorkerNewEmployeeParamsStateRegistration = "warp_managed" )
type WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation ¶ added in v0.1.0
type WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation struct {
// Any of "office".
Type string `json:"type,omitzero" api:"required"`
// Public workplace identifier
WorkplaceID string `json:"workplaceId" api:"required"`
// contains filtered or unexported fields
}
Employee works from a company workplace.
The properties Type, WorkplaceID are required.
func (WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation) MarshalJSON ¶ added in v0.1.0
func (r WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation) MarshalJSON() (data []byte, err error)
func (*WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation) UnmarshalJSON ¶ added in v0.1.0
func (r *WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation) UnmarshalJSON(data []byte) error
type WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation ¶ added in v0.1.0
type WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation struct {
// The US state where the remote employee works. Required for tax purposes.
//
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
State string `json:"state,omitzero" api:"required"`
// Any of "remote".
Type string `json:"type,omitzero" api:"required"`
// contains filtered or unexported fields
}
Employee works remotely from a US state.
The properties State, Type are required.
func (WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation) MarshalJSON ¶ added in v0.1.0
func (r WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation) MarshalJSON() (data []byte, err error)
func (*WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation) UnmarshalJSON ¶ added in v0.1.0
func (r *WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation) UnmarshalJSON(data []byte) error
type WorkerNewEmployeeParamsWorkLocationUnion ¶
type WorkerNewEmployeeParamsWorkLocationUnion struct {
OfWorkerNewEmployeesWorkLocationOfficeWorkLocation *WorkerNewEmployeeParamsWorkLocationOfficeWorkLocation `json:",omitzero,inline"`
OfWorkerNewEmployeesWorkLocationRemoteWorkLocation *WorkerNewEmployeeParamsWorkLocationRemoteWorkLocation `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (WorkerNewEmployeeParamsWorkLocationUnion) MarshalJSON ¶
func (u WorkerNewEmployeeParamsWorkLocationUnion) MarshalJSON() ([]byte, error)
func (*WorkerNewEmployeeParamsWorkLocationUnion) UnmarshalJSON ¶
func (u *WorkerNewEmployeeParamsWorkLocationUnion) UnmarshalJSON(data []byte) error
type WorkerNewEmployeeResponse ¶
type WorkerNewEmployeeResponse struct {
// The id of the worker.
ID string `json:"id" api:"required"`
BusinessName string `json:"businessName" api:"required"`
// The department the worker belongs to, or null if unassigned.
Department WorkerNewEmployeeResponseDepartment `json:"department" api:"required"`
// The "ui" name of a worker. If it's a business contractor business name is used.
// Otherwise we default to preferred name, then first-last.
DisplayName string `json:"displayName" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
Email string `json:"email" api:"required"`
// A date string in the form YYYY-MM-DD
EndDate string `json:"endDate" api:"required"`
FirstName string `json:"firstName" api:"required"`
IsBusiness bool `json:"isBusiness" api:"required"`
LastName string `json:"lastName" api:"required"`
Position string `json:"position" api:"required"`
PreferredName string `json:"preferredName" api:"required"`
// A date string in the form YYYY-MM-DD
StartDate string `json:"startDate" api:"required"`
// Any of "draft", "invited", "onboarding", "active", "offboarding", "inactive".
Status WorkerNewEmployeeResponseStatus `json:"status" api:"required"`
// The IANA timezone of the worker (e.g., America/New_York).
TimeZone string `json:"timeZone" api:"required"`
// Any of "employee", "contractor".
Type WorkerNewEmployeeResponseType `json:"type" api:"required"`
// An email with a reasonably valid regex (shamelessly taken from zod)
WorkEmail string `json:"workEmail" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BusinessName respjson.Field
Department respjson.Field
DisplayName respjson.Field
Email respjson.Field
EndDate respjson.Field
FirstName respjson.Field
IsBusiness respjson.Field
LastName respjson.Field
Position respjson.Field
PreferredName respjson.Field
StartDate respjson.Field
Status respjson.Field
TimeZone respjson.Field
Type respjson.Field
WorkEmail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkerNewEmployeeResponse) RawJSON ¶
func (r WorkerNewEmployeeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerNewEmployeeResponse) UnmarshalJSON ¶
func (r *WorkerNewEmployeeResponse) UnmarshalJSON(data []byte) error
type WorkerNewEmployeeResponseDepartment ¶
type WorkerNewEmployeeResponseDepartment struct {
// The unique public id of the department
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The department the worker belongs to, or null if unassigned.
func (WorkerNewEmployeeResponseDepartment) RawJSON ¶
func (r WorkerNewEmployeeResponseDepartment) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkerNewEmployeeResponseDepartment) UnmarshalJSON ¶
func (r *WorkerNewEmployeeResponseDepartment) UnmarshalJSON(data []byte) error
type WorkerNewEmployeeResponseStatus ¶
type WorkerNewEmployeeResponseStatus string
const ( WorkerNewEmployeeResponseStatusDraft WorkerNewEmployeeResponseStatus = "draft" WorkerNewEmployeeResponseStatusInvited WorkerNewEmployeeResponseStatus = "invited" WorkerNewEmployeeResponseStatusOnboarding WorkerNewEmployeeResponseStatus = "onboarding" WorkerNewEmployeeResponseStatusActive WorkerNewEmployeeResponseStatus = "active" WorkerNewEmployeeResponseStatusOffboarding WorkerNewEmployeeResponseStatus = "offboarding" WorkerNewEmployeeResponseStatusInactive WorkerNewEmployeeResponseStatus = "inactive" )
type WorkerNewEmployeeResponseType ¶
type WorkerNewEmployeeResponseType string
const ( WorkerNewEmployeeResponseTypeEmployee WorkerNewEmployeeResponseType = "employee" WorkerNewEmployeeResponseTypeContractor WorkerNewEmployeeResponseType = "contractor" )
type WorkerService ¶
type WorkerService struct {
// contains filtered or unexported fields
}
Endpoints for worker management. "Workers" include anyone employed by your company, whether US or international, full-time employees or contractors.
WorkerService contains methods and other services that help with interacting with the warp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkerService method instead.
func NewWorkerService ¶
func NewWorkerService(opts ...option.RequestOption) (r WorkerService)
NewWorkerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkerService) Delete ¶
func (r *WorkerService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Delete a worker. Only workers who have not yet completed onboarding can be deleted. Active workers must be properly offboarded.
func (*WorkerService) Get ¶
func (r *WorkerService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkerGetResponse, err error)
Get a specific worker by id.
func (*WorkerService) Invite ¶
func (r *WorkerService) Invite(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkerInviteResponse, err error)
Send or resend the worker invite so they can accept and complete onboarding to Warp. If the worker has already been invited, the invite will be resent with extended validity.
func (*WorkerService) List ¶
func (r *WorkerService) List(ctx context.Context, query WorkerListParams, opts ...option.RequestOption) (res *pagination.CursorPage[WorkerListResponse], err error)
List all workers. Workers include anyone employed by the company, whether US or international, full-time employees or contractors.
func (*WorkerService) ListAutoPaging ¶
func (r *WorkerService) ListAutoPaging(ctx context.Context, query WorkerListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[WorkerListResponse]
List all workers. Workers include anyone employed by the company, whether US or international, full-time employees or contractors.
func (*WorkerService) NewContractor ¶
func (r *WorkerService) NewContractor(ctx context.Context, body WorkerNewContractorParams, opts ...option.RequestOption) (res *WorkerNewContractorResponse, err error)
Create a new contractor. The worker will be created in draft status and must be invited separately via the invite endpoint. For business contractors, the businessName field is required.
func (*WorkerService) NewEmployee ¶
func (r *WorkerService) NewEmployee(ctx context.Context, body WorkerNewEmployeeParams, opts ...option.RequestOption) (res *WorkerNewEmployeeResponse, err error)
Create a new US employee. The worker will be created in draft status and must be invited separately via the invite endpoint. If hiring in a state without an existing tax registration, you must specify the stateRegistration field.
type WorkplaceListParams ¶
type WorkplaceListParams struct {
// Public workplace identifier
AfterID param.Opt[string] `query:"afterId,omitzero" json:"-"`
// Public workplace identifier
BeforeID param.Opt[string] `query:"beforeId,omitzero" json:"-"`
// a number less than or equal to 100
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkplaceListParams) URLQuery ¶
func (r WorkplaceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkplaceListParams's query parameters as `url.Values`.
type WorkplaceListResponse ¶
type WorkplaceListResponse struct {
// Public workplace identifier
ID string `json:"id" api:"required"`
// A valid US address
Address WorkplaceListResponseAddress `json:"address" api:"required"`
// a string to be decoded into a Date
CreatedAt string `json:"createdAt" api:"required"`
Name string `json:"name" api:"required"`
// Any of "active", "archived".
Status WorkplaceListResponseStatus `json:"status" api:"required"`
// Any of "remote", "office".
Type WorkplaceListResponseType `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Address respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkplaceListResponse) RawJSON ¶
func (r WorkplaceListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkplaceListResponse) UnmarshalJSON ¶
func (r *WorkplaceListResponse) UnmarshalJSON(data []byte) error
type WorkplaceListResponseAddress ¶
type WorkplaceListResponseAddress struct {
City string `json:"city" api:"required"`
// Any of "US".
Country string `json:"country" api:"required"`
// a non empty string
Line1 string `json:"line1" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
State string `json:"state" api:"required"`
Line2 string `json:"line2" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
City respjson.Field
Country respjson.Field
Line1 respjson.Field
PostalCode respjson.Field
State respjson.Field
Line2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A valid US address
func (WorkplaceListResponseAddress) RawJSON ¶
func (r WorkplaceListResponseAddress) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkplaceListResponseAddress) UnmarshalJSON ¶
func (r *WorkplaceListResponseAddress) UnmarshalJSON(data []byte) error
type WorkplaceListResponseStatus ¶
type WorkplaceListResponseStatus string
const ( WorkplaceListResponseStatusActive WorkplaceListResponseStatus = "active" WorkplaceListResponseStatusArchived WorkplaceListResponseStatus = "archived" )
type WorkplaceListResponseType ¶
type WorkplaceListResponseType string
const ( WorkplaceListResponseTypeRemote WorkplaceListResponseType = "remote" WorkplaceListResponseTypeOffice WorkplaceListResponseType = "office" )
type WorkplaceNewParams ¶
type WorkplaceNewParams struct {
// A valid US address
Address WorkplaceNewParamsAddress `json:"address,omitzero" api:"required"`
// a non empty string
Name string `json:"name" api:"required"`
// Any of "remote", "office".
Type WorkplaceNewParamsType `json:"type,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (WorkplaceNewParams) MarshalJSON ¶
func (r WorkplaceNewParams) MarshalJSON() (data []byte, err error)
func (*WorkplaceNewParams) UnmarshalJSON ¶
func (r *WorkplaceNewParams) UnmarshalJSON(data []byte) error
type WorkplaceNewParamsAddress ¶
type WorkplaceNewParamsAddress struct {
City string `json:"city" api:"required"`
// Any of "US".
Country string `json:"country,omitzero" api:"required"`
// a non empty string
Line1 string `json:"line1" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
State string `json:"state,omitzero" api:"required"`
Line2 param.Opt[string] `json:"line2,omitzero"`
// contains filtered or unexported fields
}
A valid US address
The properties City, Country, Line1, PostalCode, State are required.
func (WorkplaceNewParamsAddress) MarshalJSON ¶
func (r WorkplaceNewParamsAddress) MarshalJSON() (data []byte, err error)
func (*WorkplaceNewParamsAddress) UnmarshalJSON ¶
func (r *WorkplaceNewParamsAddress) UnmarshalJSON(data []byte) error
type WorkplaceNewParamsType ¶
type WorkplaceNewParamsType string
const ( WorkplaceNewParamsTypeRemote WorkplaceNewParamsType = "remote" WorkplaceNewParamsTypeOffice WorkplaceNewParamsType = "office" )
type WorkplaceNewResponse ¶
type WorkplaceNewResponse struct {
// Public workplace identifier
ID string `json:"id" api:"required"`
// A valid US address
Address WorkplaceNewResponseAddress `json:"address" api:"required"`
// a string to be decoded into a Date
CreatedAt string `json:"createdAt" api:"required"`
Name string `json:"name" api:"required"`
// Any of "active", "archived".
Status WorkplaceNewResponseStatus `json:"status" api:"required"`
// Any of "remote", "office".
Type WorkplaceNewResponseType `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Address respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkplaceNewResponse) RawJSON ¶
func (r WorkplaceNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkplaceNewResponse) UnmarshalJSON ¶
func (r *WorkplaceNewResponse) UnmarshalJSON(data []byte) error
type WorkplaceNewResponseAddress ¶
type WorkplaceNewResponseAddress struct {
City string `json:"city" api:"required"`
// Any of "US".
Country string `json:"country" api:"required"`
// a non empty string
Line1 string `json:"line1" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
State string `json:"state" api:"required"`
Line2 string `json:"line2" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
City respjson.Field
Country respjson.Field
Line1 respjson.Field
PostalCode respjson.Field
State respjson.Field
Line2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A valid US address
func (WorkplaceNewResponseAddress) RawJSON ¶
func (r WorkplaceNewResponseAddress) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkplaceNewResponseAddress) UnmarshalJSON ¶
func (r *WorkplaceNewResponseAddress) UnmarshalJSON(data []byte) error
type WorkplaceNewResponseStatus ¶
type WorkplaceNewResponseStatus string
const ( WorkplaceNewResponseStatusActive WorkplaceNewResponseStatus = "active" WorkplaceNewResponseStatusArchived WorkplaceNewResponseStatus = "archived" )
type WorkplaceNewResponseType ¶
type WorkplaceNewResponseType string
const ( WorkplaceNewResponseTypeRemote WorkplaceNewResponseType = "remote" WorkplaceNewResponseTypeOffice WorkplaceNewResponseType = "office" )
type WorkplaceService ¶
type WorkplaceService struct {
// contains filtered or unexported fields
}
Endpoints for workplace management. Create, list, and update workplaces within your company.
WorkplaceService contains methods and other services that help with interacting with the warp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkplaceService method instead.
func NewWorkplaceService ¶
func NewWorkplaceService(opts ...option.RequestOption) (r WorkplaceService)
NewWorkplaceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkplaceService) List ¶
func (r *WorkplaceService) List(ctx context.Context, query WorkplaceListParams, opts ...option.RequestOption) (res *pagination.CursorPage[WorkplaceListResponse], err error)
List all workplaces for your company.
func (*WorkplaceService) ListAutoPaging ¶
func (r *WorkplaceService) ListAutoPaging(ctx context.Context, query WorkplaceListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[WorkplaceListResponse]
List all workplaces for your company.
func (*WorkplaceService) New ¶
func (r *WorkplaceService) New(ctx context.Context, body WorkplaceNewParams, opts ...option.RequestOption) (res *WorkplaceNewResponse, err error)
Create a new workplace.
func (*WorkplaceService) Update ¶
func (r *WorkplaceService) Update(ctx context.Context, id string, body WorkplaceUpdateParams, opts ...option.RequestOption) (res *WorkplaceUpdateResponse, err error)
Update an existing workplace.
type WorkplaceUpdateParams ¶
type WorkplaceUpdateParams struct {
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (WorkplaceUpdateParams) MarshalJSON ¶
func (r WorkplaceUpdateParams) MarshalJSON() (data []byte, err error)
func (*WorkplaceUpdateParams) UnmarshalJSON ¶
func (r *WorkplaceUpdateParams) UnmarshalJSON(data []byte) error
type WorkplaceUpdateResponse ¶
type WorkplaceUpdateResponse struct {
// Public workplace identifier
ID string `json:"id" api:"required"`
// A valid US address
Address WorkplaceUpdateResponseAddress `json:"address" api:"required"`
// a string to be decoded into a Date
CreatedAt string `json:"createdAt" api:"required"`
Name string `json:"name" api:"required"`
// Any of "active", "archived".
Status WorkplaceUpdateResponseStatus `json:"status" api:"required"`
// Any of "remote", "office".
Type WorkplaceUpdateResponseType `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Address respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkplaceUpdateResponse) RawJSON ¶
func (r WorkplaceUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkplaceUpdateResponse) UnmarshalJSON ¶
func (r *WorkplaceUpdateResponse) UnmarshalJSON(data []byte) error
type WorkplaceUpdateResponseAddress ¶
type WorkplaceUpdateResponseAddress struct {
City string `json:"city" api:"required"`
// Any of "US".
Country string `json:"country" api:"required"`
// a non empty string
Line1 string `json:"line1" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
// Any of "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI",
// "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS",
// "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
// "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY".
State string `json:"state" api:"required"`
Line2 string `json:"line2" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
City respjson.Field
Country respjson.Field
Line1 respjson.Field
PostalCode respjson.Field
State respjson.Field
Line2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A valid US address
func (WorkplaceUpdateResponseAddress) RawJSON ¶
func (r WorkplaceUpdateResponseAddress) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkplaceUpdateResponseAddress) UnmarshalJSON ¶
func (r *WorkplaceUpdateResponseAddress) UnmarshalJSON(data []byte) error
type WorkplaceUpdateResponseStatus ¶
type WorkplaceUpdateResponseStatus string
const ( WorkplaceUpdateResponseStatusActive WorkplaceUpdateResponseStatus = "active" WorkplaceUpdateResponseStatusArchived WorkplaceUpdateResponseStatus = "archived" )
type WorkplaceUpdateResponseType ¶
type WorkplaceUpdateResponseType string
const ( WorkplaceUpdateResponseTypeRemote WorkplaceUpdateResponseType = "remote" WorkplaceUpdateResponseTypeOffice WorkplaceUpdateResponseType = "office" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|