Help us shape the future of Go! Take the 2026 Go Developer Survey

membership

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

func IsNil

func IsNil(i interface{}) bool

IsNil checks if an input is nil

func NewConfiguration

func NewConfiguration() *config.Configuration

NewConfiguration returns a new Configuration object

func ParameterValueToString

func ParameterValueToString(obj interface{}, key string) string

func PtrBool

func PtrBool(v bool) *bool

PtrBool is a helper routine that returns a pointer to given boolean value.

func PtrFloat32

func PtrFloat32(v float32) *float32

PtrFloat32 is a helper routine that returns a pointer to given float value.

func PtrFloat64

func PtrFloat64(v float64) *float64

PtrFloat64 is a helper routine that returns a pointer to given float value.

func PtrInt

func PtrInt(v int) *int

PtrInt is a helper routine that returns a pointer to given integer value.

func PtrInt32

func PtrInt32(v int32) *int32

PtrInt32 is a helper routine that returns a pointer to given integer value.

func PtrInt64

func PtrInt64(v int64) *int64

PtrInt64 is a helper routine that returns a pointer to given integer value.

func PtrString

func PtrString(v string) *string

PtrString is a helper routine that returns a pointer to given string value.

func PtrTime

func PtrTime(v time.Time) *time.Time

PtrTime is helper routine that returns a pointer to given Time value.

Types

type APIClient

type APIClient struct {
	// contains filtered or unexported fields
}

APIClient manages communication with the STACKIT Membership API API v2.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error)

NewAPIClient creates a new API client. Optionally receives configuration options

func (*APIClient) AddMembers

func (a *APIClient) AddMembers(ctx context.Context, resourceId string) ApiAddMembersRequest

AddMembers Add members to a resource

Add members to the given resource with specified roles.

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param resourceId
@return ApiAddMembersRequest

func (*APIClient) AddMembersExecute

func (a *APIClient) AddMembersExecute(ctx context.Context, resourceId string) (*MembersResponse, error)

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *config.Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

func (*APIClient) ListMembers

func (a *APIClient) ListMembers(ctx context.Context, resourceType string, resourceId string) ApiListMembersRequest

ListMembers Get members to a resource

List members of the given resource.

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param resourceType
@param resourceId
@return ApiListMembersRequest

func (*APIClient) ListMembersExecute

func (a *APIClient) ListMembersExecute(ctx context.Context, resourceType string, resourceId string) (*ListMembersResponse, error)

func (*APIClient) ListPermissions

func (a *APIClient) ListPermissions(ctx context.Context) ApiListPermissionsRequest

ListPermissions Get available permissions

Get available permissions

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListPermissionsRequest

func (*APIClient) ListPermissionsExecute

func (a *APIClient) ListPermissionsExecute(ctx context.Context) (*ListPermissionsResponse, error)

func (*APIClient) ListRoles

func (a *APIClient) ListRoles(ctx context.Context, resourceType string, resourceId string) ApiListRolesRequest

ListRoles Get roles and permissions of a resource

Get roles and permissions of a resource

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param resourceType
@param resourceId
@return ApiListRolesRequest

func (*APIClient) ListRolesExecute

func (a *APIClient) ListRolesExecute(ctx context.Context, resourceType string, resourceId string) (*RolesResponse, error)

func (*APIClient) ListUserMemberships

func (a *APIClient) ListUserMemberships(ctx context.Context, email string) ApiListUserMembershipsRequest

ListUserMemberships List memberships of a user

List memberships of a user. An administrative access is needed to list any user's memberships, while the user can do it on his/her own email. You can use filters to scope the request to a project/folder/organization. In this case -if caller is not the subject-, owner permissions are required. Because of hierarchical role bindings, the user might have permissions on more resources.

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param email
@return ApiListUserMembershipsRequest

func (*APIClient) ListUserMembershipsExecute

func (a *APIClient) ListUserMembershipsExecute(ctx context.Context, email string) (*ListUserMembershipsResponse, error)

func (*APIClient) RemoveMembers

func (a *APIClient) RemoveMembers(ctx context.Context, resourceId string) ApiRemoveMembersRequest

RemoveMembers Remove members from a resource

Remove members from the given resource with specified roles.

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param resourceId
@return ApiRemoveMembersRequest

func (*APIClient) RemoveMembersExecute

func (a *APIClient) RemoveMembersExecute(ctx context.Context, resourceId string) (*MembersResponse, error)

type AddMembersPayload

type AddMembersPayload struct {
	// REQUIRED
	Members *[]Member `json:"members"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
}

type AddRolesPayload

type AddRolesPayload struct {
	// REQUIRED
	ResourceType *string `json:"resourceType"`
	// REQUIRED
	Roles *[]AddRolesPayloadItem `json:"roles"`
}

type AddRolesPayloadItem

type AddRolesPayloadItem struct {
	// REQUIRED
	Description *string `json:"description"`
	// REQUIRED
	Name *string `json:"name"`
	// REQUIRED
	Permissions *[]PermissionRequest `json:"permissions"`
}

type ApiAddMembersRequest

type ApiAddMembersRequest struct {
	// contains filtered or unexported fields
}

func (ApiAddMembersRequest) AddMembersPayload

func (r ApiAddMembersRequest) AddMembersPayload(addMembersPayload AddMembersPayload) ApiAddMembersRequest

func (ApiAddMembersRequest) Execute

func (r ApiAddMembersRequest) Execute() (*MembersResponse, error)

type ApiListMembersRequest

type ApiListMembersRequest struct {
	// contains filtered or unexported fields
}

func (ApiListMembersRequest) Execute

func (ApiListMembersRequest) Subject

type ApiListPermissionsRequest

type ApiListPermissionsRequest struct {
	// contains filtered or unexported fields
}

func (ApiListPermissionsRequest) Execute

func (ApiListPermissionsRequest) ResourceType

func (r ApiListPermissionsRequest) ResourceType(resourceType string) ApiListPermissionsRequest

type ApiListRolesRequest

type ApiListRolesRequest struct {
	// contains filtered or unexported fields
}

func (ApiListRolesRequest) Execute

func (r ApiListRolesRequest) Execute() (*RolesResponse, error)

type ApiListUserMembershipsRequest

type ApiListUserMembershipsRequest struct {
	// contains filtered or unexported fields
}

func (ApiListUserMembershipsRequest) Execute

func (ApiListUserMembershipsRequest) ParentResourceId

func (r ApiListUserMembershipsRequest) ParentResourceId(parentResourceId string) ApiListUserMembershipsRequest

func (ApiListUserMembershipsRequest) ResourceId

func (ApiListUserMembershipsRequest) ResourceType

type ApiRemoveMembersRequest

type ApiRemoveMembersRequest struct {
	// contains filtered or unexported fields
}

func (ApiRemoveMembersRequest) Execute

func (ApiRemoveMembersRequest) RemoveMembersPayload

func (r ApiRemoveMembersRequest) RemoveMembersPayload(removeMembersPayload RemoveMembersPayload) ApiRemoveMembersRequest

type Consistency

type Consistency struct {
	AtExactSnapshot *Zookie `json:"atExactSnapshot,omitempty"`
	AtLeastAsFresh  *Zookie `json:"atLeastAsFresh,omitempty"`
	FullyConsistent *bool   `json:"fullyConsistent,omitempty"`
	MinimizeLatency *bool   `json:"minimizeLatency,omitempty"`
}

type CreateResourcePayload

type CreateResourcePayload struct {
	Members *[]Member `json:"members,omitempty"`
	// REQUIRED
	ParentId *string `json:"parentId"`
	// REQUIRED
	ParentType    *string `json:"parentType"`
	ResourceAlias *string `json:"resourceAlias,omitempty"`
	// REQUIRED
	ResourceId *string `json:"resourceId"`
}

type CreateResourceResponse

type CreateResourceResponse struct {
	Members *[]Member `json:"members,omitempty"`
	// REQUIRED
	ParentId *string `json:"parentId"`
	// REQUIRED
	ParentType    *string `json:"parentType"`
	ResourceAlias *string `json:"resourceAlias,omitempty"`
	// REQUIRED
	ResourceId *string `json:"resourceId"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
	WrittenAt    *Zookie `json:"writtenAt,omitempty"`
}

type DefaultApiService

type DefaultApiService service

DefaultApiService DefaultApi service

type DeleteResourceResponse

type DeleteResourceResponse struct {
	WrittenAt *Zookie `json:"writtenAt,omitempty"`
}

type DeleteSubjectResponse

type DeleteSubjectResponse struct {
	DeletedAt *Zookie `json:"deletedAt,omitempty"`
	// REQUIRED
	DeletedFromResourceIds *[]string `json:"deletedFromResourceIds"`
}

type EnforcePermissionPayload

type EnforcePermissionPayload struct {
	// REQUIRED
	Actions     *[]string    `json:"actions"`
	Consistency *Consistency `json:"consistency,omitempty"`
	// REQUIRED
	Resource *string `json:"resource"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
	// REQUIRED
	Subject *string `json:"subject"`
}

type ErrorResponse

type ErrorResponse struct {
	// REQUIRED
	Error *string `json:"error"`
	// REQUIRED
	Message *string `json:"message"`
	// REQUIRED
	Path *string `json:"path"`
	// REQUIRED
	Status *int64 `json:"status"`
	// REQUIRED
	TimeStamp *time.Time `json:"timeStamp"`
}

type ExistingPermission

type ExistingPermission struct {
	// REQUIRED
	Description *string `json:"description"`
	// REQUIRED
	Name *string `json:"name"`
}

type ListMembersResponse

type ListMembersResponse struct {
	// REQUIRED
	Members *[]Member `json:"members"`
	// REQUIRED
	ResourceId *string `json:"resourceId"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
}

type ListPermissionsResponse

type ListPermissionsResponse struct {
	// REQUIRED
	Permissions *[]Permission `json:"permissions"`
}

type ListSubjectIdsResponse

type ListSubjectIdsResponse struct {
	Cursor *string `json:"cursor,omitempty"`
	// REQUIRED
	Items *[]string `json:"items"`
	// Can be cast to int32 without loss of precision.
	Limit *int64 `json:"limit,omitempty"`
}

type ListSubjectsResponse

type ListSubjectsResponse struct {
	// REQUIRED
	Items *[]Subject `json:"items"`
}

type ListUserMembershipsResponse

type ListUserMembershipsResponse struct {
	// REQUIRED
	Items *[]UserMembership `json:"items"`
}

type ListUserPermissionsResponse

type ListUserPermissionsResponse struct {
	// REQUIRED
	Items *[]UserPermission `json:"items"`
}

type MappedNullable

type MappedNullable interface {
	ToMap() (map[string]interface{}, error)
}

type Member

type Member struct {
	// REQUIRED
	Role *string `json:"role"`
	// REQUIRED
	Subject *string `json:"subject"`
}

type MembersResponse

type MembersResponse struct {
	// REQUIRED
	Members *[]Member `json:"members"`
	// REQUIRED
	ResourceId *string `json:"resourceId"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
	WrittenAt    *Zookie `json:"writtenAt,omitempty"`
}

type NullableBool

type NullableBool struct {
	// contains filtered or unexported fields
}

func NewNullableBool

func NewNullableBool(val *bool) *NullableBool

func (NullableBool) Get

func (v NullableBool) Get() *bool

func (NullableBool) IsSet

func (v NullableBool) IsSet() bool

func (NullableBool) MarshalJSON

func (v NullableBool) MarshalJSON() ([]byte, error)

func (*NullableBool) Set

func (v *NullableBool) Set(val *bool)

func (*NullableBool) UnmarshalJSON

func (v *NullableBool) UnmarshalJSON(src []byte) error

func (*NullableBool) Unset

func (v *NullableBool) Unset()

type NullableFloat32

type NullableFloat32 struct {
	// contains filtered or unexported fields
}

func NewNullableFloat32

func NewNullableFloat32(val *float32) *NullableFloat32

func (NullableFloat32) Get

func (v NullableFloat32) Get() *float32

func (NullableFloat32) IsSet

func (v NullableFloat32) IsSet() bool

func (NullableFloat32) MarshalJSON

func (v NullableFloat32) MarshalJSON() ([]byte, error)

func (*NullableFloat32) Set

func (v *NullableFloat32) Set(val *float32)

func (*NullableFloat32) UnmarshalJSON

func (v *NullableFloat32) UnmarshalJSON(src []byte) error

func (*NullableFloat32) Unset

func (v *NullableFloat32) Unset()

type NullableFloat64

type NullableFloat64 struct {
	// contains filtered or unexported fields
}

func NewNullableFloat64

func NewNullableFloat64(val *float64) *NullableFloat64

func (NullableFloat64) Get

func (v NullableFloat64) Get() *float64

func (NullableFloat64) IsSet

func (v NullableFloat64) IsSet() bool

func (NullableFloat64) MarshalJSON

func (v NullableFloat64) MarshalJSON() ([]byte, error)

func (*NullableFloat64) Set

func (v *NullableFloat64) Set(val *float64)

func (*NullableFloat64) UnmarshalJSON

func (v *NullableFloat64) UnmarshalJSON(src []byte) error

func (*NullableFloat64) Unset

func (v *NullableFloat64) Unset()

type NullableInt

type NullableInt struct {
	// contains filtered or unexported fields
}

func NewNullableInt

func NewNullableInt(val *int) *NullableInt

func (NullableInt) Get

func (v NullableInt) Get() *int

func (NullableInt) IsSet

func (v NullableInt) IsSet() bool

func (NullableInt) MarshalJSON

func (v NullableInt) MarshalJSON() ([]byte, error)

func (*NullableInt) Set

func (v *NullableInt) Set(val *int)

func (*NullableInt) UnmarshalJSON

func (v *NullableInt) UnmarshalJSON(src []byte) error

func (*NullableInt) Unset

func (v *NullableInt) Unset()

type NullableInt32

type NullableInt32 struct {
	// contains filtered or unexported fields
}

func NewNullableInt32

func NewNullableInt32(val *int32) *NullableInt32

func (NullableInt32) Get

func (v NullableInt32) Get() *int32

func (NullableInt32) IsSet

func (v NullableInt32) IsSet() bool

func (NullableInt32) MarshalJSON

func (v NullableInt32) MarshalJSON() ([]byte, error)

func (*NullableInt32) Set

func (v *NullableInt32) Set(val *int32)

func (*NullableInt32) UnmarshalJSON

func (v *NullableInt32) UnmarshalJSON(src []byte) error

func (*NullableInt32) Unset

func (v *NullableInt32) Unset()

type NullableInt64

type NullableInt64 struct {
	// contains filtered or unexported fields
}

func NewNullableInt64

func NewNullableInt64(val *int64) *NullableInt64

func (NullableInt64) Get

func (v NullableInt64) Get() *int64

func (NullableInt64) IsSet

func (v NullableInt64) IsSet() bool

func (NullableInt64) MarshalJSON

func (v NullableInt64) MarshalJSON() ([]byte, error)

func (*NullableInt64) Set

func (v *NullableInt64) Set(val *int64)

func (*NullableInt64) UnmarshalJSON

func (v *NullableInt64) UnmarshalJSON(src []byte) error

func (*NullableInt64) Unset

func (v *NullableInt64) Unset()

type NullableString

type NullableString struct {
	// contains filtered or unexported fields
}

func NewNullableString

func NewNullableString(val *string) *NullableString

func (NullableString) Get

func (v NullableString) Get() *string

func (NullableString) IsSet

func (v NullableString) IsSet() bool

func (NullableString) MarshalJSON

func (v NullableString) MarshalJSON() ([]byte, error)

func (*NullableString) Set

func (v *NullableString) Set(val *string)

func (*NullableString) UnmarshalJSON

func (v *NullableString) UnmarshalJSON(src []byte) error

func (*NullableString) Unset

func (v *NullableString) Unset()

type NullableTime

type NullableTime struct {
	// contains filtered or unexported fields
}

func NewNullableTime

func NewNullableTime(val *time.Time) *NullableTime

func (NullableTime) Get

func (v NullableTime) Get() *time.Time

func (NullableTime) IsSet

func (v NullableTime) IsSet() bool

func (NullableTime) MarshalJSON

func (v NullableTime) MarshalJSON() ([]byte, error)

func (*NullableTime) Set

func (v *NullableTime) Set(val *time.Time)

func (*NullableTime) UnmarshalJSON

func (v *NullableTime) UnmarshalJSON(src []byte) error

func (*NullableTime) Unset

func (v *NullableTime) Unset()

type Permission

type Permission struct {
	// REQUIRED
	Description *string `json:"description"`
	// REQUIRED
	Name *string `json:"name"`
}

type PermissionRequest

type PermissionRequest struct {
	// REQUIRED
	Name *string `json:"name"`
}

type RemoveMembersPayload

type RemoveMembersPayload struct {
	ForceRemove *bool `json:"forceRemove,omitempty"`
	// REQUIRED
	Members *[]Member `json:"members"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
}

type RemoveRoleRequest

type RemoveRoleRequest struct {
	// REQUIRED
	Name *string `json:"name"`
}

type RemoveRolesPayload

type RemoveRolesPayload struct {
	// REQUIRED
	ResourceType *string `json:"resourceType"`
	// REQUIRED
	Roles *[]RemoveRoleRequest `json:"roles"`
}

type Resource

type Resource struct {
	ResourceAlias *string `json:"resourceAlias,omitempty"`
	// REQUIRED
	ResourceId *string `json:"resourceId"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
}

type Role

type Role struct {
	// REQUIRED
	Description *string `json:"description"`
	// REQUIRED
	Name *string `json:"name"`
	// REQUIRED
	Permissions *[]Permission `json:"permissions"`
}

type RolesResponse

type RolesResponse struct {
	// REQUIRED
	ResourceId *string `json:"resourceId"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
	// REQUIRED
	Roles *[]Role `json:"roles"`
}

type Subject

type Subject struct {
	// REQUIRED
	Email *string `json:"email"`
	// REQUIRED
	Id *string `json:"id"`
	// REQUIRED
	Type *string `json:"type"`
}

type TransferSubjectMembershipsPayload

type TransferSubjectMembershipsPayload struct {
	// REQUIRED
	TargetSubjectId *string `json:"targetSubjectId"`
}

type UserMembership

type UserMembership struct {
	// REQUIRED
	ResourceId *string `json:"resourceId"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
	// REQUIRED
	Role *string `json:"role"`
	// REQUIRED
	Subject *string `json:"subject"`
}

type UserPermission

type UserPermission struct {
	// REQUIRED
	Permissions *[]ExistingPermission `json:"permissions"`
	// REQUIRED
	ResourceId *string `json:"resourceId"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
}

type UserResourcesResponse

type UserResourcesResponse struct {
	// REQUIRED
	Cursor *string `json:"cursor"`
	// REQUIRED
	Items *[]Resource `json:"items"`
	// Can be cast to int32 without loss of precision.
	// REQUIRED
	Limit *int64 `json:"limit"`
}

type ValidateChildMembersPayload

type ValidateChildMembersPayload struct {
	// REQUIRED
	ChildResourceType *string `json:"childResourceType"`
	// REQUIRED
	Members *[]Member `json:"members"`
	// REQUIRED
	ResourceType *string `json:"resourceType"`
}

type WriteSchemaPayload

type WriteSchemaPayload struct {
	// REQUIRED
	Schema *string `json:"schema"`
}

type WriteSchemaResponse

type WriteSchemaResponse struct {
	// REQUIRED
	WrittenAt *Zookie `json:"writtenAt"`
}

type Zookie

type Zookie struct {
	Zookie *string `json:"zookie,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL