Documentation ¶
Overview ¶
Package partnerusagereportsv1 : Operations and models for the PartnerUsageReportsV1 service
Index ¶
- Constants
- func GetServiceURLForRegion(region string) (string, error)
- func UnmarshalMetricUsage(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalPartnerUsageReport(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalPartnerUsageReportSummary(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalPartnerUsageReportSummaryFirst(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalPartnerUsageReportSummaryNext(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalPlanUsage(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalResourceUsage(m map[string]json.RawMessage, result interface{}) (err error)
- type GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetChildren(children bool) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetCustomerID(customerID string) *GetResourceUsageReportOptions
- func (options *GetResourceUsageReportOptions) SetHeaders(param map[string]string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetLimit(limit int64) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetMonth(month string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetOffset(offset string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetPartnerID(partnerID string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetRecurse(recurse bool) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetResellerID(resellerID string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetViewpoint(viewpoint string) *GetResourceUsageReportOptions
- type GetResourceUsageReportPager
- func (pager *GetResourceUsageReportPager) GetAll() (allItems []PartnerUsageReport, err error)
- func (pager *GetResourceUsageReportPager) GetAllWithContext(ctx context.Context) (allItems []PartnerUsageReport, err error)
- func (pager *GetResourceUsageReportPager) GetNext() (page []PartnerUsageReport, err error)
- func (pager *GetResourceUsageReportPager) GetNextWithContext(ctx context.Context) (page []PartnerUsageReport, err error)
- func (pager *GetResourceUsageReportPager) HasNext() bool
- type MetricUsage
- type PartnerUsageReport
- type PartnerUsageReportSummary
- type PartnerUsageReportSummaryFirst
- type PartnerUsageReportSummaryNext
- type PartnerUsageReportsV1
- func (partnerUsageReports *PartnerUsageReportsV1) Clone() *PartnerUsageReportsV1
- func (partnerUsageReports *PartnerUsageReportsV1) DisableRetries()
- func (partnerUsageReports *PartnerUsageReportsV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
- func (partnerUsageReports *PartnerUsageReportsV1) GetEnableGzipCompression() bool
- func (partnerUsageReports *PartnerUsageReportsV1) GetResourceUsageReport(getResourceUsageReportOptions *GetResourceUsageReportOptions) (result *PartnerUsageReportSummary, response *core.DetailedResponse, err error)
- func (partnerUsageReports *PartnerUsageReportsV1) GetResourceUsageReportWithContext(ctx context.Context, ...) (result *PartnerUsageReportSummary, response *core.DetailedResponse, err error)
- func (partnerUsageReports *PartnerUsageReportsV1) GetServiceURL() string
- func (*PartnerUsageReportsV1) NewGetResourceUsageReportOptions(partnerID string) *GetResourceUsageReportOptions
- func (partnerUsageReports *PartnerUsageReportsV1) NewGetResourceUsageReportPager(options *GetResourceUsageReportOptions) (pager *GetResourceUsageReportPager, err error)
- func (partnerUsageReports *PartnerUsageReportsV1) SetDefaultHeaders(headers http.Header)
- func (partnerUsageReports *PartnerUsageReportsV1) SetEnableGzipCompression(enableGzip bool)
- func (partnerUsageReports *PartnerUsageReportsV1) SetServiceURL(url string) error
- type PartnerUsageReportsV1Options
- type PlanUsage
- type ResourceUsage
Constants ¶
const ( GetResourceUsageReportOptionsViewpointDistributorConst = "DISTRIBUTOR" GetResourceUsageReportOptionsViewpointEndCustomerConst = "END_CUSTOMER" GetResourceUsageReportOptionsViewpointResellerConst = "RESELLER" )
Constants associated with the GetResourceUsageReportOptions.Viewpoint property. Enables partner to view the cost of provisioned services as applicable at each level of the hierarchy. Defaults to the type of the calling partner. The valid values are `DISTRIBUTOR`, `RESELLER` and `END_CUSTOMER`.
const DefaultServiceName = "partner_usage_reports"
DefaultServiceName is the default key used to find external configuration information.
const DefaultServiceURL = "https://partner.cloud.ibm.com"
DefaultServiceURL is the default URL to make service requests to.
Variables ¶
This section is empty.
Functions ¶
func GetServiceURLForRegion ¶
GetServiceURLForRegion returns the service URL to be used for the specified region
func UnmarshalMetricUsage ¶
func UnmarshalMetricUsage(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalMetricUsage unmarshals an instance of MetricUsage from the specified map of raw messages.
func UnmarshalPartnerUsageReport ¶
func UnmarshalPartnerUsageReport(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalPartnerUsageReport unmarshals an instance of PartnerUsageReport from the specified map of raw messages.
func UnmarshalPartnerUsageReportSummary ¶
func UnmarshalPartnerUsageReportSummary(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalPartnerUsageReportSummary unmarshals an instance of PartnerUsageReportSummary from the specified map of raw messages.
func UnmarshalPartnerUsageReportSummaryFirst ¶
func UnmarshalPartnerUsageReportSummaryFirst(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalPartnerUsageReportSummaryFirst unmarshals an instance of PartnerUsageReportSummaryFirst from the specified map of raw messages.
func UnmarshalPartnerUsageReportSummaryNext ¶
func UnmarshalPartnerUsageReportSummaryNext(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalPartnerUsageReportSummaryNext unmarshals an instance of PartnerUsageReportSummaryNext from the specified map of raw messages.
func UnmarshalPlanUsage ¶
func UnmarshalPlanUsage(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalPlanUsage unmarshals an instance of PlanUsage from the specified map of raw messages.
func UnmarshalResourceUsage ¶
func UnmarshalResourceUsage(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalResourceUsage unmarshals an instance of ResourceUsage from the specified map of raw messages.
Types ¶
type GetResourceUsageReportOptions ¶
type GetResourceUsageReportOptions struct { // Enterprise ID of the distributor or reseller for which the report is requested. PartnerID *string `json:"partner_id" validate:"required"` // Enterprise ID of the reseller for which the report is requested. This parameter cannot be used along with // `customer_id` query parameter. ResellerID *string `json:"reseller_id,omitempty"` // Enterprise ID of the child customer for which the report is requested. This parameter cannot be used along with // `reseller_id` query parameter. CustomerID *string `json:"customer_id,omitempty"` // Get report rolled-up to the direct children of the requested entity. Defaults to false. This parameter cannot be // used along with `customer_id` query parameter. Children *bool `json:"children,omitempty"` // The billing month for which the usage report is requested. Format is `yyyy-mm`. Defaults to current month. Month *string `json:"month,omitempty"` // Enables partner to view the cost of provisioned services as applicable at each level of the hierarchy. Defaults to // the type of the calling partner. The valid values are `DISTRIBUTOR`, `RESELLER` and `END_CUSTOMER`. Viewpoint *string `json:"viewpoint,omitempty"` // Get usage report rolled-up to the end customers of the requested entity. Defaults to false. This parameter cannot be // used along with `reseller_id` query parameter or `customer_id` query parameter. Recurse *bool `json:"recurse,omitempty"` // Number of usage records to be returned. The default value is 30. Maximum value is 200. Limit *int64 `json:"limit,omitempty"` // An opaque value representing the offset of the first item to be returned by a search query. If not specified, then // the first page of results is returned. To retrieve the next page of search results, use the 'offset' query parameter // value within the 'next.href' URL found within a prior search query response. Offset *string `json:"offset,omitempty"` // Allows users to set headers on API requests Headers map[string]string }
GetResourceUsageReportOptions : The GetResourceUsageReport options.
func (*GetResourceUsageReportOptions) SetChildren ¶
func (_options *GetResourceUsageReportOptions) SetChildren(children bool) *GetResourceUsageReportOptions
SetChildren : Allow user to set Children
func (*GetResourceUsageReportOptions) SetCustomerID ¶
func (_options *GetResourceUsageReportOptions) SetCustomerID(customerID string) *GetResourceUsageReportOptions
SetCustomerID : Allow user to set CustomerID
func (*GetResourceUsageReportOptions) SetHeaders ¶
func (options *GetResourceUsageReportOptions) SetHeaders(param map[string]string) *GetResourceUsageReportOptions
SetHeaders : Allow user to set Headers
func (*GetResourceUsageReportOptions) SetLimit ¶
func (_options *GetResourceUsageReportOptions) SetLimit(limit int64) *GetResourceUsageReportOptions
SetLimit : Allow user to set Limit
func (*GetResourceUsageReportOptions) SetMonth ¶
func (_options *GetResourceUsageReportOptions) SetMonth(month string) *GetResourceUsageReportOptions
SetMonth : Allow user to set Month
func (*GetResourceUsageReportOptions) SetOffset ¶
func (_options *GetResourceUsageReportOptions) SetOffset(offset string) *GetResourceUsageReportOptions
SetOffset : Allow user to set Offset
func (*GetResourceUsageReportOptions) SetPartnerID ¶
func (_options *GetResourceUsageReportOptions) SetPartnerID(partnerID string) *GetResourceUsageReportOptions
SetPartnerID : Allow user to set PartnerID
func (*GetResourceUsageReportOptions) SetRecurse ¶
func (_options *GetResourceUsageReportOptions) SetRecurse(recurse bool) *GetResourceUsageReportOptions
SetRecurse : Allow user to set Recurse
func (*GetResourceUsageReportOptions) SetResellerID ¶
func (_options *GetResourceUsageReportOptions) SetResellerID(resellerID string) *GetResourceUsageReportOptions
SetResellerID : Allow user to set ResellerID
func (*GetResourceUsageReportOptions) SetViewpoint ¶
func (_options *GetResourceUsageReportOptions) SetViewpoint(viewpoint string) *GetResourceUsageReportOptions
SetViewpoint : Allow user to set Viewpoint
type GetResourceUsageReportPager ¶
type GetResourceUsageReportPager struct {
// contains filtered or unexported fields
}
GetResourceUsageReportPager can be used to simplify the use of the "GetResourceUsageReport" method.
func (*GetResourceUsageReportPager) GetAll ¶
func (pager *GetResourceUsageReportPager) GetAll() (allItems []PartnerUsageReport, err error)
GetAll invokes GetAllWithContext() using context.Background() as the Context parameter.
func (*GetResourceUsageReportPager) GetAllWithContext ¶
func (pager *GetResourceUsageReportPager) GetAllWithContext(ctx context.Context) (allItems []PartnerUsageReport, err error)
GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly until all pages of results have been retrieved.
func (*GetResourceUsageReportPager) GetNext ¶
func (pager *GetResourceUsageReportPager) GetNext() (page []PartnerUsageReport, err error)
GetNext invokes GetNextWithContext() using context.Background() as the Context parameter.
func (*GetResourceUsageReportPager) GetNextWithContext ¶
func (pager *GetResourceUsageReportPager) GetNextWithContext(ctx context.Context) (page []PartnerUsageReport, err error)
GetNextWithContext returns the next page of results using the specified Context.
func (*GetResourceUsageReportPager) HasNext ¶
func (pager *GetResourceUsageReportPager) HasNext() bool
HasNext returns true if there are potentially more results to be retrieved.
type MetricUsage ¶
type MetricUsage struct { // The name of the metric. Metric *string `json:"metric" validate:"required"` // A unit to qualify the quantity. Unit *string `json:"unit" validate:"required"` // The aggregated value for the metric. Quantity *float64 `json:"quantity" validate:"required"` // The quantity that is used for calculating charges. RateableQuantity *float64 `json:"rateable_quantity" validate:"required"` // The cost that was incurred by the metric. Cost *float64 `json:"cost" validate:"required"` // The pre-discounted cost that was incurred by the metric. RatedCost *float64 `json:"rated_cost" validate:"required"` // The price with which cost was calculated. Price []map[string]interface{} `json:"price,omitempty"` }
MetricUsage : An object that represents a metric.
type PartnerUsageReport ¶
type PartnerUsageReport struct { // The ID of the entity. EntityID *string `json:"entity_id,omitempty"` // The entity type. EntityType *string `json:"entity_type,omitempty"` // The Cloud Resource Name (CRN) of the entity towards which the resource usages were rolled up. EntityCRN *string `json:"entity_crn,omitempty"` // A user-defined name for the entity, such as the enterprise name or account group name. EntityName *string `json:"entity_name,omitempty"` // Role of the `entity_id` for which the usage report is fetched. EntityPartnerType *string `json:"entity_partner_type,omitempty"` // Enables partner to view the cost of provisioned services as applicable at each level of the hierarchy. Viewpoint *string `json:"viewpoint,omitempty"` // The billing month for which the usage report is requested. Format is yyyy-mm. Month *string `json:"month,omitempty"` // The currency code of the billing unit. CurrencyCode *string `json:"currency_code,omitempty"` // The country code of the billing unit. CountryCode *string `json:"country_code,omitempty"` // Billable charges that are aggregated from all entities in the report. BillableCost *float64 `json:"billable_cost,omitempty"` // Aggregated billable charges before discounts. BillableRatedCost *float64 `json:"billable_rated_cost,omitempty"` // Non-billable charges that are aggregated from all entities in the report. NonBillableCost *float64 `json:"non_billable_cost,omitempty"` // Aggregated non-billable charges before discounts. NonBillableRatedCost *float64 `json:"non_billable_rated_cost,omitempty"` Resources []ResourceUsage `json:"resources,omitempty"` }
PartnerUsageReport : Aggregated usage report of a partner.
type PartnerUsageReportSummary ¶
type PartnerUsageReportSummary struct { // The maximum number of usage records in the response. Limit *int64 `json:"limit,omitempty"` // The link to the first page of the search query. First *PartnerUsageReportSummaryFirst `json:"first,omitempty"` // The link to the next page of the search query. Next *PartnerUsageReportSummaryNext `json:"next,omitempty"` // Aggregated usage report of all requested partners. Reports []PartnerUsageReport `json:"reports,omitempty"` }
PartnerUsageReportSummary : The aggregated partner usage report.
func (*PartnerUsageReportSummary) GetNextOffset ¶
func (resp *PartnerUsageReportSummary) GetNextOffset() (*string, error)
Retrieve the value to be passed to a request to access the next page of results
type PartnerUsageReportSummaryFirst ¶
type PartnerUsageReportSummaryFirst struct { // A link to a page of query results. Href *string `json:"href,omitempty"` }
PartnerUsageReportSummaryFirst : The link to the first page of the search query.
type PartnerUsageReportSummaryNext ¶
type PartnerUsageReportSummaryNext struct { // A link to a page of query results. Href *string `json:"href,omitempty"` // The value of the `_start` query parameter to fetch the next page. Offset *string `json:"offset,omitempty"` }
PartnerUsageReportSummaryNext : The link to the next page of the search query.
type PartnerUsageReportsV1 ¶
type PartnerUsageReportsV1 struct {
Service *core.BaseService
}
PartnerUsageReportsV1 : Usage reports for IBM Cloud partner entities
API Version: 1.0.0
func NewPartnerUsageReportsV1 ¶
func NewPartnerUsageReportsV1(options *PartnerUsageReportsV1Options) (service *PartnerUsageReportsV1, err error)
NewPartnerUsageReportsV1 : constructs an instance of PartnerUsageReportsV1 with passed in options.
func NewPartnerUsageReportsV1UsingExternalConfig ¶
func NewPartnerUsageReportsV1UsingExternalConfig(options *PartnerUsageReportsV1Options) (partnerUsageReports *PartnerUsageReportsV1, err error)
NewPartnerUsageReportsV1UsingExternalConfig : constructs an instance of PartnerUsageReportsV1 with passed in options and external configuration.
func (*PartnerUsageReportsV1) Clone ¶
func (partnerUsageReports *PartnerUsageReportsV1) Clone() *PartnerUsageReportsV1
Clone makes a copy of "partnerUsageReports" suitable for processing requests.
func (*PartnerUsageReportsV1) DisableRetries ¶
func (partnerUsageReports *PartnerUsageReportsV1) DisableRetries()
DisableRetries disables automatic retries for requests invoked for this service instance.
func (*PartnerUsageReportsV1) EnableRetries ¶
func (partnerUsageReports *PartnerUsageReportsV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.
func (*PartnerUsageReportsV1) GetEnableGzipCompression ¶
func (partnerUsageReports *PartnerUsageReportsV1) GetEnableGzipCompression() bool
GetEnableGzipCompression returns the service's EnableGzipCompression field
func (*PartnerUsageReportsV1) GetResourceUsageReport ¶
func (partnerUsageReports *PartnerUsageReportsV1) GetResourceUsageReport(getResourceUsageReportOptions *GetResourceUsageReportOptions) (result *PartnerUsageReportSummary, response *core.DetailedResponse, err error)
GetResourceUsageReport : Get partner resource usage report Returns the summary for the partner for a given month. Partner billing managers are authorized to access this report.
func (*PartnerUsageReportsV1) GetResourceUsageReportWithContext ¶
func (partnerUsageReports *PartnerUsageReportsV1) GetResourceUsageReportWithContext(ctx context.Context, getResourceUsageReportOptions *GetResourceUsageReportOptions) (result *PartnerUsageReportSummary, response *core.DetailedResponse, err error)
GetResourceUsageReportWithContext is an alternate form of the GetResourceUsageReport method which supports a Context parameter
func (*PartnerUsageReportsV1) GetServiceURL ¶
func (partnerUsageReports *PartnerUsageReportsV1) GetServiceURL() string
GetServiceURL returns the service URL
func (*PartnerUsageReportsV1) NewGetResourceUsageReportOptions ¶
func (*PartnerUsageReportsV1) NewGetResourceUsageReportOptions(partnerID string) *GetResourceUsageReportOptions
NewGetResourceUsageReportOptions : Instantiate GetResourceUsageReportOptions
func (*PartnerUsageReportsV1) NewGetResourceUsageReportPager ¶
func (partnerUsageReports *PartnerUsageReportsV1) NewGetResourceUsageReportPager(options *GetResourceUsageReportOptions) (pager *GetResourceUsageReportPager, err error)
NewGetResourceUsageReportPager returns a new GetResourceUsageReportPager instance.
func (*PartnerUsageReportsV1) SetDefaultHeaders ¶
func (partnerUsageReports *PartnerUsageReportsV1) SetDefaultHeaders(headers http.Header)
SetDefaultHeaders sets HTTP headers to be sent in every request
func (*PartnerUsageReportsV1) SetEnableGzipCompression ¶
func (partnerUsageReports *PartnerUsageReportsV1) SetEnableGzipCompression(enableGzip bool)
SetEnableGzipCompression sets the service's EnableGzipCompression field
func (*PartnerUsageReportsV1) SetServiceURL ¶
func (partnerUsageReports *PartnerUsageReportsV1) SetServiceURL(url string) error
SetServiceURL sets the service URL
type PartnerUsageReportsV1Options ¶
type PartnerUsageReportsV1Options struct { ServiceName string URL string Authenticator core.Authenticator }
PartnerUsageReportsV1Options : Service options
type PlanUsage ¶
type PlanUsage struct { // The ID of the plan. PlanID *string `json:"plan_id" validate:"required"` // The pricing region for the plan. PricingRegion *string `json:"pricing_region,omitempty"` // The pricing plan with which the usage was rated. PricingPlanID *string `json:"pricing_plan_id,omitempty"` // Whether the plan charges are billed to the customer. Billable *bool `json:"billable" validate:"required"` // The total cost that was incurred by the plan. Cost *float64 `json:"cost" validate:"required"` // The total pre-discounted cost that was incurred by the plan. RatedCost *float64 `json:"rated_cost" validate:"required"` // All of the metrics in the plan. Usage []MetricUsage `json:"usage" validate:"required"` }
PlanUsage : Aggregated values for the plan.
type ResourceUsage ¶
type ResourceUsage struct { // The ID of the resource. ResourceID *string `json:"resource_id" validate:"required"` // The name of the resource. ResourceName *string `json:"resource_name,omitempty"` // The billable charges for the partner. BillableCost *float64 `json:"billable_cost" validate:"required"` // The pre-discounted billable charges for the partner. BillableRatedCost *float64 `json:"billable_rated_cost" validate:"required"` // The non-billable charges for the partner. NonBillableCost *float64 `json:"non_billable_cost" validate:"required"` // The pre-discounted, non-billable charges for the partner. NonBillableRatedCost *float64 `json:"non_billable_rated_cost" validate:"required"` // All of the plans in the resource. Plans []PlanUsage `json:"plans" validate:"required"` }
ResourceUsage : A container for all the plans in the resource.