tagapi

package module
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MPL-2.0 Imports: 21 Imported by: 3

README

Go API client for tagapi

Tags are case-sensitive key-value pairs that simplify resource management. The Tag Manager API allows you to create and manage such tags to later assign them to related resources in your Bare Metal Cloud (through the respective resource apis) in order to group and categorize them.

Knowledge base articles to help you can be found here

All URLs are relative to (https://api.phoenixnap.com/tag-manager/v1/)

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import tagapi "github.com/phoenixnap/go-sdk-bmc/tagapi"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value tagapi.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), tagapi.ContextServerIndex, 1)
Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value tagapi.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), tagapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using tagapi.ContextOperationServerIndices and tagapi.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), tagapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), tagapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.phoenixnap.com/tag-manager/v1

Class Method HTTP request Description
TagsAPI TagsGet Get /tags List tags.
TagsAPI TagsPost Post /tags Create a Tag.
TagsAPI TagsTagIdDelete Delete /tags/{tagId} Delete a Tag.
TagsAPI TagsTagIdGet Get /tags/{tagId} Get a Tag.
TagsAPI TagsTagIdPatch Patch /tags/{tagId} Modify a Tag.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

OAuth2
  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • tags: Grants full access to tags-api.
  • tags.read: Grants read only access to tags-api.

Example

auth := context.WithValue(context.Background(), tagapi.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, tagapi.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]

Documentation

Index

Constants

View Source
const SdkVersion = "3.0.2"

Variables

View Source
var (
	JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
	XmlCheck  = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
)
View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextServerIndex uses a server configuration from the index.
	ContextServerIndex = contextKey("serverIndex")

	// ContextOperationServerIndices uses a server configuration from the index mapping.
	ContextOperationServerIndices = contextKey("serverOperationIndices")

	// ContextServerVariables overrides a server configuration variables.
	ContextServerVariables = contextKey("serverVariables")

	// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
	ContextOperationServerVariables = contextKey("serverOperationVariables")
)

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 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 {
	TagsAPI TagsAPI
	// contains filtered or unexported fields
}

APIClient manages communication with the Tags API API v1.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *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

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResponse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type ApiTagsGetRequest

type ApiTagsGetRequest struct {
	ApiService TagsAPI
	// contains filtered or unexported fields
}

func (ApiTagsGetRequest) Execute

func (r ApiTagsGetRequest) Execute() ([]Tag, *http.Response, error)

func (ApiTagsGetRequest) Name

Query a tag by its name.

type ApiTagsPostRequest

type ApiTagsPostRequest struct {
	ApiService TagsAPI
	// contains filtered or unexported fields
}

func (ApiTagsPostRequest) Execute

func (r ApiTagsPostRequest) Execute() (*Tag, *http.Response, error)

func (ApiTagsPostRequest) TagCreate

func (r ApiTagsPostRequest) TagCreate(tagCreate TagCreate) ApiTagsPostRequest

The body containing the tag details.

type ApiTagsTagIdDeleteRequest

type ApiTagsTagIdDeleteRequest struct {
	ApiService TagsAPI
	// contains filtered or unexported fields
}

func (ApiTagsTagIdDeleteRequest) Execute

type ApiTagsTagIdGetRequest

type ApiTagsTagIdGetRequest struct {
	ApiService TagsAPI
	// contains filtered or unexported fields
}

func (ApiTagsTagIdGetRequest) Execute

func (r ApiTagsTagIdGetRequest) Execute() (*Tag, *http.Response, error)

type ApiTagsTagIdPatchRequest

type ApiTagsTagIdPatchRequest struct {
	ApiService TagsAPI
	// contains filtered or unexported fields
}

func (ApiTagsTagIdPatchRequest) Execute

func (r ApiTagsTagIdPatchRequest) Execute() (*Tag, *http.Response, error)

func (ApiTagsTagIdPatchRequest) TagUpdate

The body containing the tag changes.

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	Host             string            `json:"host,omitempty"`
	Scheme           string            `json:"scheme,omitempty"`
	DefaultHeader    map[string]string `json:"defaultHeader,omitempty"`
	UserAgent        string            `json:"userAgent,omitempty"`
	XPoweredBy       string            `json:"xPoweredBy,omitempty"`
	Debug            bool              `json:"debug,omitempty"`
	Servers          ServerConfigurations
	OperationServers map[string]ServerConfigurations
	HTTPClient       *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerURL

func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error)

ServerURL returns URL based on server settings

func (*Configuration) ServerURLWithContext

func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error)

ServerURLWithContext returns a new server URL given an endpoint

type DeleteResult

type DeleteResult struct {
	// Tag deletion result message.
	Result string `json:"result"`
	// The unique identifier of the tag.
	TagId                string `json:"tagId"`
	AdditionalProperties map[string]interface{}
}

DeleteResult Result of a successful delete action.

func NewDeleteResult

func NewDeleteResult(result string, tagId string) *DeleteResult

NewDeleteResult instantiates a new DeleteResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed

func NewDeleteResultWithDefaults

func NewDeleteResultWithDefaults() *DeleteResult

NewDeleteResultWithDefaults instantiates a new DeleteResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*DeleteResult) GetResult

func (o *DeleteResult) GetResult() string

GetResult returns the Result field value

func (*DeleteResult) GetResultOk

func (o *DeleteResult) GetResultOk() (*string, bool)

GetResultOk returns a tuple with the Result field value and a boolean to check if the value has been set.

func (*DeleteResult) GetTagId

func (o *DeleteResult) GetTagId() string

GetTagId returns the TagId field value

func (*DeleteResult) GetTagIdOk

func (o *DeleteResult) GetTagIdOk() (*string, bool)

GetTagIdOk returns a tuple with the TagId field value and a boolean to check if the value has been set.

func (DeleteResult) MarshalJSON

func (o DeleteResult) MarshalJSON() ([]byte, error)

func (*DeleteResult) SetResult

func (o *DeleteResult) SetResult(v string)

SetResult sets field value

func (*DeleteResult) SetTagId

func (o *DeleteResult) SetTagId(v string)

SetTagId sets field value

func (DeleteResult) ToMap

func (o DeleteResult) ToMap() (map[string]interface{}, error)

func (*DeleteResult) UnmarshalJSON

func (o *DeleteResult) UnmarshalJSON(data []byte) (err error)

type Error

type Error struct {
	// The description detailing the cause of the error code.
	Message string `json:"message"`
	// Validation errors, if any.
	ValidationErrors     []string `json:"validationErrors,omitempty"`
	AdditionalProperties map[string]interface{}
}

Error struct for Error

func NewError

func NewError(message string) *Error

NewError instantiates a new Error object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed

func NewErrorWithDefaults

func NewErrorWithDefaults() *Error

NewErrorWithDefaults instantiates a new Error object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*Error) GetMessage

func (o *Error) GetMessage() string

GetMessage returns the Message field value

func (*Error) GetMessageOk

func (o *Error) GetMessageOk() (*string, bool)

GetMessageOk returns a tuple with the Message field value and a boolean to check if the value has been set.

func (*Error) GetValidationErrors

func (o *Error) GetValidationErrors() []string

GetValidationErrors returns the ValidationErrors field value if set, zero value otherwise.

func (*Error) GetValidationErrorsOk

func (o *Error) GetValidationErrorsOk() ([]string, bool)

GetValidationErrorsOk returns a tuple with the ValidationErrors field value if set, nil otherwise and a boolean to check if the value has been set.

func (*Error) HasValidationErrors

func (o *Error) HasValidationErrors() bool

HasValidationErrors returns a boolean if a field has been set.

func (Error) MarshalJSON

func (o Error) MarshalJSON() ([]byte, error)

func (*Error) SetMessage

func (o *Error) SetMessage(v string)

SetMessage sets field value

func (*Error) SetValidationErrors

func (o *Error) SetValidationErrors(v []string)

SetValidationErrors gets a reference to the given []string and assigns it to the ValidationErrors field.

func (Error) ToMap

func (o Error) ToMap() (map[string]interface{}, error)

func (*Error) UnmarshalJSON

func (o *Error) UnmarshalJSON(data []byte) (err error)

type GenericOpenAPIError

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

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type MappedNullable

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

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 NullableDeleteResult

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

func NewNullableDeleteResult

func NewNullableDeleteResult(val *DeleteResult) *NullableDeleteResult

func (NullableDeleteResult) Get

func (NullableDeleteResult) IsSet

func (v NullableDeleteResult) IsSet() bool

func (NullableDeleteResult) MarshalJSON

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

func (*NullableDeleteResult) Set

func (v *NullableDeleteResult) Set(val *DeleteResult)

func (*NullableDeleteResult) UnmarshalJSON

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

func (*NullableDeleteResult) Unset

func (v *NullableDeleteResult) Unset()

type NullableError

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

func NewNullableError

func NewNullableError(val *Error) *NullableError

func (NullableError) Get

func (v NullableError) Get() *Error

func (NullableError) IsSet

func (v NullableError) IsSet() bool

func (NullableError) MarshalJSON

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

func (*NullableError) Set

func (v *NullableError) Set(val *Error)

func (*NullableError) UnmarshalJSON

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

func (*NullableError) Unset

func (v *NullableError) 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 NullableResourceAssignment

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

func NewNullableResourceAssignment

func NewNullableResourceAssignment(val *ResourceAssignment) *NullableResourceAssignment

func (NullableResourceAssignment) Get

func (NullableResourceAssignment) IsSet

func (v NullableResourceAssignment) IsSet() bool

func (NullableResourceAssignment) MarshalJSON

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

func (*NullableResourceAssignment) Set

func (*NullableResourceAssignment) UnmarshalJSON

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

func (*NullableResourceAssignment) Unset

func (v *NullableResourceAssignment) 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 NullableTag

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

func NewNullableTag

func NewNullableTag(val *Tag) *NullableTag

func (NullableTag) Get

func (v NullableTag) Get() *Tag

func (NullableTag) IsSet

func (v NullableTag) IsSet() bool

func (NullableTag) MarshalJSON

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

func (*NullableTag) Set

func (v *NullableTag) Set(val *Tag)

func (*NullableTag) UnmarshalJSON

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

func (*NullableTag) Unset

func (v *NullableTag) Unset()

type NullableTagCreate

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

func NewNullableTagCreate

func NewNullableTagCreate(val *TagCreate) *NullableTagCreate

func (NullableTagCreate) Get

func (v NullableTagCreate) Get() *TagCreate

func (NullableTagCreate) IsSet

func (v NullableTagCreate) IsSet() bool

func (NullableTagCreate) MarshalJSON

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

func (*NullableTagCreate) Set

func (v *NullableTagCreate) Set(val *TagCreate)

func (*NullableTagCreate) UnmarshalJSON

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

func (*NullableTagCreate) Unset

func (v *NullableTagCreate) Unset()

type NullableTagUpdate

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

func NewNullableTagUpdate

func NewNullableTagUpdate(val *TagUpdate) *NullableTagUpdate

func (NullableTagUpdate) Get

func (v NullableTagUpdate) Get() *TagUpdate

func (NullableTagUpdate) IsSet

func (v NullableTagUpdate) IsSet() bool

func (NullableTagUpdate) MarshalJSON

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

func (*NullableTagUpdate) Set

func (v *NullableTagUpdate) Set(val *TagUpdate)

func (*NullableTagUpdate) UnmarshalJSON

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

func (*NullableTagUpdate) Unset

func (v *NullableTagUpdate) 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 ResourceAssignment

type ResourceAssignment struct {
	// The resource name which is automatically generated by the tags-api. It is a unique resource identifier made up of the API name (e.g. bmc, ips), the resource type and the resource ID. This is not to be confused with custom names that are defined for particular resources, such as the server name or network name.
	ResourceName string `json:"resourceName"`
	// The value of the tag assigned to the resource.
	Value                *string `json:"value,omitempty"`
	AdditionalProperties map[string]interface{}
}

ResourceAssignment Resource assigned to a tag.

func NewResourceAssignment

func NewResourceAssignment(resourceName string) *ResourceAssignment

NewResourceAssignment instantiates a new ResourceAssignment object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed

func NewResourceAssignmentWithDefaults

func NewResourceAssignmentWithDefaults() *ResourceAssignment

NewResourceAssignmentWithDefaults instantiates a new ResourceAssignment object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*ResourceAssignment) GetResourceName

func (o *ResourceAssignment) GetResourceName() string

GetResourceName returns the ResourceName field value

func (*ResourceAssignment) GetResourceNameOk

func (o *ResourceAssignment) GetResourceNameOk() (*string, bool)

GetResourceNameOk returns a tuple with the ResourceName field value and a boolean to check if the value has been set.

func (*ResourceAssignment) GetValue

func (o *ResourceAssignment) GetValue() string

GetValue returns the Value field value if set, zero value otherwise.

func (*ResourceAssignment) GetValueOk

func (o *ResourceAssignment) GetValueOk() (*string, bool)

GetValueOk returns a tuple with the Value field value if set, nil otherwise and a boolean to check if the value has been set.

func (*ResourceAssignment) HasValue

func (o *ResourceAssignment) HasValue() bool

HasValue returns a boolean if a field has been set.

func (ResourceAssignment) MarshalJSON

func (o ResourceAssignment) MarshalJSON() ([]byte, error)

func (*ResourceAssignment) SetResourceName

func (o *ResourceAssignment) SetResourceName(v string)

SetResourceName sets field value

func (*ResourceAssignment) SetValue

func (o *ResourceAssignment) SetValue(v string)

SetValue gets a reference to the given string and assigns it to the Value field.

func (ResourceAssignment) ToMap

func (o ResourceAssignment) ToMap() (map[string]interface{}, error)

func (*ResourceAssignment) UnmarshalJSON

func (o *ResourceAssignment) UnmarshalJSON(data []byte) (err error)

type ServerConfiguration

type ServerConfiguration struct {
	URL         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerConfigurations

type ServerConfigurations []ServerConfiguration

ServerConfigurations stores multiple ServerConfiguration items

func (ServerConfigurations) URL

func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error)

URL formats template on a index using given variables

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type Tag

type Tag struct {
	// The unique id of the tag.
	Id string `json:"id"`
	// The name of the tag.
	Name string `json:"name"`
	// The optional values of the tag.
	Values []string `json:"values,omitempty"`
	// The description of the tag.
	Description *string `json:"description,omitempty"`
	// Whether or not to show the tag as part of billing and invoices.
	IsBillingTag bool `json:"isBillingTag"`
	// The tag's assigned resources.
	ResourceAssignments []ResourceAssignment `json:"resourceAssignments,omitempty"`
	// The tag's creator.
	CreatedBy            *string `json:"createdBy,omitempty"`
	AdditionalProperties map[string]interface{}
}

Tag Tag model.

func NewTag

func NewTag(id string, name string, isBillingTag bool) *Tag

NewTag instantiates a new Tag object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed

func NewTagWithDefaults

func NewTagWithDefaults() *Tag

NewTagWithDefaults instantiates a new Tag object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*Tag) GetCreatedBy

func (o *Tag) GetCreatedBy() string

GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.

func (*Tag) GetCreatedByOk

func (o *Tag) GetCreatedByOk() (*string, bool)

GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise and a boolean to check if the value has been set.

func (*Tag) GetDescription

func (o *Tag) GetDescription() string

GetDescription returns the Description field value if set, zero value otherwise.

func (*Tag) GetDescriptionOk

func (o *Tag) GetDescriptionOk() (*string, bool)

GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise and a boolean to check if the value has been set.

func (*Tag) GetId

func (o *Tag) GetId() string

GetId returns the Id field value

func (*Tag) GetIdOk

func (o *Tag) GetIdOk() (*string, bool)

GetIdOk returns a tuple with the Id field value and a boolean to check if the value has been set.

func (*Tag) GetIsBillingTag

func (o *Tag) GetIsBillingTag() bool

GetIsBillingTag returns the IsBillingTag field value

func (*Tag) GetIsBillingTagOk

func (o *Tag) GetIsBillingTagOk() (*bool, bool)

GetIsBillingTagOk returns a tuple with the IsBillingTag field value and a boolean to check if the value has been set.

func (*Tag) GetName

func (o *Tag) GetName() string

GetName returns the Name field value

func (*Tag) GetNameOk

func (o *Tag) GetNameOk() (*string, bool)

GetNameOk returns a tuple with the Name field value and a boolean to check if the value has been set.

func (*Tag) GetResourceAssignments

func (o *Tag) GetResourceAssignments() []ResourceAssignment

GetResourceAssignments returns the ResourceAssignments field value if set, zero value otherwise.

func (*Tag) GetResourceAssignmentsOk

func (o *Tag) GetResourceAssignmentsOk() ([]ResourceAssignment, bool)

GetResourceAssignmentsOk returns a tuple with the ResourceAssignments field value if set, nil otherwise and a boolean to check if the value has been set.

func (*Tag) GetValues

func (o *Tag) GetValues() []string

GetValues returns the Values field value if set, zero value otherwise.

func (*Tag) GetValuesOk

func (o *Tag) GetValuesOk() ([]string, bool)

GetValuesOk returns a tuple with the Values field value if set, nil otherwise and a boolean to check if the value has been set.

func (*Tag) HasCreatedBy

func (o *Tag) HasCreatedBy() bool

HasCreatedBy returns a boolean if a field has been set.

func (*Tag) HasDescription

func (o *Tag) HasDescription() bool

HasDescription returns a boolean if a field has been set.

func (*Tag) HasResourceAssignments

func (o *Tag) HasResourceAssignments() bool

HasResourceAssignments returns a boolean if a field has been set.

func (*Tag) HasValues

func (o *Tag) HasValues() bool

HasValues returns a boolean if a field has been set.

func (Tag) MarshalJSON

func (o Tag) MarshalJSON() ([]byte, error)

func (*Tag) SetCreatedBy

func (o *Tag) SetCreatedBy(v string)

SetCreatedBy gets a reference to the given string and assigns it to the CreatedBy field.

func (*Tag) SetDescription

func (o *Tag) SetDescription(v string)

SetDescription gets a reference to the given string and assigns it to the Description field.

func (*Tag) SetId

func (o *Tag) SetId(v string)

SetId sets field value

func (*Tag) SetIsBillingTag

func (o *Tag) SetIsBillingTag(v bool)

SetIsBillingTag sets field value

func (*Tag) SetName

func (o *Tag) SetName(v string)

SetName sets field value

func (*Tag) SetResourceAssignments

func (o *Tag) SetResourceAssignments(v []ResourceAssignment)

SetResourceAssignments gets a reference to the given []ResourceAssignment and assigns it to the ResourceAssignments field.

func (*Tag) SetValues

func (o *Tag) SetValues(v []string)

SetValues gets a reference to the given []string and assigns it to the Values field.

func (Tag) ToMap

func (o Tag) ToMap() (map[string]interface{}, error)

func (*Tag) UnmarshalJSON

func (o *Tag) UnmarshalJSON(data []byte) (err error)

type TagCreate

type TagCreate struct {
	// The unique name of the tag. Tag names are case-sensitive, and should be composed of a maximum of 100 characters including UTF-8 Unicode letters, numbers, and the following symbols: '-', '_'. Regex: [A-zÀ-ú0-9_-]{1,100}
	Name string `json:"name"`
	// The description of the tag.
	Description *string `json:"description,omitempty"`
	// Whether or not to show the tag as part of billing and invoices.
	IsBillingTag         bool `json:"isBillingTag"`
	AdditionalProperties map[string]interface{}
}

TagCreate Tag creation model.

func NewTagCreate

func NewTagCreate(name string, isBillingTag bool) *TagCreate

NewTagCreate instantiates a new TagCreate object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed

func NewTagCreateWithDefaults

func NewTagCreateWithDefaults() *TagCreate

NewTagCreateWithDefaults instantiates a new TagCreate object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*TagCreate) GetDescription

func (o *TagCreate) GetDescription() string

GetDescription returns the Description field value if set, zero value otherwise.

func (*TagCreate) GetDescriptionOk

func (o *TagCreate) GetDescriptionOk() (*string, bool)

GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise and a boolean to check if the value has been set.

func (*TagCreate) GetIsBillingTag

func (o *TagCreate) GetIsBillingTag() bool

GetIsBillingTag returns the IsBillingTag field value

func (*TagCreate) GetIsBillingTagOk

func (o *TagCreate) GetIsBillingTagOk() (*bool, bool)

GetIsBillingTagOk returns a tuple with the IsBillingTag field value and a boolean to check if the value has been set.

func (*TagCreate) GetName

func (o *TagCreate) GetName() string

GetName returns the Name field value

func (*TagCreate) GetNameOk

func (o *TagCreate) GetNameOk() (*string, bool)

GetNameOk returns a tuple with the Name field value and a boolean to check if the value has been set.

func (*TagCreate) HasDescription

func (o *TagCreate) HasDescription() bool

HasDescription returns a boolean if a field has been set.

func (TagCreate) MarshalJSON

func (o TagCreate) MarshalJSON() ([]byte, error)

func (*TagCreate) SetDescription

func (o *TagCreate) SetDescription(v string)

SetDescription gets a reference to the given string and assigns it to the Description field.

func (*TagCreate) SetIsBillingTag

func (o *TagCreate) SetIsBillingTag(v bool)

SetIsBillingTag sets field value

func (*TagCreate) SetName

func (o *TagCreate) SetName(v string)

SetName sets field value

func (TagCreate) ToMap

func (o TagCreate) ToMap() (map[string]interface{}, error)

func (*TagCreate) UnmarshalJSON

func (o *TagCreate) UnmarshalJSON(data []byte) (err error)

type TagUpdate

type TagUpdate struct {
	// The unique name of the tag. Tag names are case-sensitive, and should be composed of a maximum of 100 characters including UTF-8 Unicode letters, numbers, and the following symbols: '-', '_'. Regex: [A-zÀ-ú0-9_-]{1,100}
	Name string `json:"name"`
	// The description of the tag.
	Description *string `json:"description,omitempty"`
	// Whether or not to show the tag as part of billing and invoices.
	IsBillingTag         bool `json:"isBillingTag"`
	AdditionalProperties map[string]interface{}
}

TagUpdate Tag update model.

func NewTagUpdate

func NewTagUpdate(name string, isBillingTag bool) *TagUpdate

NewTagUpdate instantiates a new TagUpdate object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed

func NewTagUpdateWithDefaults

func NewTagUpdateWithDefaults() *TagUpdate

NewTagUpdateWithDefaults instantiates a new TagUpdate object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*TagUpdate) GetDescription

func (o *TagUpdate) GetDescription() string

GetDescription returns the Description field value if set, zero value otherwise.

func (*TagUpdate) GetDescriptionOk

func (o *TagUpdate) GetDescriptionOk() (*string, bool)

GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise and a boolean to check if the value has been set.

func (*TagUpdate) GetIsBillingTag

func (o *TagUpdate) GetIsBillingTag() bool

GetIsBillingTag returns the IsBillingTag field value

func (*TagUpdate) GetIsBillingTagOk

func (o *TagUpdate) GetIsBillingTagOk() (*bool, bool)

GetIsBillingTagOk returns a tuple with the IsBillingTag field value and a boolean to check if the value has been set.

func (*TagUpdate) GetName

func (o *TagUpdate) GetName() string

GetName returns the Name field value

func (*TagUpdate) GetNameOk

func (o *TagUpdate) GetNameOk() (*string, bool)

GetNameOk returns a tuple with the Name field value and a boolean to check if the value has been set.

func (*TagUpdate) HasDescription

func (o *TagUpdate) HasDescription() bool

HasDescription returns a boolean if a field has been set.

func (TagUpdate) MarshalJSON

func (o TagUpdate) MarshalJSON() ([]byte, error)

func (*TagUpdate) SetDescription

func (o *TagUpdate) SetDescription(v string)

SetDescription gets a reference to the given string and assigns it to the Description field.

func (*TagUpdate) SetIsBillingTag

func (o *TagUpdate) SetIsBillingTag(v bool)

SetIsBillingTag sets field value

func (*TagUpdate) SetName

func (o *TagUpdate) SetName(v string)

SetName sets field value

func (TagUpdate) ToMap

func (o TagUpdate) ToMap() (map[string]interface{}, error)

func (*TagUpdate) UnmarshalJSON

func (o *TagUpdate) UnmarshalJSON(data []byte) (err error)

type TagsAPI

type TagsAPI interface {

	/*
		TagsGet List tags.

		Retrieve all tags belonging to the BMC Account.

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

	// TagsGetExecute executes the request
	//  @return []Tag
	TagsGetExecute(r ApiTagsGetRequest) ([]Tag, *http.Response, error)

	/*
		TagsPost Create a Tag.

		Create a tag with the provided information.

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

	// TagsPostExecute executes the request
	//  @return Tag
	TagsPostExecute(r ApiTagsPostRequest) (*Tag, *http.Response, error)

	/*
		TagsTagIdDelete Delete a Tag.

		Delete the tag with the given ID.

		@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
		@param tagId The tag's ID.
		@return ApiTagsTagIdDeleteRequest
	*/
	TagsTagIdDelete(ctx context.Context, tagId string) ApiTagsTagIdDeleteRequest

	// TagsTagIdDeleteExecute executes the request
	//  @return DeleteResult
	TagsTagIdDeleteExecute(r ApiTagsTagIdDeleteRequest) (*DeleteResult, *http.Response, error)

	/*
		TagsTagIdGet Get a Tag.

		Retrieve the tag with the given ID

		@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
		@param tagId The tag's ID.
		@return ApiTagsTagIdGetRequest
	*/
	TagsTagIdGet(ctx context.Context, tagId string) ApiTagsTagIdGetRequest

	// TagsTagIdGetExecute executes the request
	//  @return Tag
	TagsTagIdGetExecute(r ApiTagsTagIdGetRequest) (*Tag, *http.Response, error)

	/*
		TagsTagIdPatch Modify a Tag.

		Updates the tag with the given ID.

		@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
		@param tagId The tag's ID.
		@return ApiTagsTagIdPatchRequest
	*/
	TagsTagIdPatch(ctx context.Context, tagId string) ApiTagsTagIdPatchRequest

	// TagsTagIdPatchExecute executes the request
	//  @return Tag
	TagsTagIdPatchExecute(r ApiTagsTagIdPatchRequest) (*Tag, *http.Response, error)
}

type TagsAPIService

type TagsAPIService service

TagsAPIService TagsAPI service

func (*TagsAPIService) TagsGet

TagsGet List tags.

Retrieve all tags belonging to the BMC Account.

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

func (*TagsAPIService) TagsGetExecute

func (a *TagsAPIService) TagsGetExecute(r ApiTagsGetRequest) ([]Tag, *http.Response, error)

Execute executes the request

@return []Tag

func (*TagsAPIService) TagsPost

TagsPost Create a Tag.

Create a tag with the provided information.

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

func (*TagsAPIService) TagsPostExecute

func (a *TagsAPIService) TagsPostExecute(r ApiTagsPostRequest) (*Tag, *http.Response, error)

Execute executes the request

@return Tag

func (*TagsAPIService) TagsTagIdDelete

func (a *TagsAPIService) TagsTagIdDelete(ctx context.Context, tagId string) ApiTagsTagIdDeleteRequest

TagsTagIdDelete Delete a Tag.

Delete the tag with the given ID.

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param tagId The tag's ID.
@return ApiTagsTagIdDeleteRequest

func (*TagsAPIService) TagsTagIdDeleteExecute

func (a *TagsAPIService) TagsTagIdDeleteExecute(r ApiTagsTagIdDeleteRequest) (*DeleteResult, *http.Response, error)

Execute executes the request

@return DeleteResult

func (*TagsAPIService) TagsTagIdGet

func (a *TagsAPIService) TagsTagIdGet(ctx context.Context, tagId string) ApiTagsTagIdGetRequest

TagsTagIdGet Get a Tag.

Retrieve the tag with the given ID

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param tagId The tag's ID.
@return ApiTagsTagIdGetRequest

func (*TagsAPIService) TagsTagIdGetExecute

func (a *TagsAPIService) TagsTagIdGetExecute(r ApiTagsTagIdGetRequest) (*Tag, *http.Response, error)

Execute executes the request

@return Tag

func (*TagsAPIService) TagsTagIdPatch

func (a *TagsAPIService) TagsTagIdPatch(ctx context.Context, tagId string) ApiTagsTagIdPatchRequest

TagsTagIdPatch Modify a Tag.

Updates the tag with the given ID.

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param tagId The tag's ID.
@return ApiTagsTagIdPatchRequest

func (*TagsAPIService) TagsTagIdPatchExecute

func (a *TagsAPIService) TagsTagIdPatchExecute(r ApiTagsTagIdPatchRequest) (*Tag, *http.Response, error)

Execute executes the request

@return Tag

Jump to

Keyboard shortcuts

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