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 AccessPolicy
- type AccessPolicyApprovalProcedure
- type AccessPolicyApprovalProcedureDeleteParams
- type AccessPolicyApprovalProcedureDeleteResponse
- type AccessPolicyApprovalProcedureGetParams
- type AccessPolicyApprovalProcedureGetResponseEnvelope
- type AccessPolicyApprovalProcedureListResponseEnvelope
- type AccessPolicyApprovalProcedureNewParams
- type AccessPolicyApprovalProcedureNewParamsStep
- type AccessPolicyApprovalProcedureNewResponseEnvelope
- type AccessPolicyApprovalProcedureService
- func (r *AccessPolicyApprovalProcedureService) Delete(ctx context.Context, id string, body AccessPolicyApprovalProcedureDeleteParams, ...) (res *AccessPolicyApprovalProcedureDeleteResponse, err error)
- func (r *AccessPolicyApprovalProcedureService) Get(ctx context.Context, id string, query AccessPolicyApprovalProcedureGetParams, ...) (res *AccessPolicyApprovalProcedure, err error)
- func (r *AccessPolicyApprovalProcedureService) List(ctx context.Context, accessPolicyID string, opts ...option.RequestOption) (res *[]AccessPolicyApprovalProcedure, err error)
- func (r *AccessPolicyApprovalProcedureService) New(ctx context.Context, accessPolicyID string, ...) (res *AccessPolicyApprovalProcedure, err error)
- func (r *AccessPolicyApprovalProcedureService) Update(ctx context.Context, id string, ...) (res *AccessPolicyApprovalProcedure, err error)
- type AccessPolicyApprovalProcedureStep
- type AccessPolicyApprovalProcedureUpdateParams
- type AccessPolicyApprovalProcedureUpdateParamsStep
- type AccessPolicyApprovalProcedureUpdateResponseEnvelope
- type AccessPolicyDeleteResponse
- type AccessPolicyGetResponseEnvelope
- type AccessPolicyListParams
- type AccessPolicyListResponseEnvelope
- type AccessPolicyNewParams
- type AccessPolicyNewResponseEnvelope
- type AccessPolicyService
- func (r *AccessPolicyService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AccessPolicyDeleteResponse, err error)
- func (r *AccessPolicyService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AccessPolicy, err error)
- func (r *AccessPolicyService) List(ctx context.Context, query AccessPolicyListParams, ...) (res *[]AccessPolicy, err error)
- func (r *AccessPolicyService) New(ctx context.Context, body AccessPolicyNewParams, opts ...option.RequestOption) (res *AccessPolicy, err error)
- func (r *AccessPolicyService) Update(ctx context.Context, id string, body AccessPolicyUpdateParams, ...) (res *AccessPolicy, err error)
- type AccessPolicyUpdateParams
- type AccessPolicyUpdateResponseEnvelope
- type AppInstance
- type AppInstanceDeleteResponse
- type AppInstanceGetResponseEnvelope
- type AppInstanceListParams
- type AppInstanceListResponseEnvelope
- type AppInstanceNewParams
- type AppInstanceNewResponseEnvelope
- type AppInstanceService
- func (r *AppInstanceService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AppInstanceDeleteResponse, err error)
- func (r *AppInstanceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AppInstance, err error)
- func (r *AppInstanceService) List(ctx context.Context, query AppInstanceListParams, opts ...option.RequestOption) (res *[]AppInstance, err error)
- func (r *AppInstanceService) New(ctx context.Context, body AppInstanceNewParams, opts ...option.RequestOption) (res *AppInstance, err error)
- func (r *AppInstanceService) Update(ctx context.Context, id string, body AppInstanceUpdateParams, ...) (res *AppInstance, err error)
- type AppInstanceUpdateParams
- type AppInstanceUpdateResponseEnvelope
- type AppResource
- type AppResourceDeleteResponse
- type AppResourceEntitlement
- type AppResourceEntitlementDeleteResponse
- type AppResourceEntitlementGetResponseEnvelope
- type AppResourceEntitlementListParams
- type AppResourceEntitlementListResponseEnvelope
- type AppResourceEntitlementNewParams
- type AppResourceEntitlementNewResponseEnvelope
- type AppResourceEntitlementService
- func (r *AppResourceEntitlementService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResourceEntitlementDeleteResponse, err error)
- func (r *AppResourceEntitlementService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResourceEntitlement, err error)
- func (r *AppResourceEntitlementService) List(ctx context.Context, query AppResourceEntitlementListParams, ...) (res *[]AppResourceEntitlement, err error)
- func (r *AppResourceEntitlementService) New(ctx context.Context, body AppResourceEntitlementNewParams, ...) (res *AppResourceEntitlement, err error)
- func (r *AppResourceEntitlementService) Update(ctx context.Context, id string, body AppResourceEntitlementUpdateParams, ...) (res *AppResourceEntitlement, err error)
- type AppResourceEntitlementUpdateParams
- type AppResourceEntitlementUpdateResponseEnvelope
- type AppResourceGetResponseEnvelope
- type AppResourceListParams
- type AppResourceListResponseEnvelope
- type AppResourceNewParams
- type AppResourceNewResponseEnvelope
- type AppResourceService
- func (r *AppResourceService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResourceDeleteResponse, err error)
- func (r *AppResourceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResource, err error)
- func (r *AppResourceService) List(ctx context.Context, query AppResourceListParams, opts ...option.RequestOption) (res *[]AppResource, err error)
- func (r *AppResourceService) New(ctx context.Context, body AppResourceNewParams, opts ...option.RequestOption) (res *AppResource, err error)
- func (r *AppResourceService) Update(ctx context.Context, id string, body AppResourceUpdateParams, ...) (res *AppResource, err error)
- type AppResourceUpdateParams
- type AppResourceUpdateResponseEnvelope
- 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 Error
- type Group
- type GroupDeleteResponse
- type GroupGetResponseEnvelope
- type GroupListParams
- type GroupListResponse
- type GroupNewParams
- type GroupNewResponseEnvelope
- type GroupService
- func (r *GroupService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *GroupDeleteResponse, err error)
- func (r *GroupService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Group, err error)
- func (r *GroupService) List(ctx context.Context, query GroupListParams, opts ...option.RequestOption) (res *GroupListResponse, err error)
- func (r *GroupService) New(ctx context.Context, body GroupNewParams, opts ...option.RequestOption) (res *Group, err error)
- func (r *GroupService) Update(ctx context.Context, id string, body GroupUpdateParams, ...) (res *Group, err error)
- type GroupUpdateParams
- type GroupUpdateResponseEnvelope
- type Guidance
- type GuidanceDeleteResponse
- type GuidanceGetResponseEnvelope
- type GuidanceListParams
- type GuidanceListResponseEnvelope
- type GuidanceNewParams
- type GuidanceNewResponseEnvelope
- type GuidanceService
- func (r *GuidanceService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *GuidanceDeleteResponse, err error)
- func (r *GuidanceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Guidance, err error)
- func (r *GuidanceService) List(ctx context.Context, query GuidanceListParams, opts ...option.RequestOption) (res *[]Guidance, err error)
- func (r *GuidanceService) New(ctx context.Context, body GuidanceNewParams, opts ...option.RequestOption) (res *Guidance, err error)
- func (r *GuidanceService) Update(ctx context.Context, id string, body GuidanceUpdateParams, ...) (res *Guidance, err error)
- type GuidanceUpdateParams
- type GuidanceUpdateResponseEnvelope
- type Team
- type TeamDeleteResponse
- type TeamGetResponseEnvelope
- type TeamListParams
- type TeamListResponse
- type TeamNewParams
- type TeamNewResponseEnvelope
- type TeamService
- func (r *TeamService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *TeamDeleteResponse, err error)
- func (r *TeamService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Team, err error)
- func (r *TeamService) List(ctx context.Context, query TeamListParams, opts ...option.RequestOption) (res *TeamListResponse, err error)
- func (r *TeamService) New(ctx context.Context, body TeamNewParams, opts ...option.RequestOption) (res *Team, err error)
- func (r *TeamService) Update(ctx context.Context, id string, body TeamUpdateParams, ...) (res *Team, err error)
- type TeamUpdateParams
- type TeamUpdateResponseEnvelope
- type User
- type UserDeleteResponse
- type UserGetResponseEnvelope
- type UserListParams
- type UserListResponse
- type UserNewParams
- type UserNewParamsRole
- type UserNewResponseEnvelope
- type UserRole
- type UserService
- func (r *UserService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *UserDeleteResponse, err error)
- func (r *UserService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *User, err error)
- func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *UserListResponse, err error)
- func (r *UserService) New(ctx context.Context, body UserNewParams, opts ...option.RequestOption) (res *User, err error)
- func (r *UserService) Update(ctx context.Context, id string, body UserUpdateParams, ...) (res *User, err error)
- type UserUpdateParams
- type UserUpdateParamsRole
- type UserUpdateResponseEnvelope
- type Workflow
- type WorkflowApprovalProcedure
- type WorkflowApprovalProcedureDeleteParams
- type WorkflowApprovalProcedureDeleteResponse
- type WorkflowApprovalProcedureGetParams
- type WorkflowApprovalProcedureGetResponseEnvelope
- type WorkflowApprovalProcedureListResponseEnvelope
- type WorkflowApprovalProcedureNewParams
- type WorkflowApprovalProcedureNewParamsStep
- type WorkflowApprovalProcedureNewResponseEnvelope
- type WorkflowApprovalProcedureService
- func (r *WorkflowApprovalProcedureService) Delete(ctx context.Context, id string, body WorkflowApprovalProcedureDeleteParams, ...) (res *WorkflowApprovalProcedureDeleteResponse, err error)
- func (r *WorkflowApprovalProcedureService) Get(ctx context.Context, id string, query WorkflowApprovalProcedureGetParams, ...) (res *WorkflowApprovalProcedure, err error)
- func (r *WorkflowApprovalProcedureService) List(ctx context.Context, workflowID string, opts ...option.RequestOption) (res *[]WorkflowApprovalProcedure, err error)
- func (r *WorkflowApprovalProcedureService) New(ctx context.Context, workflowID string, ...) (res *WorkflowApprovalProcedure, err error)
- func (r *WorkflowApprovalProcedureService) Update(ctx context.Context, id string, params WorkflowApprovalProcedureUpdateParams, ...) (res *WorkflowApprovalProcedure, err error)
- type WorkflowApprovalProcedureStep
- type WorkflowApprovalProcedureUpdateParams
- type WorkflowApprovalProcedureUpdateParamsStep
- type WorkflowApprovalProcedureUpdateResponseEnvelope
- type WorkflowDeleteResponse
- type WorkflowExecutionScope
- type WorkflowGetResponseEnvelope
- type WorkflowListParams
- type WorkflowListResponseEnvelope
- type WorkflowNewParams
- type WorkflowNewParamsExecutionScope
- type WorkflowNewParamsType
- type WorkflowNewResponseEnvelope
- type WorkflowService
- func (r *WorkflowService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkflowDeleteResponse, err error)
- func (r *WorkflowService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Workflow, err error)
- func (r *WorkflowService) List(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) (res *[]Workflow, err error)
- func (r *WorkflowService) New(ctx context.Context, body WorkflowNewParams, opts ...option.RequestOption) (res *Workflow, err error)
- func (r *WorkflowService) Update(ctx context.Context, id string, body WorkflowUpdateParams, ...) (res *Workflow, err error)
- type WorkflowType
- type WorkflowUpdateParams
- type WorkflowUpdateParamsExecutionScope
- type WorkflowUpdateParamsType
- type WorkflowUpdateResponseEnvelope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (SERVAL_API_KEY, SERVAL_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AccessPolicy ¶
type AccessPolicy struct {
// The ID of the access policy.
ID string `json:"id"`
// A description of the access policy.
Description string `json:"description"`
// The maximum number of minutes that access can be granted for.
MaxAccessMinutes int64 `json:"maxAccessMinutes"`
// The name of the access policy.
Name string `json:"name"`
// Whether a business justification is required when requesting access.
RequireBusinessJustification bool `json:"requireBusinessJustification"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Description respjson.Field
MaxAccessMinutes respjson.Field
Name respjson.Field
RequireBusinessJustification respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicy) RawJSON ¶
func (r AccessPolicy) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicy) UnmarshalJSON ¶
func (r *AccessPolicy) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedure ¶
type AccessPolicyApprovalProcedure struct {
// The ID of the access policy approval procedure.
ID string `json:"id"`
// The steps in the approval procedure.
Steps []AccessPolicyApprovalProcedureStep `json:"steps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Steps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyApprovalProcedure) RawJSON ¶
func (r AccessPolicyApprovalProcedure) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyApprovalProcedure) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedure) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureDeleteParams ¶
type AccessPolicyApprovalProcedureDeleteParams struct {
// The ID of the access policy.
AccessPolicyID string `path:"access_policy_id,required" json:"-"`
// contains filtered or unexported fields
}
type AccessPolicyApprovalProcedureDeleteResponse ¶
type AccessPolicyApprovalProcedureDeleteResponse = any
type AccessPolicyApprovalProcedureGetParams ¶
type AccessPolicyApprovalProcedureGetParams struct {
// The ID of the access policy.
AccessPolicyID string `path:"access_policy_id,required" json:"-"`
// contains filtered or unexported fields
}
type AccessPolicyApprovalProcedureGetResponseEnvelope ¶
type AccessPolicyApprovalProcedureGetResponseEnvelope struct {
// The approval procedure.
Data AccessPolicyApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyApprovalProcedureGetResponseEnvelope) RawJSON ¶
func (r AccessPolicyApprovalProcedureGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyApprovalProcedureGetResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureGetResponseEnvelope) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureListResponseEnvelope ¶
type AccessPolicyApprovalProcedureListResponseEnvelope struct {
// The list of approval procedures.
Data []AccessPolicyApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyApprovalProcedureListResponseEnvelope) RawJSON ¶
func (r AccessPolicyApprovalProcedureListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyApprovalProcedureListResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureListResponseEnvelope) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureNewParams ¶
type AccessPolicyApprovalProcedureNewParams struct {
// The approval steps for the procedure.
Steps []AccessPolicyApprovalProcedureNewParamsStep `json:"steps,omitzero"`
// contains filtered or unexported fields
}
func (AccessPolicyApprovalProcedureNewParams) MarshalJSON ¶
func (r AccessPolicyApprovalProcedureNewParams) MarshalJSON() (data []byte, err error)
func (*AccessPolicyApprovalProcedureNewParams) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureNewParams) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureNewParamsStep ¶
type AccessPolicyApprovalProcedureNewParamsStep struct {
// The ID of the approval step.
ID param.Opt[string] `json:"id,omitzero"`
// Whether the step can be approved by the requester themselves.
AllowSelfApproval param.Opt[bool] `json:"allowSelfApproval,omitzero"`
// The IDs of the Serval groups that can approve the step.
ServalGroupIDs []string `json:"servalGroupIds,omitzero"`
// The IDs of the specific users that can approve the step.
SpecificUserIDs []string `json:"specificUserIds,omitzero"`
// The type of approval step.
//
// Any of "APPROVAL_PROCEDURE_STEP_TYPE_UNSPECIFIED", "SPECIFIC_USERS",
// "SERVAL_GROUPS".
StepType string `json:"stepType,omitzero"`
// contains filtered or unexported fields
}
func (AccessPolicyApprovalProcedureNewParamsStep) MarshalJSON ¶
func (r AccessPolicyApprovalProcedureNewParamsStep) MarshalJSON() (data []byte, err error)
func (*AccessPolicyApprovalProcedureNewParamsStep) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureNewParamsStep) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureNewResponseEnvelope ¶
type AccessPolicyApprovalProcedureNewResponseEnvelope struct {
// The created approval procedure.
Data AccessPolicyApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyApprovalProcedureNewResponseEnvelope) RawJSON ¶
func (r AccessPolicyApprovalProcedureNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyApprovalProcedureNewResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureNewResponseEnvelope) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureService ¶
type AccessPolicyApprovalProcedureService struct {
Options []option.RequestOption
}
AccessPolicyApprovalProcedureService contains methods and other services that help with interacting with the serval 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 NewAccessPolicyApprovalProcedureService method instead.
func NewAccessPolicyApprovalProcedureService ¶
func NewAccessPolicyApprovalProcedureService(opts ...option.RequestOption) (r AccessPolicyApprovalProcedureService)
NewAccessPolicyApprovalProcedureService 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 (*AccessPolicyApprovalProcedureService) Delete ¶
func (r *AccessPolicyApprovalProcedureService) Delete(ctx context.Context, id string, body AccessPolicyApprovalProcedureDeleteParams, opts ...option.RequestOption) (res *AccessPolicyApprovalProcedureDeleteResponse, err error)
Delete an approval procedure for an access policy.
func (*AccessPolicyApprovalProcedureService) Get ¶
func (r *AccessPolicyApprovalProcedureService) Get(ctx context.Context, id string, query AccessPolicyApprovalProcedureGetParams, opts ...option.RequestOption) (res *AccessPolicyApprovalProcedure, err error)
Get a specific approval procedure by ID for an access policy.
func (*AccessPolicyApprovalProcedureService) List ¶
func (r *AccessPolicyApprovalProcedureService) List(ctx context.Context, accessPolicyID string, opts ...option.RequestOption) (res *[]AccessPolicyApprovalProcedure, err error)
List all approval procedures for an access policy.
func (*AccessPolicyApprovalProcedureService) New ¶
func (r *AccessPolicyApprovalProcedureService) New(ctx context.Context, accessPolicyID string, body AccessPolicyApprovalProcedureNewParams, opts ...option.RequestOption) (res *AccessPolicyApprovalProcedure, err error)
Create a new approval procedure for an access policy.
func (*AccessPolicyApprovalProcedureService) Update ¶
func (r *AccessPolicyApprovalProcedureService) Update(ctx context.Context, id string, params AccessPolicyApprovalProcedureUpdateParams, opts ...option.RequestOption) (res *AccessPolicyApprovalProcedure, err error)
Update an existing approval procedure for an access policy.
type AccessPolicyApprovalProcedureStep ¶
type AccessPolicyApprovalProcedureStep struct {
// The ID of the approval step.
ID string `json:"id"`
// Whether the step can be approved by the requester themselves.
AllowSelfApproval bool `json:"allowSelfApproval"`
// The IDs of the Serval groups that can approve the step.
ServalGroupIDs []string `json:"servalGroupIds"`
// The IDs of the specific users that can approve the step.
SpecificUserIDs []string `json:"specificUserIds"`
// The type of approval step.
//
// Any of "APPROVAL_PROCEDURE_STEP_TYPE_UNSPECIFIED", "SPECIFIC_USERS",
// "SERVAL_GROUPS".
StepType string `json:"stepType"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AllowSelfApproval respjson.Field
ServalGroupIDs respjson.Field
SpecificUserIDs respjson.Field
StepType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyApprovalProcedureStep) RawJSON ¶
func (r AccessPolicyApprovalProcedureStep) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyApprovalProcedureStep) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureStep) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureUpdateParams ¶
type AccessPolicyApprovalProcedureUpdateParams struct {
// The ID of the access policy.
AccessPolicyID string `path:"access_policy_id,required" json:"-"`
// The approval steps for the procedure.
Steps []AccessPolicyApprovalProcedureUpdateParamsStep `json:"steps,omitzero"`
// contains filtered or unexported fields
}
func (AccessPolicyApprovalProcedureUpdateParams) MarshalJSON ¶
func (r AccessPolicyApprovalProcedureUpdateParams) MarshalJSON() (data []byte, err error)
func (*AccessPolicyApprovalProcedureUpdateParams) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureUpdateParams) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureUpdateParamsStep ¶
type AccessPolicyApprovalProcedureUpdateParamsStep struct {
// The ID of the approval step.
ID param.Opt[string] `json:"id,omitzero"`
// Whether the step can be approved by the requester themselves.
AllowSelfApproval param.Opt[bool] `json:"allowSelfApproval,omitzero"`
// The IDs of the Serval groups that can approve the step.
ServalGroupIDs []string `json:"servalGroupIds,omitzero"`
// The IDs of the specific users that can approve the step.
SpecificUserIDs []string `json:"specificUserIds,omitzero"`
// The type of approval step.
//
// Any of "APPROVAL_PROCEDURE_STEP_TYPE_UNSPECIFIED", "SPECIFIC_USERS",
// "SERVAL_GROUPS".
StepType string `json:"stepType,omitzero"`
// contains filtered or unexported fields
}
func (AccessPolicyApprovalProcedureUpdateParamsStep) MarshalJSON ¶
func (r AccessPolicyApprovalProcedureUpdateParamsStep) MarshalJSON() (data []byte, err error)
func (*AccessPolicyApprovalProcedureUpdateParamsStep) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureUpdateParamsStep) UnmarshalJSON(data []byte) error
type AccessPolicyApprovalProcedureUpdateResponseEnvelope ¶
type AccessPolicyApprovalProcedureUpdateResponseEnvelope struct {
// The updated approval procedure.
Data AccessPolicyApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyApprovalProcedureUpdateResponseEnvelope) RawJSON ¶
func (r AccessPolicyApprovalProcedureUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyApprovalProcedureUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyApprovalProcedureUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type AccessPolicyDeleteResponse ¶
type AccessPolicyDeleteResponse = any
type AccessPolicyGetResponseEnvelope ¶
type AccessPolicyGetResponseEnvelope struct {
// The access policy.
Data AccessPolicy `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyGetResponseEnvelope) RawJSON ¶
func (r AccessPolicyGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyGetResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyGetResponseEnvelope) UnmarshalJSON(data []byte) error
type AccessPolicyListParams ¶
type AccessPolicyListParams struct {
// The ID of the team.
TeamID param.Opt[string] `query:"teamId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AccessPolicyListParams) URLQuery ¶
func (r AccessPolicyListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AccessPolicyListParams's query parameters as `url.Values`.
type AccessPolicyListResponseEnvelope ¶
type AccessPolicyListResponseEnvelope struct {
// The list of access policies.
Data []AccessPolicy `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyListResponseEnvelope) RawJSON ¶
func (r AccessPolicyListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyListResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyListResponseEnvelope) UnmarshalJSON(data []byte) error
type AccessPolicyNewParams ¶
type AccessPolicyNewParams struct {
// The maximum number of minutes that access can be granted for (optional).
MaxAccessMinutes param.Opt[int64] `json:"maxAccessMinutes,omitzero"`
// Whether a business justification is required when requesting access (optional).
RequireBusinessJustification param.Opt[bool] `json:"requireBusinessJustification,omitzero"`
// A description of the access policy.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the access policy.
Name param.Opt[string] `json:"name,omitzero"`
// The ID of the team.
TeamID param.Opt[string] `json:"teamId,omitzero"`
// contains filtered or unexported fields
}
func (AccessPolicyNewParams) MarshalJSON ¶
func (r AccessPolicyNewParams) MarshalJSON() (data []byte, err error)
func (*AccessPolicyNewParams) UnmarshalJSON ¶
func (r *AccessPolicyNewParams) UnmarshalJSON(data []byte) error
type AccessPolicyNewResponseEnvelope ¶
type AccessPolicyNewResponseEnvelope struct {
// The created access policy.
Data AccessPolicy `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyNewResponseEnvelope) RawJSON ¶
func (r AccessPolicyNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyNewResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyNewResponseEnvelope) UnmarshalJSON(data []byte) error
type AccessPolicyService ¶
type AccessPolicyService struct {
Options []option.RequestOption
ApprovalProcedures AccessPolicyApprovalProcedureService
}
AccessPolicyService contains methods and other services that help with interacting with the serval 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 NewAccessPolicyService method instead.
func NewAccessPolicyService ¶
func NewAccessPolicyService(opts ...option.RequestOption) (r AccessPolicyService)
NewAccessPolicyService 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 (*AccessPolicyService) Delete ¶
func (r *AccessPolicyService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AccessPolicyDeleteResponse, err error)
Delete an access policy.
func (*AccessPolicyService) Get ¶
func (r *AccessPolicyService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AccessPolicy, err error)
Get a specific access policy by ID.
func (*AccessPolicyService) List ¶
func (r *AccessPolicyService) List(ctx context.Context, query AccessPolicyListParams, opts ...option.RequestOption) (res *[]AccessPolicy, err error)
List all access policies for a team.
func (*AccessPolicyService) New ¶
func (r *AccessPolicyService) New(ctx context.Context, body AccessPolicyNewParams, opts ...option.RequestOption) (res *AccessPolicy, err error)
Create a new access policy for a team.
func (*AccessPolicyService) Update ¶
func (r *AccessPolicyService) Update(ctx context.Context, id string, body AccessPolicyUpdateParams, opts ...option.RequestOption) (res *AccessPolicy, err error)
Update an existing access policy.
type AccessPolicyUpdateParams ¶
type AccessPolicyUpdateParams struct {
// A description of the access policy.
Description param.Opt[string] `json:"description,omitzero"`
// The maximum number of minutes that access can be granted for.
MaxAccessMinutes param.Opt[int64] `json:"maxAccessMinutes,omitzero"`
// The name of the access policy.
Name param.Opt[string] `json:"name,omitzero"`
// Whether a business justification is required when requesting access.
RequireBusinessJustification param.Opt[bool] `json:"requireBusinessJustification,omitzero"`
// contains filtered or unexported fields
}
func (AccessPolicyUpdateParams) MarshalJSON ¶
func (r AccessPolicyUpdateParams) MarshalJSON() (data []byte, err error)
func (*AccessPolicyUpdateParams) UnmarshalJSON ¶
func (r *AccessPolicyUpdateParams) UnmarshalJSON(data []byte) error
type AccessPolicyUpdateResponseEnvelope ¶
type AccessPolicyUpdateResponseEnvelope struct {
// The updated access policy.
Data AccessPolicy `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccessPolicyUpdateResponseEnvelope) RawJSON ¶
func (r AccessPolicyUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccessPolicyUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *AccessPolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type AppInstance ¶
type AppInstance struct {
// The ID of the app instance.
ID string `json:"id"`
// Whether access requests are enabled for the app instance.
AccessRequestsEnabled bool `json:"accessRequestsEnabled"`
// The default access policy for the app instance.
DefaultAccessPolicyID string `json:"defaultAccessPolicyId,nullable"`
// The instance ID of the app instance.
InstanceID string `json:"instanceId"`
// The name of the app instance.
Name string `json:"name"`
// The service of the app instance.
Service string `json:"service"`
// The ID of the Serval team that the app instance belongs to.
TeamID string `json:"teamId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccessRequestsEnabled respjson.Field
DefaultAccessPolicyID respjson.Field
InstanceID respjson.Field
Name respjson.Field
Service respjson.Field
TeamID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppInstance) RawJSON ¶
func (r AppInstance) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppInstance) UnmarshalJSON ¶
func (r *AppInstance) UnmarshalJSON(data []byte) error
type AppInstanceDeleteResponse ¶
type AppInstanceDeleteResponse = any
type AppInstanceGetResponseEnvelope ¶
type AppInstanceGetResponseEnvelope struct {
// The app instance.
Data AppInstance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppInstanceGetResponseEnvelope) RawJSON ¶
func (r AppInstanceGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppInstanceGetResponseEnvelope) UnmarshalJSON ¶
func (r *AppInstanceGetResponseEnvelope) UnmarshalJSON(data []byte) error
type AppInstanceListParams ¶
type AppInstanceListParams struct {
// The ID of the team.
TeamID param.Opt[string] `query:"teamId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AppInstanceListParams) URLQuery ¶
func (r AppInstanceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AppInstanceListParams's query parameters as `url.Values`.
type AppInstanceListResponseEnvelope ¶
type AppInstanceListResponseEnvelope struct {
// The list of app instances.
Data []AppInstance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppInstanceListResponseEnvelope) RawJSON ¶
func (r AppInstanceListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppInstanceListResponseEnvelope) UnmarshalJSON ¶
func (r *AppInstanceListResponseEnvelope) UnmarshalJSON(data []byte) error
type AppInstanceNewParams ¶
type AppInstanceNewParams struct {
// The default access policy for the app instance (optional).
DefaultAccessPolicyID param.Opt[string] `json:"defaultAccessPolicyId,omitzero"`
// Whether access requests are enabled for the app instance.
AccessRequestsEnabled param.Opt[bool] `json:"accessRequestsEnabled,omitzero"`
// The instance ID of the app instance.
InstanceID param.Opt[string] `json:"instanceId,omitzero"`
// The name of the app instance.
Name param.Opt[string] `json:"name,omitzero"`
// The service of the app instance.
Service param.Opt[string] `json:"service,omitzero"`
// The ID of the team.
TeamID param.Opt[string] `json:"teamId,omitzero"`
// contains filtered or unexported fields
}
func (AppInstanceNewParams) MarshalJSON ¶
func (r AppInstanceNewParams) MarshalJSON() (data []byte, err error)
func (*AppInstanceNewParams) UnmarshalJSON ¶
func (r *AppInstanceNewParams) UnmarshalJSON(data []byte) error
type AppInstanceNewResponseEnvelope ¶
type AppInstanceNewResponseEnvelope struct {
// The created app instance.
Data AppInstance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppInstanceNewResponseEnvelope) RawJSON ¶
func (r AppInstanceNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppInstanceNewResponseEnvelope) UnmarshalJSON ¶
func (r *AppInstanceNewResponseEnvelope) UnmarshalJSON(data []byte) error
type AppInstanceService ¶
type AppInstanceService struct {
Options []option.RequestOption
}
AppInstanceService contains methods and other services that help with interacting with the serval 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 NewAppInstanceService method instead.
func NewAppInstanceService ¶
func NewAppInstanceService(opts ...option.RequestOption) (r AppInstanceService)
NewAppInstanceService 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 (*AppInstanceService) Delete ¶
func (r *AppInstanceService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AppInstanceDeleteResponse, err error)
Delete an app instance.
func (*AppInstanceService) Get ¶
func (r *AppInstanceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AppInstance, err error)
Get a specific app instance by ID.
func (*AppInstanceService) List ¶
func (r *AppInstanceService) List(ctx context.Context, query AppInstanceListParams, opts ...option.RequestOption) (res *[]AppInstance, err error)
List all app instances for a team.
func (*AppInstanceService) New ¶
func (r *AppInstanceService) New(ctx context.Context, body AppInstanceNewParams, opts ...option.RequestOption) (res *AppInstance, err error)
Create a new app instance for a team.
func (*AppInstanceService) Update ¶
func (r *AppInstanceService) Update(ctx context.Context, id string, body AppInstanceUpdateParams, opts ...option.RequestOption) (res *AppInstance, err error)
Update an existing app instance.
type AppInstanceUpdateParams ¶
type AppInstanceUpdateParams struct {
// The default access policy for the app instance (optional).
DefaultAccessPolicyID param.Opt[string] `json:"defaultAccessPolicyId,omitzero"`
// Whether access requests are enabled for the app instance.
AccessRequestsEnabled param.Opt[bool] `json:"accessRequestsEnabled,omitzero"`
// The instance ID of the app instance.
InstanceID param.Opt[string] `json:"instanceId,omitzero"`
// The name of the app instance.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (AppInstanceUpdateParams) MarshalJSON ¶
func (r AppInstanceUpdateParams) MarshalJSON() (data []byte, err error)
func (*AppInstanceUpdateParams) UnmarshalJSON ¶
func (r *AppInstanceUpdateParams) UnmarshalJSON(data []byte) error
type AppInstanceUpdateResponseEnvelope ¶
type AppInstanceUpdateResponseEnvelope struct {
// The updated app instance.
Data AppInstance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppInstanceUpdateResponseEnvelope) RawJSON ¶
func (r AppInstanceUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppInstanceUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *AppInstanceUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResource ¶
type AppResource struct {
// The ID of the resource.
ID string `json:"id"`
// The ID of the app instance that the resource belongs to.
AppInstanceID string `json:"appInstanceId"`
// A description of the resource.
Description string `json:"description"`
// The external ID of the resource.
ExternalID string `json:"externalId,nullable"`
// The name of the resource.
Name string `json:"name"`
// The type of the resource.
ResourceType string `json:"resourceType"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AppInstanceID respjson.Field
Description respjson.Field
ExternalID respjson.Field
Name respjson.Field
ResourceType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResource) RawJSON ¶
func (r AppResource) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResource) UnmarshalJSON ¶
func (r *AppResource) UnmarshalJSON(data []byte) error
type AppResourceDeleteResponse ¶
type AppResourceDeleteResponse = any
type AppResourceEntitlement ¶
type AppResourceEntitlement struct {
// The ID of the entitlement.
ID string `json:"id"`
// The default access policy for the entitlement.
AccessPolicyID string `json:"accessPolicyId,nullable"`
// A description of the entitlement.
Description string `json:"description"`
// The name of the entitlement.
Name string `json:"name"`
// The provisioning method for the entitlement.
ProvisioningMethod string `json:"provisioningMethod"`
// Whether requests are enabled for the entitlement.
RequestsEnabled bool `json:"requestsEnabled"`
// The ID of the resource that the entitlement belongs to.
ResourceID string `json:"resourceId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccessPolicyID respjson.Field
Description respjson.Field
Name respjson.Field
ProvisioningMethod respjson.Field
RequestsEnabled respjson.Field
ResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceEntitlement) RawJSON ¶
func (r AppResourceEntitlement) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceEntitlement) UnmarshalJSON ¶
func (r *AppResourceEntitlement) UnmarshalJSON(data []byte) error
type AppResourceEntitlementDeleteResponse ¶
type AppResourceEntitlementDeleteResponse = any
type AppResourceEntitlementGetResponseEnvelope ¶
type AppResourceEntitlementGetResponseEnvelope struct {
// The entitlement.
Data AppResourceEntitlement `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceEntitlementGetResponseEnvelope) RawJSON ¶
func (r AppResourceEntitlementGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceEntitlementGetResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceEntitlementGetResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResourceEntitlementListParams ¶
type AppResourceEntitlementListParams struct {
// The ID of the resource.
ResourceID param.Opt[string] `query:"resourceId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AppResourceEntitlementListParams) URLQuery ¶
func (r AppResourceEntitlementListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AppResourceEntitlementListParams's query parameters as `url.Values`.
type AppResourceEntitlementListResponseEnvelope ¶
type AppResourceEntitlementListResponseEnvelope struct {
// The list of entitlements.
Data []AppResourceEntitlement `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceEntitlementListResponseEnvelope) RawJSON ¶
func (r AppResourceEntitlementListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceEntitlementListResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceEntitlementListResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResourceEntitlementNewParams ¶
type AppResourceEntitlementNewParams struct {
// The default access policy for the entitlement (optional).
AccessPolicyID param.Opt[string] `json:"accessPolicyId,omitzero"`
// A description of the entitlement.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the entitlement.
Name param.Opt[string] `json:"name,omitzero"`
// The provisioning method for the entitlement.
ProvisioningMethod param.Opt[string] `json:"provisioningMethod,omitzero"`
// Whether requests are enabled for the entitlement.
RequestsEnabled param.Opt[bool] `json:"requestsEnabled,omitzero"`
// The ID of the resource.
ResourceID param.Opt[string] `json:"resourceId,omitzero"`
// contains filtered or unexported fields
}
func (AppResourceEntitlementNewParams) MarshalJSON ¶
func (r AppResourceEntitlementNewParams) MarshalJSON() (data []byte, err error)
func (*AppResourceEntitlementNewParams) UnmarshalJSON ¶
func (r *AppResourceEntitlementNewParams) UnmarshalJSON(data []byte) error
type AppResourceEntitlementNewResponseEnvelope ¶
type AppResourceEntitlementNewResponseEnvelope struct {
// The created entitlement.
Data AppResourceEntitlement `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceEntitlementNewResponseEnvelope) RawJSON ¶
func (r AppResourceEntitlementNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceEntitlementNewResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceEntitlementNewResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResourceEntitlementService ¶
type AppResourceEntitlementService struct {
Options []option.RequestOption
}
AppResourceEntitlementService contains methods and other services that help with interacting with the serval 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 NewAppResourceEntitlementService method instead.
func NewAppResourceEntitlementService ¶
func NewAppResourceEntitlementService(opts ...option.RequestOption) (r AppResourceEntitlementService)
NewAppResourceEntitlementService 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 (*AppResourceEntitlementService) Delete ¶
func (r *AppResourceEntitlementService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResourceEntitlementDeleteResponse, err error)
Delete an app resource entitlement.
func (*AppResourceEntitlementService) Get ¶
func (r *AppResourceEntitlementService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResourceEntitlement, err error)
Get a specific app resource entitlement by ID.
func (*AppResourceEntitlementService) List ¶
func (r *AppResourceEntitlementService) List(ctx context.Context, query AppResourceEntitlementListParams, opts ...option.RequestOption) (res *[]AppResourceEntitlement, err error)
List all app resource entitlements for a resource.
func (*AppResourceEntitlementService) New ¶
func (r *AppResourceEntitlementService) New(ctx context.Context, body AppResourceEntitlementNewParams, opts ...option.RequestOption) (res *AppResourceEntitlement, err error)
Create a new app resource entitlement for a resource.
func (*AppResourceEntitlementService) Update ¶
func (r *AppResourceEntitlementService) Update(ctx context.Context, id string, body AppResourceEntitlementUpdateParams, opts ...option.RequestOption) (res *AppResourceEntitlement, err error)
Update an existing app resource entitlement.
type AppResourceEntitlementUpdateParams ¶
type AppResourceEntitlementUpdateParams struct {
// The default access policy for the entitlement (optional).
AccessPolicyID param.Opt[string] `json:"accessPolicyId,omitzero"`
// A description of the entitlement.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the entitlement.
Name param.Opt[string] `json:"name,omitzero"`
// The provisioning method for the entitlement.
ProvisioningMethod param.Opt[string] `json:"provisioningMethod,omitzero"`
// Whether requests are enabled for the entitlement.
RequestsEnabled param.Opt[bool] `json:"requestsEnabled,omitzero"`
// contains filtered or unexported fields
}
func (AppResourceEntitlementUpdateParams) MarshalJSON ¶
func (r AppResourceEntitlementUpdateParams) MarshalJSON() (data []byte, err error)
func (*AppResourceEntitlementUpdateParams) UnmarshalJSON ¶
func (r *AppResourceEntitlementUpdateParams) UnmarshalJSON(data []byte) error
type AppResourceEntitlementUpdateResponseEnvelope ¶
type AppResourceEntitlementUpdateResponseEnvelope struct {
// The updated entitlement.
Data AppResourceEntitlement `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceEntitlementUpdateResponseEnvelope) RawJSON ¶
func (r AppResourceEntitlementUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceEntitlementUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceEntitlementUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResourceGetResponseEnvelope ¶
type AppResourceGetResponseEnvelope struct {
// The resource.
Data AppResource `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceGetResponseEnvelope) RawJSON ¶
func (r AppResourceGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceGetResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceGetResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResourceListParams ¶
type AppResourceListParams struct {
// The ID of the app instance.
AppInstanceID param.Opt[string] `query:"appInstanceId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AppResourceListParams) URLQuery ¶
func (r AppResourceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AppResourceListParams's query parameters as `url.Values`.
type AppResourceListResponseEnvelope ¶
type AppResourceListResponseEnvelope struct {
// The list of resources.
Data []AppResource `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceListResponseEnvelope) RawJSON ¶
func (r AppResourceListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceListResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceListResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResourceNewParams ¶
type AppResourceNewParams struct {
// The external ID of the resource (optional).
ExternalID param.Opt[string] `json:"externalId,omitzero"`
// The ID of the app instance.
AppInstanceID param.Opt[string] `json:"appInstanceId,omitzero"`
// A description of the resource.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the resource.
Name param.Opt[string] `json:"name,omitzero"`
// The type of the resource.
ResourceType param.Opt[string] `json:"resourceType,omitzero"`
// contains filtered or unexported fields
}
func (AppResourceNewParams) MarshalJSON ¶
func (r AppResourceNewParams) MarshalJSON() (data []byte, err error)
func (*AppResourceNewParams) UnmarshalJSON ¶
func (r *AppResourceNewParams) UnmarshalJSON(data []byte) error
type AppResourceNewResponseEnvelope ¶
type AppResourceNewResponseEnvelope struct {
// The created resource.
Data AppResource `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceNewResponseEnvelope) RawJSON ¶
func (r AppResourceNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceNewResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceNewResponseEnvelope) UnmarshalJSON(data []byte) error
type AppResourceService ¶
type AppResourceService struct {
Options []option.RequestOption
}
AppResourceService contains methods and other services that help with interacting with the serval 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 NewAppResourceService method instead.
func NewAppResourceService ¶
func NewAppResourceService(opts ...option.RequestOption) (r AppResourceService)
NewAppResourceService 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 (*AppResourceService) Delete ¶
func (r *AppResourceService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResourceDeleteResponse, err error)
Delete an app resource.
func (*AppResourceService) Get ¶
func (r *AppResourceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AppResource, err error)
Get a specific app resource by ID.
func (*AppResourceService) List ¶
func (r *AppResourceService) List(ctx context.Context, query AppResourceListParams, opts ...option.RequestOption) (res *[]AppResource, err error)
List all app resources for an app instance.
func (*AppResourceService) New ¶
func (r *AppResourceService) New(ctx context.Context, body AppResourceNewParams, opts ...option.RequestOption) (res *AppResource, err error)
Create a new app resource for an app instance.
func (*AppResourceService) Update ¶
func (r *AppResourceService) Update(ctx context.Context, id string, body AppResourceUpdateParams, opts ...option.RequestOption) (res *AppResource, err error)
Update an existing app resource.
type AppResourceUpdateParams ¶
type AppResourceUpdateParams struct {
// The external ID of the resource (optional).
ExternalID param.Opt[string] `json:"externalId,omitzero"`
// A description of the resource.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the resource.
Name param.Opt[string] `json:"name,omitzero"`
// The type of the resource.
ResourceType param.Opt[string] `json:"resourceType,omitzero"`
// contains filtered or unexported fields
}
func (AppResourceUpdateParams) MarshalJSON ¶
func (r AppResourceUpdateParams) MarshalJSON() (data []byte, err error)
func (*AppResourceUpdateParams) UnmarshalJSON ¶
func (r *AppResourceUpdateParams) UnmarshalJSON(data []byte) error
type AppResourceUpdateResponseEnvelope ¶
type AppResourceUpdateResponseEnvelope struct {
// The updated resource.
Data AppResource `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AppResourceUpdateResponseEnvelope) RawJSON ¶
func (r AppResourceUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AppResourceUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *AppResourceUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
AccessPolicies AccessPolicyService
Workflows WorkflowService
Guidances GuidanceService
AppInstances AppInstanceService
AppResources AppResourceService
AppResourceEntitlements AppResourceEntitlementService
Users UserService
Groups GroupService
Teams TeamService
}
Client creates a struct with services and top level methods that help with interacting with the serval 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 (SERVAL_API_KEY, SERVAL_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 Group ¶
type Group struct {
ID string `json:"id"`
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
// resolution. The count is relative to an epoch at UTC midnight on January 1,
// 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar
// backwards to year one.
//
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
// second table is needed for interpretation, using a
// [24-hour linear smear](https://developers.google.com/time/smear).
//
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
// restricting to that range, we ensure that we can convert to and from
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
//
// # Examples
//
// Example 1: Compute Timestamp from POSIX `time()`.
//
// Timestamp timestamp;
// timestamp.set_seconds(time(NULL));
// timestamp.set_nanos(0);
//
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
//
// struct timeval tv;
// gettimeofday(&tv, NULL);
//
// Timestamp timestamp;
// timestamp.set_seconds(tv.tv_sec);
// timestamp.set_nanos(tv.tv_usec * 1000);
//
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
//
// FILETIME ft;
// GetSystemTimeAsFileTime(&ft);
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
//
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
// Timestamp timestamp;
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
//
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
//
// long millis = System.currentTimeMillis();
//
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
// Example 5: Compute Timestamp from Java `Instant.now()`.
//
// Instant now = Instant.now();
//
// Timestamp timestamp =
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
// .setNanos(now.getNano()).build();
//
// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
//
// # JSON Mapping
//
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
// "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always
// expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are
// zero-padded to two digits each. The fractional seconds, which can go up to 9
// digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
// indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
// serializer should always use UTC (as indicated by "Z") when printing the
// Timestamp type and a proto3 JSON parser should be able to accept both UTC and
// other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
// January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the standard
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted to
// this format using
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the
// time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the
// Joda Time's
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
// to obtain a formatter capable of generating timestamps in this format.
CreatedAt time.Time `json:"createdAt" format:"date-time"`
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
// resolution. The count is relative to an epoch at UTC midnight on January 1,
// 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar
// backwards to year one.
//
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
// second table is needed for interpretation, using a
// [24-hour linear smear](https://developers.google.com/time/smear).
//
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
// restricting to that range, we ensure that we can convert to and from
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
//
// # Examples
//
// Example 1: Compute Timestamp from POSIX `time()`.
//
// Timestamp timestamp;
// timestamp.set_seconds(time(NULL));
// timestamp.set_nanos(0);
//
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
//
// struct timeval tv;
// gettimeofday(&tv, NULL);
//
// Timestamp timestamp;
// timestamp.set_seconds(tv.tv_sec);
// timestamp.set_nanos(tv.tv_usec * 1000);
//
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
//
// FILETIME ft;
// GetSystemTimeAsFileTime(&ft);
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
//
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
// Timestamp timestamp;
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
//
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
//
// long millis = System.currentTimeMillis();
//
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
// Example 5: Compute Timestamp from Java `Instant.now()`.
//
// Instant now = Instant.now();
//
// Timestamp timestamp =
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
// .setNanos(now.getNano()).build();
//
// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
//
// # JSON Mapping
//
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
// "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always
// expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are
// zero-padded to two digits each. The fractional seconds, which can go up to 9
// digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
// indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
// serializer should always use UTC (as indicated by "Z") when printing the
// Timestamp type and a proto3 JSON parser should be able to accept both UTC and
// other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
// January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the standard
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted to
// this format using
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the
// time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the
// Joda Time's
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
// to obtain a formatter capable of generating timestamps in this format.
DeletedAt time.Time `json:"deletedAt,nullable" format:"date-time"`
Name string `json:"name"`
OrganizationID string `json:"organizationId"`
UserIDs []string `json:"userIds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DeletedAt respjson.Field
Name respjson.Field
OrganizationID respjson.Field
UserIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Group) UnmarshalJSON ¶
type GroupDeleteResponse ¶
type GroupDeleteResponse = any
type GroupGetResponseEnvelope ¶
type GroupGetResponseEnvelope struct {
Data Group `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GroupGetResponseEnvelope) RawJSON ¶
func (r GroupGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*GroupGetResponseEnvelope) UnmarshalJSON ¶
func (r *GroupGetResponseEnvelope) UnmarshalJSON(data []byte) error
type GroupListParams ¶
type GroupListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (GroupListParams) URLQuery ¶
func (r GroupListParams) URLQuery() (v url.Values, err error)
URLQuery serializes GroupListParams's query parameters as `url.Values`.
type GroupListResponse ¶
type GroupListResponse struct {
Data []Group `json:"data"`
NextCursor string `json:"nextCursor,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GroupListResponse) RawJSON ¶
func (r GroupListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GroupListResponse) UnmarshalJSON ¶
func (r *GroupListResponse) UnmarshalJSON(data []byte) error
type GroupNewParams ¶
type GroupNewParams struct {
Name param.Opt[string] `json:"name,omitzero"`
UserIDs []string `json:"userIds,omitzero"`
// contains filtered or unexported fields
}
func (GroupNewParams) MarshalJSON ¶
func (r GroupNewParams) MarshalJSON() (data []byte, err error)
func (*GroupNewParams) UnmarshalJSON ¶
func (r *GroupNewParams) UnmarshalJSON(data []byte) error
type GroupNewResponseEnvelope ¶
type GroupNewResponseEnvelope struct {
Data Group `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GroupNewResponseEnvelope) RawJSON ¶
func (r GroupNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*GroupNewResponseEnvelope) UnmarshalJSON ¶
func (r *GroupNewResponseEnvelope) UnmarshalJSON(data []byte) error
type GroupService ¶
type GroupService struct {
Options []option.RequestOption
}
GroupService contains methods and other services that help with interacting with the serval 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 NewGroupService method instead.
func NewGroupService ¶
func NewGroupService(opts ...option.RequestOption) (r GroupService)
NewGroupService 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 (*GroupService) Delete ¶
func (r *GroupService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *GroupDeleteResponse, err error)
Delete a group.
func (*GroupService) Get ¶
func (r *GroupService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Group, err error)
Get a specific group by ID.
func (*GroupService) List ¶
func (r *GroupService) List(ctx context.Context, query GroupListParams, opts ...option.RequestOption) (res *GroupListResponse, err error)
List all groups.
func (*GroupService) New ¶
func (r *GroupService) New(ctx context.Context, body GroupNewParams, opts ...option.RequestOption) (res *Group, err error)
Create a new group.
func (*GroupService) Update ¶
func (r *GroupService) Update(ctx context.Context, id string, body GroupUpdateParams, opts ...option.RequestOption) (res *Group, err error)
Update an existing group.
type GroupUpdateParams ¶
type GroupUpdateParams struct {
Name param.Opt[string] `json:"name,omitzero"`
UserIDs []string `json:"userIds,omitzero"`
// contains filtered or unexported fields
}
func (GroupUpdateParams) MarshalJSON ¶
func (r GroupUpdateParams) MarshalJSON() (data []byte, err error)
func (*GroupUpdateParams) UnmarshalJSON ¶
func (r *GroupUpdateParams) UnmarshalJSON(data []byte) error
type GroupUpdateResponseEnvelope ¶
type GroupUpdateResponseEnvelope struct {
Data Group `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GroupUpdateResponseEnvelope) RawJSON ¶
func (r GroupUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*GroupUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *GroupUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type Guidance ¶
type Guidance struct {
// The ID of the guidance.
ID string `json:"id"`
// The content of the guidance.
Content string `json:"content"`
// A description of the guidance.
Description string `json:"description"`
// The name of the guidance.
Name string `json:"name"`
// The ID of the team that the guidance belongs to.
TeamID string `json:"teamId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Content respjson.Field
Description respjson.Field
Name respjson.Field
TeamID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Guidance) UnmarshalJSON ¶
type GuidanceDeleteResponse ¶
type GuidanceDeleteResponse = any
type GuidanceGetResponseEnvelope ¶
type GuidanceGetResponseEnvelope struct {
// The guidance.
Data Guidance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GuidanceGetResponseEnvelope) RawJSON ¶
func (r GuidanceGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*GuidanceGetResponseEnvelope) UnmarshalJSON ¶
func (r *GuidanceGetResponseEnvelope) UnmarshalJSON(data []byte) error
type GuidanceListParams ¶
type GuidanceListParams struct {
// The ID of the team.
TeamID param.Opt[string] `query:"teamId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (GuidanceListParams) URLQuery ¶
func (r GuidanceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes GuidanceListParams's query parameters as `url.Values`.
type GuidanceListResponseEnvelope ¶
type GuidanceListResponseEnvelope struct {
// The list of guidances.
Data []Guidance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GuidanceListResponseEnvelope) RawJSON ¶
func (r GuidanceListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*GuidanceListResponseEnvelope) UnmarshalJSON ¶
func (r *GuidanceListResponseEnvelope) UnmarshalJSON(data []byte) error
type GuidanceNewParams ¶
type GuidanceNewParams struct {
// The content of the guidance (optional).
Content param.Opt[string] `json:"content,omitzero"`
// A description of the guidance.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the guidance.
Name param.Opt[string] `json:"name,omitzero"`
// The ID of the team.
TeamID param.Opt[string] `json:"teamId,omitzero"`
// contains filtered or unexported fields
}
func (GuidanceNewParams) MarshalJSON ¶
func (r GuidanceNewParams) MarshalJSON() (data []byte, err error)
func (*GuidanceNewParams) UnmarshalJSON ¶
func (r *GuidanceNewParams) UnmarshalJSON(data []byte) error
type GuidanceNewResponseEnvelope ¶
type GuidanceNewResponseEnvelope struct {
// The created guidance.
Data Guidance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GuidanceNewResponseEnvelope) RawJSON ¶
func (r GuidanceNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*GuidanceNewResponseEnvelope) UnmarshalJSON ¶
func (r *GuidanceNewResponseEnvelope) UnmarshalJSON(data []byte) error
type GuidanceService ¶
type GuidanceService struct {
Options []option.RequestOption
}
GuidanceService contains methods and other services that help with interacting with the serval 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 NewGuidanceService method instead.
func NewGuidanceService ¶
func NewGuidanceService(opts ...option.RequestOption) (r GuidanceService)
NewGuidanceService 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 (*GuidanceService) Delete ¶
func (r *GuidanceService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *GuidanceDeleteResponse, err error)
Delete a guidance.
func (*GuidanceService) Get ¶
func (r *GuidanceService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Guidance, err error)
Get a specific guidance by ID.
func (*GuidanceService) List ¶
func (r *GuidanceService) List(ctx context.Context, query GuidanceListParams, opts ...option.RequestOption) (res *[]Guidance, err error)
List all guidances for a team.
func (*GuidanceService) New ¶
func (r *GuidanceService) New(ctx context.Context, body GuidanceNewParams, opts ...option.RequestOption) (res *Guidance, err error)
Create a new guidance for a team.
func (*GuidanceService) Update ¶
func (r *GuidanceService) Update(ctx context.Context, id string, body GuidanceUpdateParams, opts ...option.RequestOption) (res *Guidance, err error)
Update an existing guidance.
type GuidanceUpdateParams ¶
type GuidanceUpdateParams struct {
// The content of the guidance.
Content param.Opt[string] `json:"content,omitzero"`
// A description of the guidance.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the guidance.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (GuidanceUpdateParams) MarshalJSON ¶
func (r GuidanceUpdateParams) MarshalJSON() (data []byte, err error)
func (*GuidanceUpdateParams) UnmarshalJSON ¶
func (r *GuidanceUpdateParams) UnmarshalJSON(data []byte) error
type GuidanceUpdateResponseEnvelope ¶
type GuidanceUpdateResponseEnvelope struct {
// The updated guidance.
Data Guidance `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (GuidanceUpdateResponseEnvelope) RawJSON ¶
func (r GuidanceUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*GuidanceUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *GuidanceUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type Team ¶
type Team struct {
ID string `json:"id"`
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
// resolution. The count is relative to an epoch at UTC midnight on January 1,
// 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar
// backwards to year one.
//
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
// second table is needed for interpretation, using a
// [24-hour linear smear](https://developers.google.com/time/smear).
//
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
// restricting to that range, we ensure that we can convert to and from
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
//
// # Examples
//
// Example 1: Compute Timestamp from POSIX `time()`.
//
// Timestamp timestamp;
// timestamp.set_seconds(time(NULL));
// timestamp.set_nanos(0);
//
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
//
// struct timeval tv;
// gettimeofday(&tv, NULL);
//
// Timestamp timestamp;
// timestamp.set_seconds(tv.tv_sec);
// timestamp.set_nanos(tv.tv_usec * 1000);
//
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
//
// FILETIME ft;
// GetSystemTimeAsFileTime(&ft);
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
//
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
// Timestamp timestamp;
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
//
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
//
// long millis = System.currentTimeMillis();
//
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
// Example 5: Compute Timestamp from Java `Instant.now()`.
//
// Instant now = Instant.now();
//
// Timestamp timestamp =
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
// .setNanos(now.getNano()).build();
//
// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
//
// # JSON Mapping
//
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
// "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always
// expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are
// zero-padded to two digits each. The fractional seconds, which can go up to 9
// digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
// indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
// serializer should always use UTC (as indicated by "Z") when printing the
// Timestamp type and a proto3 JSON parser should be able to accept both UTC and
// other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
// January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the standard
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted to
// this format using
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the
// time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the
// Joda Time's
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
// to obtain a formatter capable of generating timestamps in this format.
CreatedAt time.Time `json:"createdAt" format:"date-time"`
Description string `json:"description"`
Name string `json:"name"`
OrganizationID string `json:"organizationId"`
Prefix string `json:"prefix"`
UserIDs []string `json:"userIds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Description respjson.Field
Name respjson.Field
OrganizationID respjson.Field
Prefix respjson.Field
UserIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Team) UnmarshalJSON ¶
type TeamDeleteResponse ¶
type TeamDeleteResponse = any
type TeamGetResponseEnvelope ¶
type TeamGetResponseEnvelope struct {
Data Team `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TeamGetResponseEnvelope) RawJSON ¶
func (r TeamGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamGetResponseEnvelope) UnmarshalJSON ¶
func (r *TeamGetResponseEnvelope) UnmarshalJSON(data []byte) error
type TeamListParams ¶
type TeamListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TeamListParams) URLQuery ¶
func (r TeamListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TeamListParams's query parameters as `url.Values`.
type TeamListResponse ¶
type TeamListResponse struct {
Data []Team `json:"data"`
NextCursor string `json:"nextCursor,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TeamListResponse) RawJSON ¶
func (r TeamListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamListResponse) UnmarshalJSON ¶
func (r *TeamListResponse) UnmarshalJSON(data []byte) error
type TeamNewParams ¶
type TeamNewParams struct {
Description param.Opt[string] `json:"description,omitzero"`
Prefix param.Opt[string] `json:"prefix,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
UserIDs []string `json:"userIds,omitzero"`
// contains filtered or unexported fields
}
func (TeamNewParams) MarshalJSON ¶
func (r TeamNewParams) MarshalJSON() (data []byte, err error)
func (*TeamNewParams) UnmarshalJSON ¶
func (r *TeamNewParams) UnmarshalJSON(data []byte) error
type TeamNewResponseEnvelope ¶
type TeamNewResponseEnvelope struct {
Data Team `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TeamNewResponseEnvelope) RawJSON ¶
func (r TeamNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamNewResponseEnvelope) UnmarshalJSON ¶
func (r *TeamNewResponseEnvelope) UnmarshalJSON(data []byte) error
type TeamService ¶
type TeamService struct {
Options []option.RequestOption
}
TeamService contains methods and other services that help with interacting with the serval 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 NewTeamService method instead.
func NewTeamService ¶
func NewTeamService(opts ...option.RequestOption) (r TeamService)
NewTeamService 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 (*TeamService) Delete ¶
func (r *TeamService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *TeamDeleteResponse, err error)
Delete a team.
func (*TeamService) Get ¶
func (r *TeamService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Team, err error)
Get a specific team by ID.
func (*TeamService) List ¶
func (r *TeamService) List(ctx context.Context, query TeamListParams, opts ...option.RequestOption) (res *TeamListResponse, err error)
List all teams.
func (*TeamService) New ¶
func (r *TeamService) New(ctx context.Context, body TeamNewParams, opts ...option.RequestOption) (res *Team, err error)
Create a new team.
func (*TeamService) Update ¶
func (r *TeamService) Update(ctx context.Context, id string, body TeamUpdateParams, opts ...option.RequestOption) (res *Team, err error)
Update an existing team.
type TeamUpdateParams ¶
type TeamUpdateParams struct {
Description param.Opt[string] `json:"description,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
Prefix param.Opt[string] `json:"prefix,omitzero"`
UserIDs []string `json:"userIds,omitzero"`
// contains filtered or unexported fields
}
func (TeamUpdateParams) MarshalJSON ¶
func (r TeamUpdateParams) MarshalJSON() (data []byte, err error)
func (*TeamUpdateParams) UnmarshalJSON ¶
func (r *TeamUpdateParams) UnmarshalJSON(data []byte) error
type TeamUpdateResponseEnvelope ¶
type TeamUpdateResponseEnvelope struct {
Data Team `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TeamUpdateResponseEnvelope) RawJSON ¶
func (r TeamUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *TeamUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type User ¶
type User struct {
ID string `json:"id"`
AvatarURL string `json:"avatarUrl"`
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
// resolution. The count is relative to an epoch at UTC midnight on January 1,
// 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar
// backwards to year one.
//
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
// second table is needed for interpretation, using a
// [24-hour linear smear](https://developers.google.com/time/smear).
//
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
// restricting to that range, we ensure that we can convert to and from
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
//
// # Examples
//
// Example 1: Compute Timestamp from POSIX `time()`.
//
// Timestamp timestamp;
// timestamp.set_seconds(time(NULL));
// timestamp.set_nanos(0);
//
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
//
// struct timeval tv;
// gettimeofday(&tv, NULL);
//
// Timestamp timestamp;
// timestamp.set_seconds(tv.tv_sec);
// timestamp.set_nanos(tv.tv_usec * 1000);
//
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
//
// FILETIME ft;
// GetSystemTimeAsFileTime(&ft);
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
//
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
// Timestamp timestamp;
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
//
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
//
// long millis = System.currentTimeMillis();
//
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
// Example 5: Compute Timestamp from Java `Instant.now()`.
//
// Instant now = Instant.now();
//
// Timestamp timestamp =
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
// .setNanos(now.getNano()).build();
//
// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
//
// # JSON Mapping
//
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
// "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always
// expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are
// zero-padded to two digits each. The fractional seconds, which can go up to 9
// digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
// indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
// serializer should always use UTC (as indicated by "Z") when printing the
// Timestamp type and a proto3 JSON parser should be able to accept both UTC and
// other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
// January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the standard
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted to
// this format using
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the
// time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the
// Joda Time's
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
// to obtain a formatter capable of generating timestamps in this format.
CreatedAt time.Time `json:"createdAt" format:"date-time"`
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
// resolution. The count is relative to an epoch at UTC midnight on January 1,
// 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar
// backwards to year one.
//
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
// second table is needed for interpretation, using a
// [24-hour linear smear](https://developers.google.com/time/smear).
//
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
// restricting to that range, we ensure that we can convert to and from
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
//
// # Examples
//
// Example 1: Compute Timestamp from POSIX `time()`.
//
// Timestamp timestamp;
// timestamp.set_seconds(time(NULL));
// timestamp.set_nanos(0);
//
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
//
// struct timeval tv;
// gettimeofday(&tv, NULL);
//
// Timestamp timestamp;
// timestamp.set_seconds(tv.tv_sec);
// timestamp.set_nanos(tv.tv_usec * 1000);
//
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
//
// FILETIME ft;
// GetSystemTimeAsFileTime(&ft);
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
//
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
// Timestamp timestamp;
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
//
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
//
// long millis = System.currentTimeMillis();
//
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
// Example 5: Compute Timestamp from Java `Instant.now()`.
//
// Instant now = Instant.now();
//
// Timestamp timestamp =
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
// .setNanos(now.getNano()).build();
//
// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
//
// # JSON Mapping
//
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
// "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always
// expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are
// zero-padded to two digits each. The fractional seconds, which can go up to 9
// digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
// indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
// serializer should always use UTC (as indicated by "Z") when printing the
// Timestamp type and a proto3 JSON parser should be able to accept both UTC and
// other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
// January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the standard
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted to
// this format using
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the
// time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the
// Joda Time's
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
// to obtain a formatter capable of generating timestamps in this format.
DeactivatedAt time.Time `json:"deactivatedAt,nullable" format:"date-time"`
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Name string `json:"name"`
// Any of "USER_ROLE_UNSPECIFIED", "USER_ROLE_ORG_MEMBER", "USER_ROLE_ORG_ADMIN".
Role UserRole `json:"role"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AvatarURL respjson.Field
CreatedAt respjson.Field
DeactivatedAt respjson.Field
Email respjson.Field
FirstName respjson.Field
LastName respjson.Field
Name respjson.Field
Role respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*User) UnmarshalJSON ¶
type UserDeleteResponse ¶
type UserDeleteResponse = any
type UserGetResponseEnvelope ¶
type UserGetResponseEnvelope struct {
Data User `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UserGetResponseEnvelope) RawJSON ¶
func (r UserGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*UserGetResponseEnvelope) UnmarshalJSON ¶
func (r *UserGetResponseEnvelope) UnmarshalJSON(data []byte) error
type UserListParams ¶
type UserListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
IncludeDeactivated param.Opt[bool] `query:"includeDeactivated,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (UserListParams) URLQuery ¶
func (r UserListParams) URLQuery() (v url.Values, err error)
URLQuery serializes UserListParams's query parameters as `url.Values`.
type UserListResponse ¶
type UserListResponse struct {
Data []User `json:"data"`
NextCursor string `json:"nextCursor,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UserListResponse) RawJSON ¶
func (r UserListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*UserListResponse) UnmarshalJSON ¶
func (r *UserListResponse) UnmarshalJSON(data []byte) error
type UserNewParams ¶
type UserNewParams struct {
Email param.Opt[string] `json:"email,omitzero"`
FirstName param.Opt[string] `json:"firstName,omitzero"`
LastName param.Opt[string] `json:"lastName,omitzero"`
// Any of "USER_ROLE_UNSPECIFIED", "USER_ROLE_ORG_MEMBER", "USER_ROLE_ORG_ADMIN".
Role UserNewParamsRole `json:"role,omitzero"`
// contains filtered or unexported fields
}
func (UserNewParams) MarshalJSON ¶
func (r UserNewParams) MarshalJSON() (data []byte, err error)
func (*UserNewParams) UnmarshalJSON ¶
func (r *UserNewParams) UnmarshalJSON(data []byte) error
type UserNewParamsRole ¶
type UserNewParamsRole string
const ( UserNewParamsRoleUserRoleUnspecified UserNewParamsRole = "USER_ROLE_UNSPECIFIED" UserNewParamsRoleUserRoleOrgMember UserNewParamsRole = "USER_ROLE_ORG_MEMBER" UserNewParamsRoleUserRoleOrgAdmin UserNewParamsRole = "USER_ROLE_ORG_ADMIN" )
type UserNewResponseEnvelope ¶
type UserNewResponseEnvelope struct {
Data User `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UserNewResponseEnvelope) RawJSON ¶
func (r UserNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*UserNewResponseEnvelope) UnmarshalJSON ¶
func (r *UserNewResponseEnvelope) UnmarshalJSON(data []byte) error
type UserService ¶
type UserService struct {
Options []option.RequestOption
}
UserService contains methods and other services that help with interacting with the serval 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 NewUserService method instead.
func NewUserService ¶
func NewUserService(opts ...option.RequestOption) (r UserService)
NewUserService 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 (*UserService) Delete ¶
func (r *UserService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *UserDeleteResponse, err error)
Delete a user.
func (*UserService) Get ¶
func (r *UserService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *User, err error)
Get a specific user by ID.
func (*UserService) List ¶
func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *UserListResponse, err error)
List all users.
func (*UserService) New ¶
func (r *UserService) New(ctx context.Context, body UserNewParams, opts ...option.RequestOption) (res *User, err error)
Create a new user.
func (*UserService) Update ¶
func (r *UserService) Update(ctx context.Context, id string, body UserUpdateParams, opts ...option.RequestOption) (res *User, err error)
Update an existing user.
type UserUpdateParams ¶
type UserUpdateParams struct {
AvatarURL param.Opt[string] `json:"avatarUrl,omitzero"`
Email param.Opt[string] `json:"email,omitzero"`
FirstName param.Opt[string] `json:"firstName,omitzero"`
LastName param.Opt[string] `json:"lastName,omitzero"`
// Any of "USER_ROLE_UNSPECIFIED", "USER_ROLE_ORG_MEMBER", "USER_ROLE_ORG_ADMIN".
Role UserUpdateParamsRole `json:"role,omitzero"`
// contains filtered or unexported fields
}
func (UserUpdateParams) MarshalJSON ¶
func (r UserUpdateParams) MarshalJSON() (data []byte, err error)
func (*UserUpdateParams) UnmarshalJSON ¶
func (r *UserUpdateParams) UnmarshalJSON(data []byte) error
type UserUpdateParamsRole ¶
type UserUpdateParamsRole string
const ( UserUpdateParamsRoleUserRoleUnspecified UserUpdateParamsRole = "USER_ROLE_UNSPECIFIED" UserUpdateParamsRoleUserRoleOrgMember UserUpdateParamsRole = "USER_ROLE_ORG_MEMBER" UserUpdateParamsRoleUserRoleOrgAdmin UserUpdateParamsRole = "USER_ROLE_ORG_ADMIN" )
type UserUpdateResponseEnvelope ¶
type UserUpdateResponseEnvelope struct {
Data User `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UserUpdateResponseEnvelope) RawJSON ¶
func (r UserUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*UserUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *UserUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type Workflow ¶
type Workflow struct {
// The ID of the workflow.
ID string `json:"id"`
// The content/code of the workflow.
Content string `json:"content"`
// A description of the workflow.
Description string `json:"description"`
// The execution scope of the workflow.
//
// Any of "WORKFLOW_EXECUTION_SCOPE_UNSPECIFIED", "TEAM_PRIVATE", "TEAM_PUBLIC".
ExecutionScope WorkflowExecutionScope `json:"executionScope"`
// Whether the workflow is temporary.
IsTemporary bool `json:"isTemporary"`
// The name of the workflow.
Name string `json:"name"`
// The parameters schema of the workflow (JSON).
Parameters string `json:"parameters"`
// Whether the workflow requires form confirmation.
RequireFormConfirmation bool `json:"requireFormConfirmation"`
// The ID of the team that the workflow belongs to.
TeamID string `json:"teamId"`
// The type of the workflow.
//
// Any of "WORKFLOW_TYPE_UNSPECIFIED", "EXECUTABLE", "GUIDANCE".
Type WorkflowType `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Content respjson.Field
Description respjson.Field
ExecutionScope respjson.Field
IsTemporary respjson.Field
Name respjson.Field
Parameters respjson.Field
RequireFormConfirmation respjson.Field
TeamID respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Workflow) UnmarshalJSON ¶
type WorkflowApprovalProcedure ¶
type WorkflowApprovalProcedure struct {
// The ID of the workflow approval procedure.
ID string `json:"id"`
// The steps in the approval procedure.
Steps []WorkflowApprovalProcedureStep `json:"steps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Steps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowApprovalProcedure) RawJSON ¶
func (r WorkflowApprovalProcedure) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowApprovalProcedure) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedure) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureDeleteParams ¶
type WorkflowApprovalProcedureDeleteParams struct {
// The ID of the workflow.
WorkflowID string `path:"workflow_id,required" json:"-"`
// contains filtered or unexported fields
}
type WorkflowApprovalProcedureDeleteResponse ¶
type WorkflowApprovalProcedureDeleteResponse = any
type WorkflowApprovalProcedureGetParams ¶
type WorkflowApprovalProcedureGetParams struct {
// The ID of the workflow.
WorkflowID string `path:"workflow_id,required" json:"-"`
// contains filtered or unexported fields
}
type WorkflowApprovalProcedureGetResponseEnvelope ¶
type WorkflowApprovalProcedureGetResponseEnvelope struct {
// The approval procedure.
Data WorkflowApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowApprovalProcedureGetResponseEnvelope) RawJSON ¶
func (r WorkflowApprovalProcedureGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowApprovalProcedureGetResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureGetResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureListResponseEnvelope ¶
type WorkflowApprovalProcedureListResponseEnvelope struct {
// The list of approval procedures.
Data []WorkflowApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowApprovalProcedureListResponseEnvelope) RawJSON ¶
func (r WorkflowApprovalProcedureListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowApprovalProcedureListResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureListResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureNewParams ¶
type WorkflowApprovalProcedureNewParams struct {
// The approval steps for the procedure.
Steps []WorkflowApprovalProcedureNewParamsStep `json:"steps,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowApprovalProcedureNewParams) MarshalJSON ¶
func (r WorkflowApprovalProcedureNewParams) MarshalJSON() (data []byte, err error)
func (*WorkflowApprovalProcedureNewParams) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureNewParams) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureNewParamsStep ¶
type WorkflowApprovalProcedureNewParamsStep struct {
// The ID of the approval step.
ID param.Opt[string] `json:"id,omitzero"`
// Whether the step can be approved by the requester themselves.
AllowSelfApproval param.Opt[bool] `json:"allowSelfApproval,omitzero"`
// The IDs of the Serval groups that can approve the step.
ServalGroupIDs []string `json:"servalGroupIds,omitzero"`
// The IDs of the specific users that can approve the step.
SpecificUserIDs []string `json:"specificUserIds,omitzero"`
// The type of approval step.
//
// Any of "APPROVAL_PROCEDURE_STEP_TYPE_UNSPECIFIED", "SPECIFIC_USERS",
// "SERVAL_GROUPS".
StepType string `json:"stepType,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowApprovalProcedureNewParamsStep) MarshalJSON ¶
func (r WorkflowApprovalProcedureNewParamsStep) MarshalJSON() (data []byte, err error)
func (*WorkflowApprovalProcedureNewParamsStep) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureNewParamsStep) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureNewResponseEnvelope ¶
type WorkflowApprovalProcedureNewResponseEnvelope struct {
// The created approval procedure.
Data WorkflowApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowApprovalProcedureNewResponseEnvelope) RawJSON ¶
func (r WorkflowApprovalProcedureNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowApprovalProcedureNewResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureNewResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureService ¶
type WorkflowApprovalProcedureService struct {
Options []option.RequestOption
}
WorkflowApprovalProcedureService contains methods and other services that help with interacting with the serval 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 NewWorkflowApprovalProcedureService method instead.
func NewWorkflowApprovalProcedureService ¶
func NewWorkflowApprovalProcedureService(opts ...option.RequestOption) (r WorkflowApprovalProcedureService)
NewWorkflowApprovalProcedureService 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 (*WorkflowApprovalProcedureService) Delete ¶
func (r *WorkflowApprovalProcedureService) Delete(ctx context.Context, id string, body WorkflowApprovalProcedureDeleteParams, opts ...option.RequestOption) (res *WorkflowApprovalProcedureDeleteResponse, err error)
Delete an approval procedure for a workflow.
func (*WorkflowApprovalProcedureService) Get ¶
func (r *WorkflowApprovalProcedureService) Get(ctx context.Context, id string, query WorkflowApprovalProcedureGetParams, opts ...option.RequestOption) (res *WorkflowApprovalProcedure, err error)
Get a specific approval procedure by ID for a workflow.
func (*WorkflowApprovalProcedureService) List ¶
func (r *WorkflowApprovalProcedureService) List(ctx context.Context, workflowID string, opts ...option.RequestOption) (res *[]WorkflowApprovalProcedure, err error)
List all approval procedures for a workflow.
func (*WorkflowApprovalProcedureService) New ¶
func (r *WorkflowApprovalProcedureService) New(ctx context.Context, workflowID string, body WorkflowApprovalProcedureNewParams, opts ...option.RequestOption) (res *WorkflowApprovalProcedure, err error)
Create a new approval procedure for a workflow.
func (*WorkflowApprovalProcedureService) Update ¶
func (r *WorkflowApprovalProcedureService) Update(ctx context.Context, id string, params WorkflowApprovalProcedureUpdateParams, opts ...option.RequestOption) (res *WorkflowApprovalProcedure, err error)
Update an existing approval procedure for a workflow.
type WorkflowApprovalProcedureStep ¶
type WorkflowApprovalProcedureStep struct {
// The ID of the approval step.
ID string `json:"id"`
// Whether the step can be approved by the requester themselves.
AllowSelfApproval bool `json:"allowSelfApproval"`
// The IDs of the Serval groups that can approve the step.
ServalGroupIDs []string `json:"servalGroupIds"`
// The IDs of the specific users that can approve the step.
SpecificUserIDs []string `json:"specificUserIds"`
// The type of approval step.
//
// Any of "APPROVAL_PROCEDURE_STEP_TYPE_UNSPECIFIED", "SPECIFIC_USERS",
// "SERVAL_GROUPS".
StepType string `json:"stepType"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AllowSelfApproval respjson.Field
ServalGroupIDs respjson.Field
SpecificUserIDs respjson.Field
StepType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowApprovalProcedureStep) RawJSON ¶
func (r WorkflowApprovalProcedureStep) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowApprovalProcedureStep) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureStep) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureUpdateParams ¶
type WorkflowApprovalProcedureUpdateParams struct {
// The ID of the workflow.
WorkflowID string `path:"workflow_id,required" json:"-"`
// The approval steps for the procedure.
Steps []WorkflowApprovalProcedureUpdateParamsStep `json:"steps,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowApprovalProcedureUpdateParams) MarshalJSON ¶
func (r WorkflowApprovalProcedureUpdateParams) MarshalJSON() (data []byte, err error)
func (*WorkflowApprovalProcedureUpdateParams) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureUpdateParams) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureUpdateParamsStep ¶
type WorkflowApprovalProcedureUpdateParamsStep struct {
// The ID of the approval step.
ID param.Opt[string] `json:"id,omitzero"`
// Whether the step can be approved by the requester themselves.
AllowSelfApproval param.Opt[bool] `json:"allowSelfApproval,omitzero"`
// The IDs of the Serval groups that can approve the step.
ServalGroupIDs []string `json:"servalGroupIds,omitzero"`
// The IDs of the specific users that can approve the step.
SpecificUserIDs []string `json:"specificUserIds,omitzero"`
// The type of approval step.
//
// Any of "APPROVAL_PROCEDURE_STEP_TYPE_UNSPECIFIED", "SPECIFIC_USERS",
// "SERVAL_GROUPS".
StepType string `json:"stepType,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowApprovalProcedureUpdateParamsStep) MarshalJSON ¶
func (r WorkflowApprovalProcedureUpdateParamsStep) MarshalJSON() (data []byte, err error)
func (*WorkflowApprovalProcedureUpdateParamsStep) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureUpdateParamsStep) UnmarshalJSON(data []byte) error
type WorkflowApprovalProcedureUpdateResponseEnvelope ¶
type WorkflowApprovalProcedureUpdateResponseEnvelope struct {
// The updated approval procedure.
Data WorkflowApprovalProcedure `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowApprovalProcedureUpdateResponseEnvelope) RawJSON ¶
func (r WorkflowApprovalProcedureUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowApprovalProcedureUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowApprovalProcedureUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowDeleteResponse ¶
type WorkflowDeleteResponse = any
type WorkflowExecutionScope ¶
type WorkflowExecutionScope string
The execution scope of the workflow.
const ( WorkflowExecutionScopeWorkflowExecutionScopeUnspecified WorkflowExecutionScope = "WORKFLOW_EXECUTION_SCOPE_UNSPECIFIED" WorkflowExecutionScopeTeamPrivate WorkflowExecutionScope = "TEAM_PRIVATE" WorkflowExecutionScopeTeamPublic WorkflowExecutionScope = "TEAM_PUBLIC" )
type WorkflowGetResponseEnvelope ¶
type WorkflowGetResponseEnvelope struct {
// The workflow.
Data Workflow `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowGetResponseEnvelope) RawJSON ¶
func (r WorkflowGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowGetResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowGetResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowListParams ¶
type WorkflowListParams struct {
// Whether to include temporary workflows (optional, defaults to false).
IncludeTemporary param.Opt[bool] `query:"includeTemporary,omitzero" json:"-"`
// The ID of the team.
TeamID param.Opt[string] `query:"teamId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowListParams) URLQuery ¶
func (r WorkflowListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowListParams's query parameters as `url.Values`.
type WorkflowListResponseEnvelope ¶
type WorkflowListResponseEnvelope struct {
// The list of workflows.
Data []Workflow `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowListResponseEnvelope) RawJSON ¶
func (r WorkflowListResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowListResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowListResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowNewParams ¶
type WorkflowNewParams struct {
// The content/code of the workflow (optional).
Content param.Opt[string] `json:"content,omitzero"`
// Whether the workflow is temporary (optional).
IsTemporary param.Opt[bool] `json:"isTemporary,omitzero"`
// The parameters schema of the workflow (JSON, optional).
Parameters param.Opt[string] `json:"parameters,omitzero"`
// Whether the workflow requires form confirmation (optional).
RequireFormConfirmation param.Opt[bool] `json:"requireFormConfirmation,omitzero"`
// A description of the workflow.
Description param.Opt[string] `json:"description,omitzero"`
// The name of the workflow.
Name param.Opt[string] `json:"name,omitzero"`
// The ID of the team.
TeamID param.Opt[string] `json:"teamId,omitzero"`
// The execution scope of the workflow.
//
// Any of "WORKFLOW_EXECUTION_SCOPE_UNSPECIFIED", "TEAM_PRIVATE", "TEAM_PUBLIC".
ExecutionScope WorkflowNewParamsExecutionScope `json:"executionScope,omitzero"`
// The type of the workflow.
//
// Any of "WORKFLOW_TYPE_UNSPECIFIED", "EXECUTABLE", "GUIDANCE".
Type WorkflowNewParamsType `json:"type,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowNewParams) MarshalJSON ¶
func (r WorkflowNewParams) MarshalJSON() (data []byte, err error)
func (*WorkflowNewParams) UnmarshalJSON ¶
func (r *WorkflowNewParams) UnmarshalJSON(data []byte) error
type WorkflowNewParamsExecutionScope ¶
type WorkflowNewParamsExecutionScope string
The execution scope of the workflow.
const ( WorkflowNewParamsExecutionScopeWorkflowExecutionScopeUnspecified WorkflowNewParamsExecutionScope = "WORKFLOW_EXECUTION_SCOPE_UNSPECIFIED" WorkflowNewParamsExecutionScopeTeamPrivate WorkflowNewParamsExecutionScope = "TEAM_PRIVATE" WorkflowNewParamsExecutionScopeTeamPublic WorkflowNewParamsExecutionScope = "TEAM_PUBLIC" )
type WorkflowNewParamsType ¶
type WorkflowNewParamsType string
The type of the workflow.
const ( WorkflowNewParamsTypeWorkflowTypeUnspecified WorkflowNewParamsType = "WORKFLOW_TYPE_UNSPECIFIED" WorkflowNewParamsTypeExecutable WorkflowNewParamsType = "EXECUTABLE" WorkflowNewParamsTypeGuidance WorkflowNewParamsType = "GUIDANCE" )
type WorkflowNewResponseEnvelope ¶
type WorkflowNewResponseEnvelope struct {
// The created workflow.
Data Workflow `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowNewResponseEnvelope) RawJSON ¶
func (r WorkflowNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowNewResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowNewResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowService ¶
type WorkflowService struct {
Options []option.RequestOption
ApprovalProcedures WorkflowApprovalProcedureService
}
WorkflowService contains methods and other services that help with interacting with the serval 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 NewWorkflowService method instead.
func NewWorkflowService ¶
func NewWorkflowService(opts ...option.RequestOption) (r WorkflowService)
NewWorkflowService 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 (*WorkflowService) Delete ¶
func (r *WorkflowService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkflowDeleteResponse, err error)
Delete a workflow.
func (*WorkflowService) Get ¶
func (r *WorkflowService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Workflow, err error)
Get a specific workflow by ID.
func (*WorkflowService) List ¶
func (r *WorkflowService) List(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) (res *[]Workflow, err error)
List all workflows for a team.
func (*WorkflowService) New ¶
func (r *WorkflowService) New(ctx context.Context, body WorkflowNewParams, opts ...option.RequestOption) (res *Workflow, err error)
Create a new workflow for a team.
func (*WorkflowService) Update ¶
func (r *WorkflowService) Update(ctx context.Context, id string, body WorkflowUpdateParams, opts ...option.RequestOption) (res *Workflow, err error)
Update an existing workflow.
type WorkflowType ¶
type WorkflowType string
The type of the workflow.
const ( WorkflowTypeWorkflowTypeUnspecified WorkflowType = "WORKFLOW_TYPE_UNSPECIFIED" WorkflowTypeExecutable WorkflowType = "EXECUTABLE" WorkflowTypeGuidance WorkflowType = "GUIDANCE" )
type WorkflowUpdateParams ¶
type WorkflowUpdateParams struct {
// The content/code of the workflow.
Content param.Opt[string] `json:"content,omitzero"`
// A description of the workflow.
Description param.Opt[string] `json:"description,omitzero"`
// Whether the workflow is temporary.
IsTemporary param.Opt[bool] `json:"isTemporary,omitzero"`
// The name of the workflow.
Name param.Opt[string] `json:"name,omitzero"`
// The parameters schema of the workflow (JSON).
Parameters param.Opt[string] `json:"parameters,omitzero"`
// Whether the workflow requires form confirmation.
RequireFormConfirmation param.Opt[bool] `json:"requireFormConfirmation,omitzero"`
// The execution scope of the workflow.
//
// Any of "WORKFLOW_EXECUTION_SCOPE_UNSPECIFIED", "TEAM_PRIVATE", "TEAM_PUBLIC".
ExecutionScope WorkflowUpdateParamsExecutionScope `json:"executionScope,omitzero"`
// The type of the workflow.
//
// Any of "WORKFLOW_TYPE_UNSPECIFIED", "EXECUTABLE", "GUIDANCE".
Type WorkflowUpdateParamsType `json:"type,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowUpdateParams) MarshalJSON ¶
func (r WorkflowUpdateParams) MarshalJSON() (data []byte, err error)
func (*WorkflowUpdateParams) UnmarshalJSON ¶
func (r *WorkflowUpdateParams) UnmarshalJSON(data []byte) error
type WorkflowUpdateParamsExecutionScope ¶
type WorkflowUpdateParamsExecutionScope string
The execution scope of the workflow.
const ( WorkflowUpdateParamsExecutionScopeWorkflowExecutionScopeUnspecified WorkflowUpdateParamsExecutionScope = "WORKFLOW_EXECUTION_SCOPE_UNSPECIFIED" WorkflowUpdateParamsExecutionScopeTeamPrivate WorkflowUpdateParamsExecutionScope = "TEAM_PRIVATE" WorkflowUpdateParamsExecutionScopeTeamPublic WorkflowUpdateParamsExecutionScope = "TEAM_PUBLIC" )
type WorkflowUpdateParamsType ¶
type WorkflowUpdateParamsType string
The type of the workflow.
const ( WorkflowUpdateParamsTypeWorkflowTypeUnspecified WorkflowUpdateParamsType = "WORKFLOW_TYPE_UNSPECIFIED" WorkflowUpdateParamsTypeExecutable WorkflowUpdateParamsType = "EXECUTABLE" WorkflowUpdateParamsTypeGuidance WorkflowUpdateParamsType = "GUIDANCE" )
type WorkflowUpdateResponseEnvelope ¶
type WorkflowUpdateResponseEnvelope struct {
// The updated workflow.
Data Workflow `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WorkflowUpdateResponseEnvelope) RawJSON ¶
func (r WorkflowUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *WorkflowUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
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.21, 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.21, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|