regionsaccess

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRegionsAccessInto

func ExtractRegionsAccessInto(r pagination.Page, v interface{}) error

Types

type CreateOpts

type CreateOpts struct {
	AccessAllEdgeRegions bool  `json:"access_all_edge_regions"`
	RegionIDs            []int `json:"region_ids"`
	ClientID             *int  `json:"client_id"`
	ResellerID           *int  `json:"reseller_id"`
}

CreateOpts set parameters for Create operation.

func (CreateOpts) ToRegionAccessCreateMap

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

ToRegionAccessCreateMap builds a request body form CreateOpts.

func (CreateOpts) Validate

func (opts CreateOpts) Validate() error

Validate CreateOpts.

type CreateOptsBuilder

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

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

type CreateResult

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

CreateResult represents the result of an update operation. Call its Extract method to interpret it as a RegionAccess.

func (CreateResult) Extract

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

Extract is a function that accepts a result and extracts a region resource.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type DeleteResult

type DeleteResult struct {
	edgecloud.ErrResult
}

DeleteResult represent a result of a deletion operation.

func Delete

func Delete(c *edgecloud.ServiceClient, resellerID int) (r DeleteResult)

type ListOpts

type ListOpts struct {
	ResellerID int `q:"reseller_id"`
	ClientID   int `q:"client_id"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToRegionAccessListQuery

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

ToRegionAccessListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

type RegionAccess

type RegionAccess struct {
	ID                   int   `json:"id"`
	AccessAllEdgeRegions bool  `json:"access_all_edge_regions"`
	ClientID             *int  `json:"client_id"`
	RegionIDs            []int `json:"region_ids"`
	ResellerID           *int  `json:"reseller_id"`
}

func ExtractRegionsAccess

func ExtractRegionsAccess(r pagination.Page) ([]RegionAccess, error)

ExtractRegionsAccess accepts a Page struct, specifically a RegionAccessPage struct, and extracts the elements into a slice of RegionAccess structs. In other words, a generic collection is mapped into a relevant slice.

type RegionAccessPage

type RegionAccessPage struct {
	pagination.LinkedPageBase
}

RegionAccessPage is the page returned by a pager when traversing over a collection of regions access.

func (RegionAccessPage) IsEmpty

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

IsEmpty checks whether a RegionPage struct is empty.

func (RegionAccessPage) NextPageURL

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

NextPageURL is invoked when a paginated collection of regions has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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