organizations

package
v1.88.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const RegionNameUsSva2 = shared.RegionNameUsSva2

Equals "us-sva-2"

View Source
const ResourceStatusCreating = shared.ResourceStatusCreating

Equals "creating"

View Source
const ResourceStatusDeleted = shared.ResourceStatusDeleted

Equals "deleted"

View Source
const ResourceStatusDeleting = shared.ResourceStatusDeleting

Equals "deleting"

View Source
const ResourceStatusError = shared.ResourceStatusError

Equals "error"

View Source
const ResourceStatusPending = shared.ResourceStatusPending

Equals "pending"

View Source
const ResourceStatusReady = shared.ResourceStatusReady

Equals "ready"

View Source
const ResourceStatusUpdating = shared.ResourceStatusUpdating

Equals "updating"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressNewParams added in v1.88.2

type AddressNewParams struct {
	// City or locality.
	City string `json:"city" api:"required"`
	// Two-letter ISO 3166-1 alpha-2 country code.
	Country string `json:"country" api:"required"`
	// First line of the street address.
	Line1 string `json:"line1" api:"required"`
	// Postal or ZIP code.
	PostalCode string `json:"postal_code" api:"required"`
	// Second line of the street address (suite, unit, building).
	Line2 param.Opt[string] `json:"line2,omitzero"`
	// State, province, or region. Required by some tax jurisdictions (e.g. US, CA).
	State param.Opt[string] `json:"state,omitzero"`
	// Tax identification number (e.g. VAT, EIN, ABN). Optional.
	TaxID param.Opt[string] `json:"tax_id,omitzero"`
	// Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn).
	// Optional.
	TaxIDType param.Opt[string] `json:"tax_id_type,omitzero"`
	// contains filtered or unexported fields
}

func (AddressNewParams) MarshalJSON added in v1.88.2

func (r AddressNewParams) MarshalJSON() (data []byte, err error)

func (*AddressNewParams) UnmarshalJSON added in v1.88.2

func (r *AddressNewParams) UnmarshalJSON(data []byte) error

type AddressService added in v1.88.2

type AddressService struct {
	Options []option.RequestOption
}

AddressService 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 NewAddressService method instead.

func NewAddressService added in v1.88.2

func NewAddressService(opts ...option.RequestOption) (r AddressService)

NewAddressService 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 (*AddressService) Get added in v1.88.2

func (r *AddressService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *OrganizationAddress, err error)

Get the address for an organization

func (*AddressService) New added in v1.88.2

func (r *AddressService) New(ctx context.Context, organizationID string, body AddressNewParams, opts ...option.RequestOption) (res *OrganizationAddress, err error)

Create the address for an organization

func (*AddressService) Update added in v1.88.2

func (r *AddressService) Update(ctx context.Context, organizationID string, body AddressUpdateParams, opts ...option.RequestOption) (res *OrganizationAddress, err error)

Update the address for an organization

type AddressUpdateParams added in v1.88.2

type AddressUpdateParams struct {
	// Second line of the street address (suite, unit, building). Omit to leave
	// unchanged, send null to clear, or send a value to set it.
	Line2 param.Opt[string] `json:"line2,omitzero"`
	// State, province, or region. Omit to leave unchanged, send null to clear, or send
	// a value to set it.
	State param.Opt[string] `json:"state,omitzero"`
	// Tax identification number (e.g. VAT, EIN, ABN). Omit to leave unchanged, send
	// null to clear, or send a value to set it.
	TaxID param.Opt[string] `json:"tax_id,omitzero"`
	// Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn).
	// Omit to leave unchanged, send null to clear, or send a value to set it.
	TaxIDType param.Opt[string] `json:"tax_id_type,omitzero"`
	// City or locality.
	City param.Opt[string] `json:"city,omitzero"`
	// Two-letter ISO 3166-1 alpha-2 country code.
	Country param.Opt[string] `json:"country,omitzero"`
	// First line of the street address.
	Line1 param.Opt[string] `json:"line1,omitzero"`
	// Postal or ZIP code.
	PostalCode param.Opt[string] `json:"postal_code,omitzero"`
	// contains filtered or unexported fields
}

func (AddressUpdateParams) MarshalJSON added in v1.88.2

func (r AddressUpdateParams) MarshalJSON() (data []byte, err error)

func (*AddressUpdateParams) UnmarshalJSON added in v1.88.2

func (r *AddressUpdateParams) UnmarshalJSON(data []byte) error

type Error

type Error = apierror.Error

type MembershipListParams added in v1.62.0

type MembershipListParams 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 (MembershipListParams) URLQuery added in v1.62.0

func (r MembershipListParams) URLQuery() (v url.Values, err error)

URLQuery serializes MembershipListParams's query parameters as `url.Values`.

type MembershipService added in v1.62.0

type MembershipService struct {
	Options []option.RequestOption
}

MembershipService 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 NewMembershipService method instead.

func NewMembershipService added in v1.62.0

func NewMembershipService(opts ...option.RequestOption) (r MembershipService)

NewMembershipService 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 (*MembershipService) Get added in v1.62.0

func (r *MembershipService) Get(ctx context.Context, organizationID string, membershipID string, opts ...option.RequestOption) (res *OrganizationMembership, err error)

Get details about an organization membership

func (*MembershipService) List added in v1.62.0

List all memberships for an organization

func (*MembershipService) ListAutoPaging added in v1.62.0

List all memberships for an organization

type Organization

type Organization struct {
	// Organization ID.
	ID string `json:"id" api:"required"`
	// Billing email. Null when no custom billing email is set (reverts to the oldest
	// owner's email).
	BillingEmail string `json:"billing_email" api:"required"`
	// When the Organization was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Domains associated with the organization.
	Domains []OrganizationDomain `json:"domains" api:"required"`
	// Metronome customer ID.
	MetronomeCustomerID string `json:"metronome_customer_id" 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 OrganizationServices `json:"services" api:"required"`
	// Stripe customer ID.
	StripeCustomerID string `json:"stripe_customer_id" api:"required"`
	// Organization type.
	//
	// Any of "personal", "company".
	Type OrganizationType `json:"type" 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
		BillingEmail        respjson.Field
		CreatedAt           respjson.Field
		Domains             respjson.Field
		MetronomeCustomerID respjson.Field
		Name                respjson.Field
		Personal            respjson.Field
		Services            respjson.Field
		StripeCustomerID    respjson.Field
		Type                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 OrganizationAddress added in v1.88.2

type OrganizationAddress struct {
	// Address ID.
	ID string `json:"id" api:"required"`
	// City or locality.
	City string `json:"city" api:"required"`
	// Two-letter ISO 3166-1 alpha-2 country code.
	Country string `json:"country" api:"required"`
	// When the address was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// First line of the street address.
	Line1 string `json:"line1" api:"required"`
	// Second line of the street address. Null when not provided.
	Line2 string `json:"line2" api:"required"`
	// Organization ID the address belongs to.
	OrganizationID string `json:"organization_id" api:"required"`
	// Postal or ZIP code.
	PostalCode string `json:"postal_code" api:"required"`
	// State, province, or region. Null when not provided.
	State string `json:"state" api:"required"`
	// Tax identification number. Null when not provided.
	TaxID string `json:"tax_id" api:"required"`
	// Type of the tax identification number. Null when not provided.
	TaxIDType string `json:"tax_id_type" api:"required"`
	// When the address was updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		City           respjson.Field
		Country        respjson.Field
		CreatedAt      respjson.Field
		Line1          respjson.Field
		Line2          respjson.Field
		OrganizationID respjson.Field
		PostalCode     respjson.Field
		State          respjson.Field
		TaxID          respjson.Field
		TaxIDType      respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization address details.

func (OrganizationAddress) RawJSON added in v1.88.2

func (r OrganizationAddress) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationAddress) UnmarshalJSON added in v1.88.2

func (r *OrganizationAddress) UnmarshalJSON(data []byte) error

type OrganizationDomain added in v1.52.0

type OrganizationDomain struct {
	// Domain ID.
	ID string `json:"id" api:"required"`
	// Domain name.
	Domain string `json:"domain" api:"required"`
	// Whether the domain has been verified.
	Verified bool `json:"verified" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Domain      respjson.Field
		Verified    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization domain details.

func (OrganizationDomain) RawJSON added in v1.52.0

func (r OrganizationDomain) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationDomain) UnmarshalJSON added in v1.52.0

func (r *OrganizationDomain) 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"`
	// When the membership was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Organization ID.
	OrganizationID string `json:"organization_id" api:"required"`
	// Role of the user in the organization.
	//
	// Any of "owner", "member".
	Role OrganizationMembershipRole `json:"role" api:"required"`
	// When the membership was updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// User ID.
	UserID string `json:"user_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		CreatedAt      respjson.Field
		OrganizationID respjson.Field
		Role           respjson.Field
		UpdatedAt      respjson.Field
		UserID         respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization 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 OrganizationMembershipList added in v1.62.0

type OrganizationMembershipList struct {
	Items []OrganizationMembership `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 (OrganizationMembershipList) RawJSON added in v1.62.0

func (r OrganizationMembershipList) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationMembershipList) UnmarshalJSON added in v1.62.0

func (r *OrganizationMembershipList) 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"`
	// Optional billing email. When omitted, the oldest owner's email is used.
	BillingEmail param.Opt[string] `json:"billing_email,omitzero"`
	// 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
	Memberships MembershipService
	Address     AddressService
}

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) Leave added in v1.51.0

func (r *OrganizationService) Leave(ctx context.Context, organizationID string, opts ...option.RequestOption) (err error)

Leave an Organization

func (*OrganizationService) List

List organizations

func (*OrganizationService) ListAutoPaging

List organizations

func (*OrganizationService) New added in v1.41.0

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 OrganizationServices added in v1.52.0

type OrganizationServices struct {
	// Whether cloud services are enabled for the organization.
	Cloud bool `json:"cloud" api:"required"`
	// Whether just-in-time provisioning is enabled for the organization.
	JitProvisioning bool `json:"jit_provisioning" api:"required"`
	// Whether SCIM provisioning is enabled for the organization.
	SCIM bool `json:"scim" api:"required"`
	// Whether SIEM integration is enabled for the organization.
	SIEM bool `json:"siem" api:"required"`
	// Whether single sign-on is enabled for the organization.
	SSO bool `json:"sso" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cloud           respjson.Field
		JitProvisioning respjson.Field
		SCIM            respjson.Field
		SIEM            respjson.Field
		SSO             respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Services that the Organization has access to.

func (OrganizationServices) RawJSON added in v1.52.0

func (r OrganizationServices) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationServices) UnmarshalJSON added in v1.52.0

func (r *OrganizationServices) UnmarshalJSON(data []byte) error

type OrganizationType added in v1.76.0

type OrganizationType string

Organization type.

const (
	OrganizationTypePersonal OrganizationType = "personal"
	OrganizationTypeCompany  OrganizationType = "company"
)

type OrganizationUpdateParams added in v1.41.0

type OrganizationUpdateParams struct {
	// Billing email. Omit to leave unchanged, send null to clear (reverts to the
	// oldest owner's email), or send a value to set it.
	BillingEmail param.Opt[string] `json:"billing_email,omitzero"`
	// 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 SourceIPRuleParam

type SourceIPRuleParam = shared.SourceIPRuleParam

IP filter rules.

This is an alias to an internal type.

type SourceIPRuleResponse added in v1.54.0

type SourceIPRuleResponse = shared.SourceIPRuleResponse

IP filter rules.

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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