moderation

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: 10 Imported by: 0

Documentation

Overview

Package moderation 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 NewModerationResultsRequestWithApplicationVndModerationresultsrequestV41PlusJSONBody

func NewModerationResultsRequestWithApplicationVndModerationresultsrequestV41PlusJSONBody(server string, params *ModerationResultsParams, body ModerationResultsApplicationVndModerationresultsrequestV41PlusJSONRequestBody) (*http.Request, error)

NewModerationResultsRequestWithApplicationVndModerationresultsrequestV41PlusJSONBody calls the generic ModerationResults builder with application/vnd.moderationresultsrequest.v4.1+json body

func NewModerationResultsRequestWithBody

func NewModerationResultsRequestWithBody(server string, params *ModerationResultsParams, contentType string, body io.Reader) (*http.Request, error)

NewModerationResultsRequestWithBody generates requests for ModerationResults with any type of body

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) ModerationResultsWithBody

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

type ClientHeader

type ClientHeader = string

ClientHeader defines model for clientHeader.

type ClientInterface

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

	ModerationResultsWithApplicationVndModerationresultsrequestV41PlusJSONBody(ctx context.Context, params *ModerationResultsParams, body ModerationResultsApplicationVndModerationresultsrequestV41PlusJSONRequestBody) (*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) ModerationResultsWithBodyWithResponse

func (c *ClientWithResponses) ModerationResultsWithBodyWithResponse(ctx context.Context, params *ModerationResultsParams, contentType string, body io.Reader) (*ModerationResultsResp, error)

ModerationResultsWithBodyWithResponse request with arbitrary body returning *ModerationResultsResp

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ModerationResultsWithBodyWithResponse request with any body
	ModerationResultsWithBodyWithResponse(ctx context.Context, params *ModerationResultsParams, contentType string, body io.Reader) (*ModerationResultsResp, error)

	ModerationResultsWithApplicationVndModerationresultsrequestV41PlusJSONBodyWithResponse(ctx context.Context, params *ModerationResultsParams, body ModerationResultsApplicationVndModerationresultsrequestV41PlusJSONRequestBody) (*ModerationResultsResp, error)
}

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

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Id

type Id = string

Id The unique identifier of the ad which can be obtained after the ad is created using create APIs.

type IdType

type IdType string

IdType The unique identifiers type based on the adProgram of the ad.

const (
	ADID IdType = "AD_ID"
)

Defines values for IdType.

type ImageCrop

type ImageCrop struct {
	// Height Policy violated region's height in pixel.
	Height *int64 `json:"height,omitempty"`

	// TopLeftX Policy violated region's top left X-axis pixel value.
	TopLeftX *int64 `json:"topLeftX,omitempty"`

	// TopLeftY Policy violated region's top left Y-axis pixel value.
	TopLeftY *int64 `json:"topLeftY,omitempty"`

	// Width Policy violated region's width in pixel.
	Width *int64 `json:"width,omitempty"`
}

ImageCrop defines model for ImageCrop.

type ModerationResult

type ModerationResult struct {
	// EtaForModeration Expected date and time by which moderation will be complete. The format is ISO 8601 in UTC time zone. Note that this field is present in the response only when moderationStatus is set to IN_PROGRESS.
	EtaForModeration *string `json:"etaForModeration,omitempty"`

	// Id The unique identifier of the ad which can be obtained after the ad is created using create APIs.
	Id *Id `json:"id,omitempty"`

	// IdType The unique identifiers type based on the adProgram of the ad.
	IdType *IdType `json:"idType,omitempty"`

	// ModerationStatus The moderation status of the ad.
	ModerationStatus *ModerationStatus `json:"moderationStatus,omitempty"`

	// PolicyViolations A list of policy violations for a campaign that has failed moderation. Note that this field is present in the response only when moderationStatus is set to REJECTED.
	PolicyViolations *[]PolicyViolation `json:"policyViolations,omitempty"`

	// VersionId The version identifier that helps to keep track of multiple versions of a submitted ad. In case of Sponsored Brands this is the creative version id.
	VersionId *VersionId `json:"versionId,omitempty"`
}

ModerationResult defines model for ModerationResult.

type ModerationResultsAccessDeniedError

type ModerationResultsAccessDeniedError struct {
	// Code Access denied error code.
	Code *ModerationResultsAccessDeniedErrorCode `json:"code,omitempty"`

	// Details A human-readable description of the error response.
	Details *string `json:"details,omitempty"`
}

ModerationResultsAccessDeniedError defines model for ModerationResultsAccessDeniedError.

type ModerationResultsAccessDeniedErrorCode

type ModerationResultsAccessDeniedErrorCode string

ModerationResultsAccessDeniedErrorCode Access denied error code.

const (
	ACCESSDENIED ModerationResultsAccessDeniedErrorCode = "ACCESS_DENIED"
)

Defines values for ModerationResultsAccessDeniedErrorCode.

type ModerationResultsAdProgramType

type ModerationResultsAdProgramType string

ModerationResultsAdProgramType The program type of the ad.

const (
	SBPRODUCTCOLLECTION ModerationResultsAdProgramType = "SB_PRODUCT_COLLECTION"
	SBSTORESPOTLIGHT    ModerationResultsAdProgramType = "SB_STORE_SPOTLIGHT"
	SBVIDEO             ModerationResultsAdProgramType = "SB_VIDEO"
	SPONSOREDPRODUCTS   ModerationResultsAdProgramType = "SPONSORED_PRODUCTS"
)

Defines values for ModerationResultsAdProgramType.

type ModerationResultsApplicationVndModerationresultsrequestV41PlusJSONRequestBody

type ModerationResultsApplicationVndModerationresultsrequestV41PlusJSONRequestBody = ModerationResultsRequest

ModerationResultsApplicationVndModerationresultsrequestV41PlusJSONRequestBody defines body for ModerationResults for application/vnd.moderationresultsrequest.v4.1+json ContentType.

type ModerationResultsBadRequestError

type ModerationResultsBadRequestError struct {
	// Code Bad request error code.
	Code *ModerationResultsBadRequestErrorCode `json:"code,omitempty"`

	// Details A human-readable description of the error response.
	Details *string `json:"details,omitempty"`
}

ModerationResultsBadRequestError defines model for ModerationResultsBadRequestError.

type ModerationResultsBadRequestErrorCode

type ModerationResultsBadRequestErrorCode string

ModerationResultsBadRequestErrorCode Bad request error code.

const (
	BADREQUEST ModerationResultsBadRequestErrorCode = "BAD_REQUEST"
)

Defines values for ModerationResultsBadRequestErrorCode.

type ModerationResultsInternalServerError

type ModerationResultsInternalServerError struct {
	// Code Internal error code.
	Code *ModerationResultsInternalServerErrorCode `json:"code,omitempty"`

	// Details A human-readable description of the error response.
	Details *string `json:"details,omitempty"`
}

ModerationResultsInternalServerError defines model for ModerationResultsInternalServerError.

type ModerationResultsInternalServerErrorCode

type ModerationResultsInternalServerErrorCode string

ModerationResultsInternalServerErrorCode Internal error code.

const (
	INTERNALERROR ModerationResultsInternalServerErrorCode = "INTERNAL_ERROR"
)

Defines values for ModerationResultsInternalServerErrorCode.

type ModerationResultsNotFoundError

type ModerationResultsNotFoundError struct {
	// Code Not found error code.
	Code *ModerationResultsNotFoundErrorCode `json:"code,omitempty"`

	// Details A human-readable description of the error response.
	Details *string `json:"details,omitempty"`
}

ModerationResultsNotFoundError defines model for ModerationResultsNotFoundError.

type ModerationResultsNotFoundErrorCode

type ModerationResultsNotFoundErrorCode string

ModerationResultsNotFoundErrorCode Not found error code.

const (
	NOTFOUND ModerationResultsNotFoundErrorCode = "NOT_FOUND"
)

Defines values for ModerationResultsNotFoundErrorCode.

type ModerationResultsParams

type ModerationResultsParams struct {
	// AmazonAdvertisingAPIClientId The identifier of a client associated with a "Login with Amazon" account.
	AmazonAdvertisingAPIClientId ClientHeader `json:"Amazon-Advertising-API-ClientId"`

	// AmazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use `GET` method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header and choose profile id `profileId` from the response to pass it as input.
	AmazonAdvertisingAPIScope ProfileHeader `json:"Amazon-Advertising-API-Scope"`
}

ModerationResultsParams defines parameters for ModerationResults.

type ModerationResultsRequest

type ModerationResultsRequest struct {
	// AdProgramType The program type of the ad.
	AdProgramType ModerationResultsAdProgramType `json:"adProgramType"`

	// Id The unique identifier of the ad which can be obtained after the ad is created using create APIs.
	Id Id `json:"id"`

	// IdType The unique identifiers type based on the adProgram of the ad.
	IdType IdType `json:"idType"`

	// MaxResults Sets a limit on the number of results returned by an operation.
	MaxResults int32 `json:"maxResults"`

	// ModerationStatusFilter Filter by specific moderation status.
	ModerationStatusFilter *[]ModerationStatus `json:"moderationStatusFilter,omitempty"`

	// NextToken Operations that return paginated results include a pagination token in this field. To retrieve the next page of results, call the same operation and specify this token in the request. If the `NextToken` field is empty, there are no further results.
	NextToken *NextToken `json:"nextToken,omitempty"`

	// VersionIdFilter Filter by specific version id of the ad. The API will return the ad's all versions moderation status if this field is empty.
	VersionIdFilter *[]VersionId `json:"versionIdFilter,omitempty"`
}

ModerationResultsRequest defines model for ModerationResultsRequest.

type ModerationResultsResp

type ModerationResultsResp struct {
	Body                                                         []byte
	HTTPResponse                                                 *http.Response
	ApplicationvndModerationresultsresponseV40JSON200            *ModerationResultsResponse
	ApplicationvndModerationresultsbadrequesterrorV40JSON400     *ModerationResultsBadRequestError
	ApplicationvndModerationresultsaccessdeniederrorV40JSON403   *ModerationResultsAccessDeniedError
	ApplicationvndModerationresultsnotfounderrorV40JSON404       *ModerationResultsNotFoundError
	ApplicationvndModerationresultsthrottlingerrorV40JSON429     *ModerationResultsThrottlingError
	ApplicationvndModerationresultsinternalservererrorV40JSON500 *ModerationResultsInternalServerError
}

func ParseModerationResultsResp

func ParseModerationResultsResp(rsp *http.Response) (*ModerationResultsResp, error)

ParseModerationResultsResp parses an HTTP response from a ModerationResultsWithResponse call

func (ModerationResultsResp) Status

func (r ModerationResultsResp) Status() string

Status returns HTTPResponse.Status

func (ModerationResultsResp) StatusCode

func (r ModerationResultsResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ModerationResultsResponse

type ModerationResultsResponse struct {
	ModerationResults *[]ModerationResult `json:"moderationResults,omitempty"`

	// NextToken Operations that return paginated results include a pagination token in this field. To retrieve the next page of results, call the same operation and specify this token in the request. If the `NextToken` field is empty, there are no further results.
	NextToken *NextToken `json:"nextToken,omitempty"`
}

ModerationResultsResponse defines model for ModerationResultsResponse.

type ModerationResultsThrottlingError

type ModerationResultsThrottlingError struct {
	// Code Throttled error code.
	Code *ModerationResultsThrottlingErrorCode `json:"code,omitempty"`

	// Details A human-readable description of the error response.
	Details *string `json:"details,omitempty"`
}

ModerationResultsThrottlingError defines model for ModerationResultsThrottlingError.

type ModerationResultsThrottlingErrorCode

type ModerationResultsThrottlingErrorCode string

ModerationResultsThrottlingErrorCode Throttled error code.

const (
	THROTTLED ModerationResultsThrottlingErrorCode = "THROTTLED"
)

Defines values for ModerationResultsThrottlingErrorCode.

type ModerationStatus

type ModerationStatus string

ModerationStatus The moderation status of the ad.

const (
	APPROVED   ModerationStatus = "APPROVED"
	FAILED     ModerationStatus = "FAILED"
	INPROGRESS ModerationStatus = "IN_PROGRESS"
	REJECTED   ModerationStatus = "REJECTED"
)

Defines values for ModerationStatus.

type NextToken

type NextToken = string

NextToken Operations that return paginated results include a pagination token in this field. To retrieve the next page of results, call the same operation and specify this token in the request. If the `NextToken` field is empty, there are no further results.

type PolicyViolation

type PolicyViolation struct {
	// PolicyDescription A human-readable description of the policy.
	PolicyDescription *string `json:"policyDescription,omitempty"`

	// PolicyLinkUrl Address of the policy documentation. Follow the link to learn more about the specified policy.
	PolicyLinkUrl          *string                  `json:"policyLinkUrl,omitempty"`
	ViolatingAsinContents  *[]ViolatingAsinContent  `json:"violatingAsinContents,omitempty"`
	ViolatingImageContents *[]ViolatingImageContent `json:"violatingImageContents,omitempty"`
	ViolatingTextContents  *[]ViolatingTextContent  `json:"violatingTextContents,omitempty"`
	ViolatingVideoContents *[]ViolatingVideoContent `json:"violatingVideoContents,omitempty"`
}

PolicyViolation defines model for PolicyViolation.

type ProfileHeader

type ProfileHeader = string

ProfileHeader defines model for profileHeader.

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

type TextPosition

type TextPosition struct {
	// End Zero-based index into the text in reviewedText where the text specified in violatingText ends.
	End *int64 `json:"end,omitempty"`

	// Start Zero-based index into the text in reviewedText where the text specified in violatingText starts.
	Start *int64 `json:"start,omitempty"`
}

TextPosition defines model for TextPosition.

type VersionId

type VersionId = string

VersionId The version identifier that helps to keep track of multiple versions of a submitted ad. In case of Sponsored Brands this is the creative version id.

type VideoPosition

type VideoPosition struct {
	// End End time of the video having the policy violation.
	End *int64 `json:"end,omitempty"`

	// Start Start time of the video having the policy violation.
	Start *int64 `json:"start,omitempty"`
}

VideoPosition defines model for VideoPosition.

type ViolatingAsinContent

type ViolatingAsinContent struct {
	// ModeratedComponent Moderation component which marked the policy violation.
	ModeratedComponent     *string                  `json:"moderatedComponent,omitempty"`
	ViolatingAsinEvidences *[]ViolatingAsinEvidence `json:"violatingAsinEvidences,omitempty"`
}

ViolatingAsinContent defines model for ViolatingAsinContent.

type ViolatingAsinEvidence

type ViolatingAsinEvidence struct {
	// Asin ASIN which has the ad policy violation.
	Asin *string `json:"asin,omitempty"`
}

ViolatingAsinEvidence defines model for ViolatingAsinEvidence.

type ViolatingImageContent

type ViolatingImageContent struct {
	// ModeratedComponent Moderation component which marked the policy violation.
	ModeratedComponent *string `json:"moderatedComponent,omitempty"`

	// ReviewedImageUrl URL of the image which has the ad policy violation.
	ReviewedImageUrl        *string                   `json:"reviewedImageUrl,omitempty"`
	ViolatingImageEvidences *[]ViolatingImageEvidence `json:"violatingImageEvidences,omitempty"`
}

ViolatingImageContent defines model for ViolatingImageContent.

type ViolatingImageEvidence

type ViolatingImageEvidence struct {
	ViolatingImageCrop *ImageCrop `json:"violatingImageCrop,omitempty"`
}

ViolatingImageEvidence defines model for ViolatingImageEvidence.

type ViolatingTextContent

type ViolatingTextContent struct {
	// ModeratedComponent Moderation component which marked the policy violation.
	ModeratedComponent *string `json:"moderatedComponent,omitempty"`

	// ReviewedText The actual text on which the moderation was done.
	ReviewedText           *string                  `json:"reviewedText,omitempty"`
	ViolatingTextEvidences *[]ViolatingTextEvidence `json:"violatingTextEvidences,omitempty"`
}

ViolatingTextContent Information about the specific text that violates the specified policy in the campaign.

type ViolatingTextEvidence

type ViolatingTextEvidence struct {
	// ViolatingText The specific text determined to violate the specified policy in reviewedText.
	ViolatingText         *string       `json:"violatingText,omitempty"`
	ViolatingTextPosition *TextPosition `json:"violatingTextPosition,omitempty"`
}

ViolatingTextEvidence defines model for ViolatingTextEvidence.

type ViolatingVideoContent

type ViolatingVideoContent struct {
	// ModeratedComponent Moderation component which marked the policy violation.
	ModeratedComponent *string `json:"moderatedComponent,omitempty"`

	// ReviewedVideoUrl URL of the video which has the ad policy violation.
	ReviewedVideoUrl        *string                   `json:"reviewedVideoUrl,omitempty"`
	ViolatingVideoEvidences *[]ViolatingVideoEvidence `json:"violatingVideoEvidences,omitempty"`
}

ViolatingVideoContent defines model for ViolatingVideoContent.

type ViolatingVideoEvidence

type ViolatingVideoEvidence struct {
	ViolatingVideoPosition *VideoPosition `json:"violatingVideoPosition,omitempty"`
}

ViolatingVideoEvidence defines model for ViolatingVideoEvidence.

Jump to

Keyboard shortcuts

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