datarepository

package
v0.0.0-...-444540b Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKeys takes a string apikey as authentication for the request
	ContextAPIKeys = contextKey("apiKeys")

	// ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
	ContextHttpSignatureAuth = contextKey("httpsignature")

	// 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.

Types

type APIClient

type APIClient struct {
	AdminApi *AdminApiService

	BandwidthApi *BandwidthApiService

	LocationApi *LocationApiService

	SubscriberApi *SubscriberApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Network as Code API v2 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 AdminApiService

type AdminApiService service

AdminApiService AdminApi service

func (*AdminApiService) CreateTestUser

CreateTestUser Create a new test user

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

func (*AdminApiService) CreateTestUserExecute

Execute executes the request

@return SubscriberDetails

func (*AdminApiService) DeleteTestuser

DeleteTestuser Delete an existing test user

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

func (*AdminApiService) DeleteTestuserExecute

func (a *AdminApiService) DeleteTestuserExecute(r ApiDeleteTestuserRequest) (*_nethttp.Response, error)

Execute executes the request

func (*AdminApiService) GetApiStatus

GetApiStatus Is API accessible

Used to determine if the API is currently accessible

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

func (*AdminApiService) GetApiStatusExecute

Execute executes the request

@return HelloResponses

type ApiCreateTestUserRequest

type ApiCreateTestUserRequest struct {
	ApiService *AdminApiService
	// contains filtered or unexported fields
}

func (ApiCreateTestUserRequest) Execute

func (ApiCreateTestUserRequest) SubscriberDetails

func (r ApiCreateTestUserRequest) SubscriberDetails(subscriberDetails clientmodel.SubscriberDetails) ApiCreateTestUserRequest

Add a new test user

func (ApiCreateTestUserRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type ApiDeleteTestuserRequest

type ApiDeleteTestuserRequest struct {
	ApiService *AdminApiService
	// contains filtered or unexported fields
}

func (ApiDeleteTestuserRequest) Execute

func (ApiDeleteTestuserRequest) SubscriberId

External ID of the subscriber

func (ApiDeleteTestuserRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type ApiGetApiStatusRequest

type ApiGetApiStatusRequest struct {
	ApiService *AdminApiService
	// contains filtered or unexported fields
}

func (ApiGetApiStatusRequest) Execute

type ApiGetCustomBandwidthRequest

type ApiGetCustomBandwidthRequest struct {
	ApiService *BandwidthApiService
	// contains filtered or unexported fields
}

func (ApiGetCustomBandwidthRequest) Execute

func (ApiGetCustomBandwidthRequest) SubscriberId

External ID of the subscriber

func (ApiGetCustomBandwidthRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type ApiGetSubscriberBandwidthRequest

type ApiGetSubscriberBandwidthRequest struct {
	ApiService *BandwidthApiService
	// contains filtered or unexported fields
}

func (ApiGetSubscriberBandwidthRequest) Execute

func (ApiGetSubscriberBandwidthRequest) SubscriberId

External ID of the subscriber

func (ApiGetSubscriberBandwidthRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type ApiGetSubscriberLocationRequest

type ApiGetSubscriberLocationRequest struct {
	ApiService *LocationApiService
	// contains filtered or unexported fields
}

func (ApiGetSubscriberLocationRequest) Execute

func (ApiGetSubscriberLocationRequest) SubscriberId

External ID of the subscriber

func (ApiGetSubscriberLocationRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type ApiGetSubscriberRequest

type ApiGetSubscriberRequest struct {
	ApiService *SubscriberApiService
	// contains filtered or unexported fields
}

func (ApiGetSubscriberRequest) Execute

func (ApiGetSubscriberRequest) SubscriberId

External ID of the subscriber

func (ApiGetSubscriberRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type ApiUpdateCustomBandwidthRequest

type ApiUpdateCustomBandwidthRequest struct {
	ApiService *BandwidthApiService
	// contains filtered or unexported fields
}

func (ApiUpdateCustomBandwidthRequest) CustomLimits

New upload/download limits for the subscriber

func (ApiUpdateCustomBandwidthRequest) Execute

func (ApiUpdateCustomBandwidthRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type ApiUpdateSubscriberBandwidthRequest

type ApiUpdateSubscriberBandwidthRequest struct {
	ApiService *BandwidthApiService
	// contains filtered or unexported fields
}

func (ApiUpdateSubscriberBandwidthRequest) BandwidthUpdate

New bandwidth for subscriber

func (ApiUpdateSubscriberBandwidthRequest) Execute

func (ApiUpdateSubscriberBandwidthRequest) XTestmode

Enables test mode when set to \"true\". Assumes \"false\" if not present.

type BandwidthApiService

type BandwidthApiService service

BandwidthApiService BandwidthApi service

func (*BandwidthApiService) GetCustomBandwidth

GetCustomBandwidth Get upload/download limit

Get the current upload/download bandwidth limits for the subscriber identified by the given ID

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

func (*BandwidthApiService) GetCustomBandwidthExecute

Execute executes the request

@return CustomLimits

func (*BandwidthApiService) GetSubscriberBandwidth

GetSubscriberBandwidth Get the current subscriber bandwidth

Get the bandwidth identifier for the subscriber identified by the given IMSI

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

func (*BandwidthApiService) GetSubscriberBandwidthExecute

Execute executes the request

@return BandwidthResponse

func (*BandwidthApiService) UpdateCustomBandwidth

UpdateCustomBandwidth Set upload limit

Set the upload/download bandwidth limits for the subscriber identified by the given ID

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

func (*BandwidthApiService) UpdateCustomBandwidthExecute

Execute executes the request

@return CustomLimits

func (*BandwidthApiService) UpdateSubscriberBandwidth

func (a *BandwidthApiService) UpdateSubscriberBandwidth(ctx _context.Context) ApiUpdateSubscriberBandwidthRequest

UpdateSubscriberBandwidth Update the bandwidth of the subscriber

Update the bandwidth identifier for the subscriber identified by the given IMSI

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

func (*BandwidthApiService) UpdateSubscriberBandwidthExecute

Execute executes the request

@return BandwidthResponse

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"`
	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 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 LocationApiService

type LocationApiService service

LocationApiService LocationApi service

func (*LocationApiService) GetSubscriberLocation

GetSubscriberLocation Get last reported location

Get the last reported location of the subscriber identified by the given ID

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

func (*LocationApiService) GetSubscriberLocationExecute

Execute executes the request

@return LocationResponse

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 SubscriberApiService

type SubscriberApiService service

SubscriberApiService SubscriberApi service

func (*SubscriberApiService) CreateTestUserExecute

Execute executes the request

@return SubscriberDetails

func (*SubscriberApiService) DeleteTestuserExecute

func (a *SubscriberApiService) DeleteTestuserExecute(r ApiDeleteTestuserRequest) (*_nethttp.Response, error)

Execute executes the request

func (*SubscriberApiService) GetCustomBandwidthExecute

Execute executes the request

@return CustomLimits

func (*SubscriberApiService) GetSubscriber

GetSubscriber Get the subscriber SUPI/IMSI and MSISDN

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

func (*SubscriberApiService) GetSubscriberBandwidthExecute

Execute executes the request

@return BandwidthResponse

func (*SubscriberApiService) GetSubscriberExecute

Execute executes the request

@return SubscriberDetails

func (*SubscriberApiService) GetSubscriberLocationExecute

Execute executes the request

@return LocationResponse

func (*SubscriberApiService) UpdateCustomBandwidthExecute

Execute executes the request

@return CustomLimits

func (*SubscriberApiService) UpdateSubscriberBandwidthExecute

Execute executes the request

@return BandwidthResponse

Jump to

Keyboard shortcuts

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