dspreport

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package dspreport provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateReportV3RequestWithApplicationVndDspcreatereportsV3PlusJSONBody

func NewCreateReportV3RequestWithApplicationVndDspcreatereportsV3PlusJSONBody(server string, accountId string, params *CreateReportV3Params, body CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody) (*http.Request, error)

NewCreateReportV3RequestWithApplicationVndDspcreatereportsV3PlusJSONBody calls the generic CreateReportV3 builder with application/vnd.dspcreatereports.v3+json body

func NewCreateReportV3RequestWithBody

func NewCreateReportV3RequestWithBody(server string, accountId string, params *CreateReportV3Params, contentType string, body io.Reader) (*http.Request, error)

NewCreateReportV3RequestWithBody generates requests for CreateReportV3 with any type of body

func NewGetCampaignReportV3Request

func NewGetCampaignReportV3Request(server string, accountId string, reportId string, params *GetCampaignReportV3Params) (*http.Request, error)

NewGetCampaignReportV3Request generates requests for GetCampaignReportV3

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn

	// A callback for modifying response which are generated after receive from the network.
	ResponseEditors []ResponseEditorFn

	// The user agent header identifies your application, its version number, and the platform and programming language you are using.
	// You must include a user agent header in each request submitted to the sales partner API.
	UserAgent string
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreateReportV3WithApplicationVndDspcreatereportsV3PlusJSONBody

func (c *Client) CreateReportV3WithApplicationVndDspcreatereportsV3PlusJSONBody(ctx context.Context, accountId string, params *CreateReportV3Params, body CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody) (*http.Response, error)

func (*Client) CreateReportV3WithBody

func (c *Client) CreateReportV3WithBody(ctx context.Context, accountId string, params *CreateReportV3Params, contentType string, body io.Reader) (*http.Response, error)

func (*Client) GetCampaignReportV3

func (c *Client) GetCampaignReportV3(ctx context.Context, accountId string, reportId string, params *GetCampaignReportV3Params) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// CreateReportV3WithBody request with any body
	CreateReportV3WithBody(ctx context.Context, accountId string, params *CreateReportV3Params, contentType string, body io.Reader) (*http.Response, error)

	CreateReportV3WithApplicationVndDspcreatereportsV3PlusJSONBody(ctx context.Context, accountId string, params *CreateReportV3Params, body CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody) (*http.Response, error)

	// GetCampaignReportV3 request
	GetCampaignReportV3(ctx context.Context, accountId string, reportId string, params *GetCampaignReportV3Params) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

func WithResponseEditorFn added in v0.0.2

func WithResponseEditorFn(fn ResponseEditorFn) ClientOption

WithResponseEditorFn allows setting up a callback function, which will be called right after receive the response.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateReportV3WithApplicationVndDspcreatereportsV3PlusJSONBodyWithResponse

func (c *ClientWithResponses) CreateReportV3WithApplicationVndDspcreatereportsV3PlusJSONBodyWithResponse(ctx context.Context, accountId string, params *CreateReportV3Params, body CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody) (*CreateReportV3Resp, error)

func (*ClientWithResponses) CreateReportV3WithBodyWithResponse

func (c *ClientWithResponses) CreateReportV3WithBodyWithResponse(ctx context.Context, accountId string, params *CreateReportV3Params, contentType string, body io.Reader) (*CreateReportV3Resp, error)

CreateReportV3WithBodyWithResponse request with arbitrary body returning *CreateReportV3Resp

func (*ClientWithResponses) GetCampaignReportV3WithResponse

func (c *ClientWithResponses) GetCampaignReportV3WithResponse(ctx context.Context, accountId string, reportId string, params *GetCampaignReportV3Params) (*GetCampaignReportV3Resp, error)

GetCampaignReportV3WithResponse request returning *GetCampaignReportV3Resp

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// CreateReportV3WithBodyWithResponse request with any body
	CreateReportV3WithBodyWithResponse(ctx context.Context, accountId string, params *CreateReportV3Params, contentType string, body io.Reader) (*CreateReportV3Resp, error)

	CreateReportV3WithApplicationVndDspcreatereportsV3PlusJSONBodyWithResponse(ctx context.Context, accountId string, params *CreateReportV3Params, body CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody) (*CreateReportV3Resp, error)

	// GetCampaignReportV3WithResponse request
	GetCampaignReportV3WithResponse(ctx context.Context, accountId string, reportId string, params *GetCampaignReportV3Params) (*GetCampaignReportV3Resp, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateReportRequestBodyV3

type CreateReportRequestBodyV3 struct {
	// AdvertiserIds List of advertisers specified by identifier to include in the report. This should not be present if accountId is advertiser. To learn more about when to use advertiserIds, see [Reporting by account type](https://advertising.amazon.com/API/docs/en-us/reporting/dsp/reporting-by-account-type).
	AdvertiserIds *[]string `json:"advertiserIds,omitempty"`

	// Dimensions List of dimensions to include in the report. Specify one or many comma-delimited strings of dimensions. For example: ["ORDER", "LINE_ITEM", "CREATIVE"]. Adding a dimension in this array determines the aggregation level of the report data and also adds the fields for that dimension in the report. If the list is null or empty, the aggregation of the report data is at `ORDER` level. The allowed values can be used together in this array as an allowed value in which case the report aggregation will be at the lowest aggregation level and the report will contain the fields for all the dimensions included in the report. To see a list of metrics available by dimension, see [Dimensions](https://advertising.amazon.com/API/docs/en-us/reporting/dsp/dimensions).
	Dimensions *[]CreateReportRequestBodyV3Dimensions `json:"dimensions,omitempty"`

	// EndDate Date in yyyy-MM-dd format. The report contains only metrics generated on the specified date range between startDate and endDate. The maximum date range between startDate and endDate is 31 days. The endDate can be up to 90 days older from today.
	EndDate openapi_types.Date `json:"endDate"`

	// Format The report file format.
	Format *CreateReportRequestBodyV3Format `json:"format,omitempty"`

	// Metrics Specify a list of metrics field names to include in the report. For example: ["impressions", "clickThroughs", "CTR", "eCPC", "totalCost", "eCPM"]. If no metric field names are specified, only the default fields and selected `DIMENSION` fields are included by default. Specifying default fields returns an error. To view the metrics available by report type, see [DSP report types](https://advertising.amazon.com/API/docs/en-us/reporting/dsp/report-types)
	Metrics *[]string `json:"metrics,omitempty"`

	// OrderIds List of orders specified by identifier to include in the report.
	OrderIds *[]string `json:"orderIds,omitempty"`

	// StartDate Date in yyyy-MM-dd format. The report contains only metrics generated on the specified date range between startDate and endDate. The maximum date range between startDate and endDate is 31 days. The startDate can be up to 90 days older from today.
	StartDate openapi_types.Date `json:"startDate"`

	// TimeUnit Adding timeUnit determines the aggregation level (`SUMMARY` or `DAILY`) of the report data. If the timeUnit is null or empty, the aggregation of the report data is at the `SUMMARY` level and aggregated at the time period specified. `DAILY` timeUnit is not supported for `AUDIENCE` report type. The report will contain the fields based on timeUnit:<details><summary>`SUMMARY`</summary>intervalStart</br>intervalEnd</details></br><details><summary>`DAILY`</summary>Date</details>
	TimeUnit *CreateReportRequestBodyV3TimeUnit `json:"timeUnit,omitempty"`

	// Type The report type.
	Type *CreateReportRequestBodyV3Type `json:"type,omitempty"`
}

CreateReportRequestBodyV3 defines model for CreateReportRequestBodyV3.

type CreateReportRequestBodyV3Dimensions

type CreateReportRequestBodyV3Dimensions string

CreateReportRequestBodyV3Dimensions defines model for CreateReportRequestBodyV3.Dimensions.

const (
	CreateReportRequestBodyV3DimensionsBROWSERTYPE       CreateReportRequestBodyV3Dimensions = "BROWSER_TYPE"
	CreateReportRequestBodyV3DimensionsBROWSERVERSION    CreateReportRequestBodyV3Dimensions = "BROWSER_VERSION"
	CreateReportRequestBodyV3DimensionsCITY              CreateReportRequestBodyV3Dimensions = "CITY"
	CreateReportRequestBodyV3DimensionsCONVERSIONSOURCE  CreateReportRequestBodyV3Dimensions = "CONVERSION_SOURCE"
	CreateReportRequestBodyV3DimensionsCOUNTRY           CreateReportRequestBodyV3Dimensions = "COUNTRY"
	CreateReportRequestBodyV3DimensionsCREATIVE          CreateReportRequestBodyV3Dimensions = "CREATIVE"
	CreateReportRequestBodyV3DimensionsDEAL              CreateReportRequestBodyV3Dimensions = "DEAL"
	CreateReportRequestBodyV3DimensionsDEVICETYPE        CreateReportRequestBodyV3Dimensions = "DEVICE_TYPE"
	CreateReportRequestBodyV3DimensionsDMA               CreateReportRequestBodyV3Dimensions = "DMA"
	CreateReportRequestBodyV3DimensionsENVIRONMENTTYPE   CreateReportRequestBodyV3Dimensions = "ENVIRONMENT_TYPE"
	CreateReportRequestBodyV3DimensionsLINEITEM          CreateReportRequestBodyV3Dimensions = "LINE_ITEM"
	CreateReportRequestBodyV3DimensionsOPERATINGSYSTEM   CreateReportRequestBodyV3Dimensions = "OPERATING_SYSTEM"
	CreateReportRequestBodyV3DimensionsORDER             CreateReportRequestBodyV3Dimensions = "ORDER"
	CreateReportRequestBodyV3DimensionsPOSTALCODE        CreateReportRequestBodyV3Dimensions = "POSTAL_CODE"
	CreateReportRequestBodyV3DimensionsSITE              CreateReportRequestBodyV3Dimensions = "SITE"
	CreateReportRequestBodyV3DimensionsSTATECOUNTYREGION CreateReportRequestBodyV3Dimensions = "STATE_COUNTY_REGION"
	CreateReportRequestBodyV3DimensionsSUPPLY            CreateReportRequestBodyV3Dimensions = "SUPPLY"
)

Defines values for CreateReportRequestBodyV3Dimensions.

type CreateReportRequestBodyV3Format

type CreateReportRequestBodyV3Format string

CreateReportRequestBodyV3Format The report file format.

const (
	CreateReportRequestBodyV3FormatCSV  CreateReportRequestBodyV3Format = "CSV"
	CreateReportRequestBodyV3FormatJSON CreateReportRequestBodyV3Format = "JSON"
)

Defines values for CreateReportRequestBodyV3Format.

type CreateReportRequestBodyV3TimeUnit

type CreateReportRequestBodyV3TimeUnit string

CreateReportRequestBodyV3TimeUnit Adding timeUnit determines the aggregation level (`SUMMARY` or `DAILY`) of the report data. If the timeUnit is null or empty, the aggregation of the report data is at the `SUMMARY` level and aggregated at the time period specified. `DAILY` timeUnit is not supported for `AUDIENCE` report type. The report will contain the fields based on timeUnit:<details><summary>`SUMMARY`</summary>intervalStart</br>intervalEnd</details></br><details><summary>`DAILY`</summary>Date</details>

const (
	DAILY   CreateReportRequestBodyV3TimeUnit = "DAILY"
	SUMMARY CreateReportRequestBodyV3TimeUnit = "SUMMARY"
)

Defines values for CreateReportRequestBodyV3TimeUnit.

type CreateReportRequestBodyV3Type

type CreateReportRequestBodyV3Type string

CreateReportRequestBodyV3Type The report type.

const (
	CreateReportRequestBodyV3TypeAUDIENCE         CreateReportRequestBodyV3Type = "AUDIENCE"
	CreateReportRequestBodyV3TypeCAMPAIGN         CreateReportRequestBodyV3Type = "CAMPAIGN"
	CreateReportRequestBodyV3TypeCONVERSIONSOURCE CreateReportRequestBodyV3Type = "CONVERSION_SOURCE"
	CreateReportRequestBodyV3TypeGEOGRAPHY        CreateReportRequestBodyV3Type = "GEOGRAPHY"
	CreateReportRequestBodyV3TypeINVENTORY        CreateReportRequestBodyV3Type = "INVENTORY"
	CreateReportRequestBodyV3TypePRODUCTS         CreateReportRequestBodyV3Type = "PRODUCTS"
	CreateReportRequestBodyV3TypeTECHNOLOGY       CreateReportRequestBodyV3Type = "TECHNOLOGY"
)

Defines values for CreateReportRequestBodyV3Type.

type CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody

type CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody = CreateReportRequestBodyV3

CreateReportV3ApplicationVndDspcreatereportsV3PlusJSONRequestBody defines body for CreateReportV3 for application/vnd.dspcreatereports.v3+json ContentType.

type CreateReportV3Params

type CreateReportV3Params struct {
	// AmazonAdvertisingAPIClientId The client identifier. See [create API authorization and refresh tokens](https://advertising.amazon.com/API/docs/en-us/setting-up/generate-api-tokens) for more information.
	AmazonAdvertisingAPIClientId string `json:"Amazon-Advertising-API-ClientId"`
}

CreateReportV3Params defines parameters for CreateReportV3.

type CreateReportV3Resp

type CreateReportV3Resp struct {
	Body                                    []byte
	HTTPResponse                            *http.Response
	ApplicationvndDspcreatereportsV3JSON200 *ReportMetadataV3
	ApplicationvndDsperrorV1JSON400         *DSPReportsBadRequest
	ApplicationvndDsperrorV1JSON401         *DSPReportsUnauthorized
	ApplicationvndDsperrorV1JSON403         *DSPReportsForbidden
	ApplicationvndDsperrorV1JSON404         *DSPReportsNotFound
	ApplicationvndDsperrorV1JSON415         *DSPReportsUnsupportedMediaType
	ApplicationvndDsperrorV1JSON422         *DSPReportsUnprocessableEntity
	ApplicationvndDsperrorV1JSON429         *DSPReportsTooManyRequests
	ApplicationvndDsperrorV1JSON500         *DSPReportsInternalServerError
	ApplicationvndDsperrorV1JSON502         *DSPReportsBadGateway
	ApplicationvndDsperrorV1JSON503         *DSPReportsServiceUnavailable
	ApplicationvndDsperrorV1JSON504         *DSPReportsEndpointRequestTimedOut
}

func ParseCreateReportV3Resp

func ParseCreateReportV3Resp(rsp *http.Response) (*CreateReportV3Resp, error)

ParseCreateReportV3Resp parses an HTTP response from a CreateReportV3WithResponse call

func (CreateReportV3Resp) Status

func (r CreateReportV3Resp) Status() string

Status returns HTTPResponse.Status

func (CreateReportV3Resp) StatusCode

func (r CreateReportV3Resp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DSPReportsBadGateway

type DSPReportsBadGateway = DSPReportsError

DSPReportsBadGateway The error response object.

type DSPReportsBadRequest

type DSPReportsBadRequest = DSPReportsError

DSPReportsBadRequest The error response object.

type DSPReportsEndpointRequestTimedOut

type DSPReportsEndpointRequestTimedOut = DSPReportsError

DSPReportsEndpointRequestTimedOut The error response object.

type DSPReportsError

type DSPReportsError struct {
	// Errors A list of errors. Please check the values in this field for report validation errors.
	Errors *[]DSPReportsSubError `json:"errors,omitempty"`

	// Message A human-readable description of the response.
	Message string `json:"message"`

	// RequestId A unique identifier of the request.
	RequestId *string `json:"requestId,omitempty"`
}

DSPReportsError The error response object.

type DSPReportsForbidden

type DSPReportsForbidden = DSPReportsError

DSPReportsForbidden The error response object.

type DSPReportsInternalServerError

type DSPReportsInternalServerError = DSPReportsError

DSPReportsInternalServerError The error response object.

type DSPReportsNotFound

type DSPReportsNotFound = DSPReportsError

DSPReportsNotFound The error response object.

type DSPReportsServiceUnavailable

type DSPReportsServiceUnavailable = DSPReportsError

DSPReportsServiceUnavailable The error response object.

type DSPReportsSubError

type DSPReportsSubError struct {
	// ErrorType Enumerated error type.
	ErrorType string `json:"errorType"`

	// Field Request body field which is cause of the error.
	Field *string `json:"field,omitempty"`

	// Message Detailed error description
	Message string `json:"message"`
}

DSPReportsSubError The sub-error object.

type DSPReportsTooManyRequests

type DSPReportsTooManyRequests = DSPReportsError

DSPReportsTooManyRequests The error response object.

type DSPReportsUnauthorized

type DSPReportsUnauthorized = DSPReportsError

DSPReportsUnauthorized The error response object.

type DSPReportsUnprocessableEntity

type DSPReportsUnprocessableEntity = DSPReportsError

DSPReportsUnprocessableEntity The error response object.

type DSPReportsUnsupportedMediaType

type DSPReportsUnsupportedMediaType = DSPReportsError

DSPReportsUnsupportedMediaType The error response object.

type GetCampaignReportV3Params

type GetCampaignReportV3Params struct {
	// AmazonAdvertisingAPIClientId The client identifier. See [create API authorization and refresh tokens](https://advertising.amazon.com/API/docs/en-us/setting-up/generate-api-tokens) for more information.
	AmazonAdvertisingAPIClientId string `json:"Amazon-Advertising-API-ClientId"`
}

GetCampaignReportV3Params defines parameters for GetCampaignReportV3.

type GetCampaignReportV3Resp

type GetCampaignReportV3Resp struct {
	Body                                 []byte
	HTTPResponse                         *http.Response
	ApplicationvndDspgetreportsV3JSON200 *ReportMetadataV3
	ApplicationvndDsperrorV1JSON400      *DSPReportsBadRequest
	ApplicationvndDsperrorV1JSON403      *DSPReportsForbidden
	ApplicationvndDsperrorV1JSON404      *DSPReportsNotFound
	ApplicationvndDsperrorV1JSON415      *DSPReportsUnsupportedMediaType
	ApplicationvndDsperrorV1JSON429      *DSPReportsTooManyRequests
	ApplicationvndDsperrorV1JSON500      *DSPReportsInternalServerError
	ApplicationvndDsperrorV1JSON502      *DSPReportsBadGateway
	ApplicationvndDsperrorV1JSON503      *DSPReportsServiceUnavailable
	ApplicationvndDsperrorV1JSON504      *DSPReportsEndpointRequestTimedOut
}

func ParseGetCampaignReportV3Resp

func ParseGetCampaignReportV3Resp(rsp *http.Response) (*GetCampaignReportV3Resp, error)

ParseGetCampaignReportV3Resp parses an HTTP response from a GetCampaignReportV3WithResponse call

func (GetCampaignReportV3Resp) Status

func (r GetCampaignReportV3Resp) Status() string

Status returns HTTPResponse.Status

func (GetCampaignReportV3Resp) StatusCode

func (r GetCampaignReportV3Resp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ReportMetadataV3

type ReportMetadataV3 struct {
	// Expiration The expiration time of the URI in the location property in date-time format(yyyy-MM-ddTHH:mm:ss). The expiration time is the time when the download link expires.
	Expiration *time.Time `json:"expiration,omitempty"`

	// Format The data format of the report.
	Format *ReportMetadataV3Format `json:"format,omitempty"`

	// Location The URI address of the report.
	Location *string `json:"location,omitempty"`

	// ReportId The identifier of the report.
	ReportId *string `json:"reportId,omitempty"`

	// Status The build status of the report.
	Status *ReportMetadataV3Status `json:"status,omitempty"`

	// StatusDetails  A human-readable description of the current status.
	StatusDetails *string `json:"statusDetails,omitempty"`

	// Type The type of report.
	Type *ReportMetadataV3Type `json:"type,omitempty"`
}

ReportMetadataV3 defines model for ReportMetadataV3.

type ReportMetadataV3Format

type ReportMetadataV3Format string

ReportMetadataV3Format The data format of the report.

const (
	ReportMetadataV3FormatCSV  ReportMetadataV3Format = "CSV"
	ReportMetadataV3FormatJSON ReportMetadataV3Format = "JSON"
)

Defines values for ReportMetadataV3Format.

type ReportMetadataV3Status

type ReportMetadataV3Status string

ReportMetadataV3Status The build status of the report.

const (
	FAILURE    ReportMetadataV3Status = "FAILURE"
	INPROGRESS ReportMetadataV3Status = "IN_PROGRESS"
	SUCCESS    ReportMetadataV3Status = "SUCCESS"
)

Defines values for ReportMetadataV3Status.

type ReportMetadataV3Type

type ReportMetadataV3Type string

ReportMetadataV3Type The type of report.

const (
	AUDIENCE         ReportMetadataV3Type = "AUDIENCE"
	CAMPAIGN         ReportMetadataV3Type = "CAMPAIGN"
	CONVERSIONSOURCE ReportMetadataV3Type = "CONVERSION_SOURCE"
	GEOGRAPHY        ReportMetadataV3Type = "GEOGRAPHY"
	INVENTORY        ReportMetadataV3Type = "INVENTORY"
	PRODUCTS         ReportMetadataV3Type = "PRODUCTS"
	TECHNOLOGY       ReportMetadataV3Type = "TECHNOLOGY"
)

Defines values for ReportMetadataV3Type.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ResponseEditorFn added in v0.0.2

type ResponseEditorFn func(ctx context.Context, rsp *http.Response) error

ResponseEditorFn is the function signature for the ResponseEditor callback function

Jump to

Keyboard shortcuts

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