dto

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MPL-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	ClientID     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
	TokenURL     string `json:"tokenUrl"`
	ApiHostName  string `json:"apiHostName"`
	PoweredBy    string `json:"poweredBy"`
	UserAgent    string `json:"userAgent"`
	BearerToken  string `json:"bearerToken"`
}

Configuration represents struct that serves to initialize receiver

type ErrorMessage

type ErrorMessage struct {
	Message          string   `json:"message"`
	ValidationErrors []string `json:"validationErrors"`
}

ErrorMessage represents API response error messages.

func (*ErrorMessage) FromBytes

func (dto *ErrorMessage) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type ErrorResolver added in v0.1.2

type ErrorResolver struct {
	Error error
}

ErrorResolver represents instance that handles processing of errors and creates error messages.

func NewErrorResolver added in v0.1.2

func NewErrorResolver(httpResponse *http.Response, err error) *ErrorResolver

NewErrorResolver constructs new instance of ErrorResolver struct

type LocationAvailabilityDetail added in v0.3.3

type LocationAvailabilityDetail struct {
	Location             string   `json:"location"`
	MinQuantityRequested int32    `json:"minQuantityRequested"`
	MinQuantityAvailable bool     `json:"minQuantityAvailable"`
	AvailableQuantity    int32    `json:"availableQuantity"`
	Solutions            []string `json:"solutions"`
}

LocationAvailabilityDetail represents info about location, solutions and availability for a product

func (*LocationAvailabilityDetail) FromBytes added in v0.3.3

func (dto *LocationAvailabilityDetail) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type PricingPlan added in v0.3.3

type PricingPlan struct {
	SKU                   string  `json:"sku"`
	SKUDescription        string  `json:"skuDescription,omitempty"`
	Location              string  `json:"location"`
	PricingModel          string  `json:"pricingModel"`
	Price                 float32 `json:"price"`
	PriceUnit             string  `json:"priceUnit"`
	CorrelatedProductCode string  `json:"correlatedProductCode,omitempty"`
	PackageQuantity       int32   `json:"packageQuantity,omitempty"`
	PackageUnit           string  `json:"packageUnit,omitempty"`
}

PricingPlan represents pricing plan details

func (*PricingPlan) FromBytes added in v0.3.3

func (dto *PricingPlan) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type Product added in v0.3.3

type Product struct {
	ProductCode     string                 `json:"productCode"`
	ProductCategory string                 `json:"productCategory"`
	Plans           []PricingPlan          `json:"plans,omitempty"`
	Metadata        *ServerProductMetadata `json:"metadata,omitempty"`
}

Product represents product details

func (*Product) FromBytes added in v0.3.3

func (dto *Product) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type ProductAvailabilities added in v0.3.3

type ProductAvailabilities []ProductAvailability

ProductAvailabilities represents list of product availabilities

func (*ProductAvailabilities) FromBytes added in v0.3.3

func (dto *ProductAvailabilities) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type ProductAvailability added in v0.3.3

type ProductAvailability struct {
	ProductCode                 string                       `json:"productCode"`
	ProductCategory             string                       `json:"productCategory"`
	LocationAvailabilityDetails []LocationAvailabilityDetail `json:"locationAvailabilityDetails,omitempty"`
}

ProductAvailability represents product availability details

func (*ProductAvailability) FromBytes added in v0.3.3

func (dto *ProductAvailability) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type ProductAvailabilityQuery added in v0.3.3

type ProductAvailabilityQuery struct {
	ProductCategory              []string `json:"productCategory,omitempty"`
	ProductCode                  []string `json:"productCode,omitempty"`
	ShowOnlyMinQuantityAvailable bool     `json:"showOnlyMinQuantityAvailable,omitempty"`
	Location                     []string `json:"location,omitempty"`
	Solution                     []string `json:"solution,omitempty"`
	MinQuantity                  float32  `json:"minQuantity,omitempty"`
}

ProductAvailabilityQuery represents query parameters for product availabilities retrieval

func (ProductAvailabilityQuery) ToBytes added in v0.3.3

func (dto ProductAvailabilityQuery) ToBytes() (io.Reader, error)

ToBytes performs conversion of struct to the io.Reader

type ProductQuery added in v0.3.3

type ProductQuery struct {
	ProductCode     string `json:"productCode,omitempty"`
	ProductCategory string `json:"productCategory,omitempty"`
	SKUCode         string `json:"skucode,omitempty"`
	Location        string `json:"location,omitempty"`
}

ProductQuery represents query parameters for products retrieval

func (ProductQuery) ToBytes added in v0.3.3

func (dto ProductQuery) ToBytes() (io.Reader, error)

ToBytes performs conversion of struct to the io.Reader

type Products added in v0.3.3

type Products []Product

Products represents list of products

func (*Products) FromBytes added in v0.3.3

func (dto *Products) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type Query added in v0.11.0

type Query struct {
	Force           bool                                  `json:"force"`
	Location        locationapiclient.LocationEnum        `json:"location"`
	ProductCategory locationapiclient.ProductCategoryEnum `json:"productCategory"`
	Number          string                                `json:"number"`
	Status          string                                `json:"status"`
	SentOnFrom      time.Time                             `json:"sentOnFrom"`
	SentOnTo        time.Time                             `json:"sentOnTo"`
	Limit           int32                                 `json:"limit,omitempty"`
	Offset          int32                                 `json:"offset"`
	SortField       string                                `json:"sortField"`
	SortDirection   string                                `json:"sortDirection"`
	From            time.Time                             `json:"from"`
	To              time.Time                             `json:"to"`
	Order           string                                `json:"order"`
	Username        string                                `json:"username"`
	Verb            string                                `json:"verb"`
	Uri             string                                `json:"uri"`
}

Query represents query parameters used in various API calls

func (Query) ToBytes added in v0.11.0

func (dto Query) ToBytes() (io.Reader, error)

ToBytes performs conversion of struct to the io.Reader

type Reservation added in v0.1.2

type Reservation struct {
	ID                  string    `json:"id"`
	ProductCode         string    `json:"productCode"`
	ProductCategory     string    `json:"productCategory"`
	Location            string    `json:"location"`
	ReservationModel    string    `json:"reservationModel"`
	InitialInvoiceModel string    `json:"initialInvoiceModel,omitempty"`
	StartDateTime       time.Time `json:"startDateTime"`
	EndDateTime         time.Time `json:"endDateTime,omitempty"`
	LastRenewalDateTime time.Time `json:"lastRenewalDateTime,omitempty"`
	NextRenewalDateTime time.Time `json:"nextRenewalDateTime,omitempty"`
	AutoRenew           bool      `json:"autoRenew"`
	SKU                 string    `json:"sku"`
	Price               float32   `json:"price"`
	PriceUnit           string    `json:"priceUnit"`
	AssignedResourceID  string    `json:"assignedResourceId,omitempty"`
}

Reservation

func (*Reservation) FromBytes added in v0.1.2

func (dto *Reservation) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type ReservationAutoRenewDisableRequest added in v0.1.2

type ReservationAutoRenewDisableRequest struct {
	AutoRenewDisableReason *string `json:"autoRenewDisableReason,omitempty"`
}

Reservation auto-renewal disabling request reason

func (ReservationAutoRenewDisableRequest) ToBytes added in v0.1.2

ToBytes performs conversion of struct to the io.Reader

type ReservationRequest added in v0.1.2

type ReservationRequest struct {
	SKU string `json:"sku"`
}

Reservation request

func (*ReservationRequest) FromBytes added in v0.1.2

func (dto *ReservationRequest) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

func (ReservationRequest) ToBytes added in v0.1.2

func (dto ReservationRequest) ToBytes() (io.Reader, error)

ToBytes performs conversion of struct to the io.Reader

type Reservations added in v0.1.2

type Reservations []Reservation

Reservations represents list of reservations

func (*Reservations) FromBytes added in v0.1.2

func (dto *Reservations) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

type ServerProductMetadata added in v0.3.3

type ServerProductMetadata struct {
	RamInGb      int32   `json:"ramInGb"`
	CPU          string  `json:"cpu"`
	CPUCount     int32   `json:"cpuCount"`
	CoresPerCPU  int32   `json:"coresPerCpu"`
	CPUFrequency float32 `json:"cpuFrequency"`
	Network      string  `json:"network"`
	Storage      string  `json:"storage"`
}

ServerProductMetadata represents details of the server product

func (*ServerProductMetadata) FromBytes added in v0.3.3

func (dto *ServerProductMetadata) FromBytes(resp *http.Response) error

FromBytes performs conversion of http response to the representing struct

Jump to

Keyboard shortcuts

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