Documentation
¶
Index ¶
- Constants
- type AuditLog
- type AuditLogActor
- type AuditLogListParams
- type AuditLogService
- func (r *AuditLogService) Get(ctx context.Context, organizationID string, auditLogID string, ...) (res *AuditLog, err error)
- func (r *AuditLogService) List(ctx context.Context, organizationID string, query AuditLogListParams, ...) (res *pagination.Cursor[AuditLog], err error)
- func (r *AuditLogService) ListAutoPaging(ctx context.Context, organizationID string, query AuditLogListParams, ...) *pagination.CursorAutoPager[AuditLog]
- type AuditLogType
- type Error
- type Organization
- type OrganizationList
- type OrganizationListParams
- type OrganizationMembership
- type OrganizationMembershipRole
- type OrganizationNewParams
- type OrganizationService
- func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *Organization, err error)
- func (r *OrganizationService) List(ctx context.Context, query OrganizationListParams, ...) (res *pagination.Cursor[Organization], err error)
- func (r *OrganizationService) ListAutoPaging(ctx context.Context, query OrganizationListParams, ...) *pagination.CursorAutoPager[Organization]
- func (r *OrganizationService) New(ctx context.Context, body OrganizationNewParams, opts ...option.RequestOption) (res *Organization, err error)
- func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, ...) (res *Organization, err error)
- type OrganizationUpdateParams
- type Pagination
- type RegionName
- type ResourceStatus
- type Services
- type SourceIPRuleParam
Constants ¶
const RegionNameApSin1 = shared.RegionNameApSin1
Equals "ap-sin-1"
const RegionNameEuFrk1 = shared.RegionNameEuFrk1
Equals "eu-frk-1"
const RegionNameUsChi1 = shared.RegionNameUsChi1
Equals "us-chi-1"
const RegionNameUsSea1 = shared.RegionNameUsSea1
Equals "us-sea-1"
const RegionNameUsSva1 = shared.RegionNameUsSva1
Equals "us-sva-1"
const RegionNameUsSva2 = shared.RegionNameUsSva2
Equals "us-sva-2"
const RegionNameUsWdc1 = shared.RegionNameUsWdc1
Equals "us-wdc-1"
const ResourceStatusCreating = shared.ResourceStatusCreating
Equals "creating"
const ResourceStatusDeleted = shared.ResourceStatusDeleted
Equals "deleted"
const ResourceStatusDeleting = shared.ResourceStatusDeleting
Equals "deleting"
const ResourceStatusError = shared.ResourceStatusError
Equals "error"
const ResourceStatusPending = shared.ResourceStatusPending
Equals "pending"
const ResourceStatusReady = shared.ResourceStatusReady
Equals "ready"
const ResourceStatusUpdating = shared.ResourceStatusUpdating
Equals "updating"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLog ¶ added in v1.49.0
type AuditLog struct {
// Unique identifier for the audit log entry.
ID string `json:"id" api:"required"`
// The entity that performed the action.
Actor AuditLogActor `json:"actor" api:"required"`
// Client IP address.
ClientIP string `json:"client_ip" api:"required"`
// When the action occurred.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// HTTP method of the request.
Method string `json:"method" api:"required"`
// Request path.
Path string `json:"path" api:"required"`
// HTTP status code of the response.
StatusCode int64 `json:"status_code" api:"required"`
// User agent string.
UserAgent string `json:"user_agent" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Actor respjson.Field
ClientIP respjson.Field
CreatedAt respjson.Field
Method respjson.Field
Path respjson.Field
StatusCode respjson.Field
UserAgent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Audit log entry.
func (*AuditLog) UnmarshalJSON ¶ added in v1.49.0
type AuditLogActor ¶ added in v1.49.0
type AuditLogActor struct {
// Unique identifier for the actor.
ID string `json:"id" api:"required"`
// Type of actor.
//
// Any of "user", "api_key".
Type AuditLogType `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The entity that performed the action.
func (AuditLogActor) RawJSON ¶ added in v1.49.0
func (r AuditLogActor) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuditLogActor) UnmarshalJSON ¶ added in v1.49.0
func (r *AuditLogActor) UnmarshalJSON(data []byte) error
type AuditLogListParams ¶ added in v1.49.0
type AuditLogListParams struct {
// Pagination cursor returned by a previous request
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Maximum number of items to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AuditLogListParams) URLQuery ¶ added in v1.49.0
func (r AuditLogListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AuditLogListParams's query parameters as `url.Values`.
type AuditLogService ¶ added in v1.49.0
type AuditLogService struct {
Options []option.RequestOption
}
AuditLogService contains methods and other services that help with interacting with the Nirvana Labs 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 NewAuditLogService method instead.
func NewAuditLogService ¶ added in v1.49.0
func NewAuditLogService(opts ...option.RequestOption) (r AuditLogService)
NewAuditLogService 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 (*AuditLogService) Get ¶ added in v1.49.0
func (r *AuditLogService) Get(ctx context.Context, organizationID string, auditLogID string, opts ...option.RequestOption) (res *AuditLog, err error)
Get an Audit Log entry
func (*AuditLogService) List ¶ added in v1.49.0
func (r *AuditLogService) List(ctx context.Context, organizationID string, query AuditLogListParams, opts ...option.RequestOption) (res *pagination.Cursor[AuditLog], err error)
List Audit Log entries for an organization
func (*AuditLogService) ListAutoPaging ¶ added in v1.49.0
func (r *AuditLogService) ListAutoPaging(ctx context.Context, organizationID string, query AuditLogListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[AuditLog]
List Audit Log entries for an organization
type AuditLogType ¶ added in v1.49.0
type AuditLogType string
Type of actor.
const ( AuditLogTypeUser AuditLogType = "user" AuditLogTypeAPIKey AuditLogType = "api_key" )
type Organization ¶
type Organization struct {
// Organization ID.
ID string `json:"id" api:"required"`
// When the Organization was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Current user's membership details.
Membership OrganizationMembership `json:"membership" api:"required"`
// Organization name.
Name string `json:"name" api:"required"`
// Whether the organization is a personal Organization.
Personal bool `json:"personal" api:"required"`
// Services that the Organization has access to.
Services Services `json:"services" api:"required"`
// When the Organization was updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Authentication provider organization ID.
AuthID string `json:"auth_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Membership respjson.Field
Name respjson.Field
Personal respjson.Field
Services respjson.Field
UpdatedAt respjson.Field
AuthID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Organization response.
func (Organization) RawJSON ¶
func (r Organization) RawJSON() string
Returns the unmodified JSON received from the API
func (*Organization) UnmarshalJSON ¶
func (r *Organization) UnmarshalJSON(data []byte) error
type OrganizationList ¶
type OrganizationList struct {
Items []Organization `json:"items" api:"required"`
// Pagination response details.
Pagination shared.Pagination `json:"pagination" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
Pagination respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OrganizationList) RawJSON ¶
func (r OrganizationList) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrganizationList) UnmarshalJSON ¶
func (r *OrganizationList) UnmarshalJSON(data []byte) error
type OrganizationListParams ¶
type OrganizationListParams struct {
// Pagination cursor returned by a previous request
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Maximum number of items to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (OrganizationListParams) URLQuery ¶
func (r OrganizationListParams) URLQuery() (v url.Values, err error)
URLQuery serializes OrganizationListParams's query parameters as `url.Values`.
type OrganizationMembership ¶ added in v1.46.0
type OrganizationMembership struct {
// Membership ID.
ID string `json:"id" api:"required"`
// Role of the user in the organization.
//
// Any of "owner", "member".
Role OrganizationMembershipRole `json:"role" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Role respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Current user's membership details.
func (OrganizationMembership) RawJSON ¶ added in v1.46.0
func (r OrganizationMembership) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrganizationMembership) UnmarshalJSON ¶ added in v1.46.0
func (r *OrganizationMembership) UnmarshalJSON(data []byte) error
type OrganizationMembershipRole ¶ added in v1.46.0
type OrganizationMembershipRole string
Role of the user in the organization.
const ( OrganizationMembershipRoleOwner OrganizationMembershipRole = "owner" OrganizationMembershipRoleMember OrganizationMembershipRole = "member" )
type OrganizationNewParams ¶ added in v1.41.0
type OrganizationNewParams struct {
// Organization name.
Name string `json:"name" api:"required"`
// contains filtered or unexported fields
}
func (OrganizationNewParams) MarshalJSON ¶ added in v1.41.0
func (r OrganizationNewParams) MarshalJSON() (data []byte, err error)
func (*OrganizationNewParams) UnmarshalJSON ¶ added in v1.41.0
func (r *OrganizationNewParams) UnmarshalJSON(data []byte) error
type OrganizationService ¶
type OrganizationService struct {
Options []option.RequestOption
AuditLogs AuditLogService
}
OrganizationService contains methods and other services that help with interacting with the Nirvana Labs 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 NewOrganizationService method instead.
func NewOrganizationService ¶
func NewOrganizationService(opts ...option.RequestOption) (r OrganizationService)
NewOrganizationService 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 (*OrganizationService) Get ¶
func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *Organization, err error)
Get details about an Organization
func (*OrganizationService) List ¶
func (r *OrganizationService) List(ctx context.Context, query OrganizationListParams, opts ...option.RequestOption) (res *pagination.Cursor[Organization], err error)
List organizations
func (*OrganizationService) ListAutoPaging ¶
func (r *OrganizationService) ListAutoPaging(ctx context.Context, query OrganizationListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Organization]
List organizations
func (*OrganizationService) New ¶ added in v1.41.0
func (r *OrganizationService) New(ctx context.Context, body OrganizationNewParams, opts ...option.RequestOption) (res *Organization, err error)
Create a new organization
func (*OrganizationService) Update ¶ added in v1.41.0
func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, opts ...option.RequestOption) (res *Organization, err error)
Update an existing organization
type OrganizationUpdateParams ¶ added in v1.41.0
type OrganizationUpdateParams struct {
// Organization name.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (OrganizationUpdateParams) MarshalJSON ¶ added in v1.41.0
func (r OrganizationUpdateParams) MarshalJSON() (data []byte, err error)
func (*OrganizationUpdateParams) UnmarshalJSON ¶ added in v1.41.0
func (r *OrganizationUpdateParams) UnmarshalJSON(data []byte) error
type Pagination ¶
type Pagination = shared.Pagination
Pagination response details.
This is an alias to an internal type.
type RegionName ¶
type RegionName = shared.RegionName
Region the resource is in.
This is an alias to an internal type.
type ResourceStatus ¶
type ResourceStatus = shared.ResourceStatus
Status of the resource.
This is an alias to an internal type.
type Services ¶ added in v1.47.0
type Services struct {
Cloud bool `json:"cloud"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cloud respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Services that the Organization has access to.
func (*Services) UnmarshalJSON ¶ added in v1.47.0
type SourceIPRuleParam ¶
type SourceIPRuleParam = shared.SourceIPRuleParam
IP filter rules.
This is an alias to an internal type.