credentials

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List enumerates the Credentials to which the current token has access.

Types

type CreateOpts

type CreateOpts struct {
	// Serialized blob containing the credentials
	Blob string `json:"blob" required:"true"`
	// ID of the project.
	ProjectID string `json:"project_id,omitempty"`
	// The type of the credential.
	Type string `json:"type" required:"true"`
	// ID of the user who owns the credential.
	UserID string `json:"user_id" required:"true"`
}

CreateOpts provides options used to create a credential.

func (CreateOpts) ToCredentialCreateMap

func (opts CreateOpts) ToCredentialCreateMap() (map[string]interface{}, error)

ToCredentialCreateMap formats a CreateOpts into a create request.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToCredentialCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult is the response from a Create operation. Call its Extract method to interpret it as a Credential.

func Create

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create creates a new Credential.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Credential, error)

Extract interprets any credential results as a Credential.

type Credential

type Credential struct {
	// The ID of the credential.
	ID string `json:"id"`
	// Serialized Blob Credential.
	Blob string `json:"blob"`
	// ID of the user who owns the credential.
	UserID string `json:"user_id"`
	// The type of the credential.
	Type string `json:"type"`
	// The ID of the project the credential was created for.
	ProjectID string `json:"project_id"`
	// Links contains referencing links to the credential.
	Links map[string]interface{} `json:"links"`
}

Credential represents the Credential object

func ExtractCredentials

func ExtractCredentials(r pagination.Page) ([]Credential, error)

Extract a Credential returns a slice of Credentials contained in a single page of results.

type CredentialPage

type CredentialPage struct {
	pagination.LinkedPageBase
}

a CredentialPage is a single page of a Credential results.

func (CredentialPage) IsEmpty

func (r CredentialPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a CredentialPage contains any results.

func (CredentialPage) NextPageURL

func (r CredentialPage) NextPageURL() (string, error)

NextPageURL extracts the "next" link from the links section of the result.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.

func Delete

func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult)

Delete deletes a credential.

type GetResult

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

GetResult is the response from a Get operation. Call its Extract method to interpret it as a Credential.

func Get

func Get(client *gophercloud.ServiceClient, id string) (r GetResult)

Get retrieves details on a single user, by ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Credential, error)

Extract interprets any credential results as a Credential.

type ListOpts

type ListOpts struct {
	// UserID filters the response by a credential user_id
	UserID string `q:"user_id"`
	// Type filters the response by a credential type
	Type string `q:"type"`
}

ListOpts provides options to filter the List results.

func (ListOpts) ToCredentialListQuery

func (opts ListOpts) ToCredentialListQuery() (string, error)

ToCredentialListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToCredentialListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request

type UpdateOpts

type UpdateOpts struct {
	// Serialized blob containing the credentials.
	Blob string `json:"blob,omitempty"`
	// ID of the project.
	ProjectID string `json:"project_id,omitempty"`
	// The type of the credential.
	Type string `json:"type,omitempty"`
	// ID of the user who owns the credential.
	UserID string `json:"user_id,omitempty"`
}

UpdateOpts represents parameters to update a credential.

func (UpdateOpts) ToCredentialsUpdateMap

func (opts UpdateOpts) ToCredentialsUpdateMap() (map[string]interface{}, error)

ToUpdateCreateMap formats a UpdateOpts into an update request.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToCredentialsUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult is the result of an Update request. Call its Extract method to interpret it as a Credential

func Update

func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

Update modifies the attributes of a Credential.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Credential, error)

Extract interprets any credential results as a Credential.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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