...

Source file src/google.golang.org/api/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go

Documentation: google.golang.org/api/paymentsresellersubscription/v1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package paymentsresellersubscription provides access to the Payments Reseller Subscription API.
     8  //
     9  // For product documentation, see: https://developers.google.com/payments/reseller/subscription/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/paymentsresellersubscription/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	paymentsresellersubscriptionService, err := paymentsresellersubscription.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	paymentsresellersubscriptionService, err := paymentsresellersubscription.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	paymentsresellersubscriptionService, err := paymentsresellersubscription.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package paymentsresellersubscription // import "google.golang.org/api/paymentsresellersubscription/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "paymentsresellersubscription:v1"
    90  const apiName = "paymentsresellersubscription"
    91  const apiVersion = "v1"
    92  const basePath = "https://paymentsresellersubscription.googleapis.com/"
    93  const basePathTemplate = "https://paymentsresellersubscription.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://paymentsresellersubscription.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// Associate you with your personal info on Google
    99  	OpenIDScope = "openid"
   100  )
   101  
   102  // NewService creates a new Service.
   103  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   104  	scopesOption := internaloption.WithDefaultScopes(
   105  		"openid",
   106  	)
   107  	// NOTE: prepend, so we don't override user-specified scopes.
   108  	opts = append([]option.ClientOption{scopesOption}, opts...)
   109  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   110  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   111  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   112  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   113  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	s, err := New(client)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	if endpoint != "" {
   122  		s.BasePath = endpoint
   123  	}
   124  	return s, nil
   125  }
   126  
   127  // New creates a new Service. It uses the provided http.Client for requests.
   128  //
   129  // Deprecated: please use NewService instead.
   130  // To provide a custom HTTP client, use option.WithHTTPClient.
   131  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   132  func New(client *http.Client) (*Service, error) {
   133  	if client == nil {
   134  		return nil, errors.New("client is nil")
   135  	}
   136  	s := &Service{client: client, BasePath: basePath}
   137  	s.Partners = NewPartnersService(s)
   138  	return s, nil
   139  }
   140  
   141  type Service struct {
   142  	client    *http.Client
   143  	BasePath  string // API endpoint base URL
   144  	UserAgent string // optional additional User-Agent fragment
   145  
   146  	Partners *PartnersService
   147  }
   148  
   149  func (s *Service) userAgent() string {
   150  	if s.UserAgent == "" {
   151  		return googleapi.UserAgent
   152  	}
   153  	return googleapi.UserAgent + " " + s.UserAgent
   154  }
   155  
   156  func NewPartnersService(s *Service) *PartnersService {
   157  	rs := &PartnersService{s: s}
   158  	rs.Products = NewPartnersProductsService(s)
   159  	rs.Promotions = NewPartnersPromotionsService(s)
   160  	rs.Subscriptions = NewPartnersSubscriptionsService(s)
   161  	return rs
   162  }
   163  
   164  type PartnersService struct {
   165  	s *Service
   166  
   167  	Products *PartnersProductsService
   168  
   169  	Promotions *PartnersPromotionsService
   170  
   171  	Subscriptions *PartnersSubscriptionsService
   172  }
   173  
   174  func NewPartnersProductsService(s *Service) *PartnersProductsService {
   175  	rs := &PartnersProductsService{s: s}
   176  	return rs
   177  }
   178  
   179  type PartnersProductsService struct {
   180  	s *Service
   181  }
   182  
   183  func NewPartnersPromotionsService(s *Service) *PartnersPromotionsService {
   184  	rs := &PartnersPromotionsService{s: s}
   185  	return rs
   186  }
   187  
   188  type PartnersPromotionsService struct {
   189  	s *Service
   190  }
   191  
   192  func NewPartnersSubscriptionsService(s *Service) *PartnersSubscriptionsService {
   193  	rs := &PartnersSubscriptionsService{s: s}
   194  	return rs
   195  }
   196  
   197  type PartnersSubscriptionsService struct {
   198  	s *Service
   199  }
   200  
   201  // GoogleCloudPaymentsResellerSubscriptionV1Amount: Describes the amount unit
   202  // including the currency code.
   203  type GoogleCloudPaymentsResellerSubscriptionV1Amount struct {
   204  	// AmountMicros: Required. Amount in micros (1_000_000 micros = 1 currency
   205  	// unit)
   206  	AmountMicros int64 `json:"amountMicros,omitempty,string"`
   207  	// CurrencyCode: Required. Currency codes in accordance with [ISO-4217 Currency
   208  	// Codes] (https://en.wikipedia.org/wiki/ISO_4217). For example, USD.
   209  	CurrencyCode string `json:"currencyCode,omitempty"`
   210  	// ForceSendFields is a list of field names (e.g. "AmountMicros") to
   211  	// unconditionally include in API requests. By default, fields with empty or
   212  	// default values are omitted from API requests. See
   213  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   214  	// details.
   215  	ForceSendFields []string `json:"-"`
   216  	// NullFields is a list of field names (e.g. "AmountMicros") to include in API
   217  	// requests with the JSON null value. By default, fields with empty values are
   218  	// omitted from API requests. See
   219  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   220  	NullFields []string `json:"-"`
   221  }
   222  
   223  func (s *GoogleCloudPaymentsResellerSubscriptionV1Amount) MarshalJSON() ([]byte, error) {
   224  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1Amount
   225  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   226  }
   227  
   228  // GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest: Request
   229  // to cancel a subscription.
   230  type GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest struct {
   231  	// CancelImmediately: Optional. If true, Google will cancel the subscription
   232  	// immediately, and may or may not (based on the contract) issue a prorated
   233  	// refund for the remainder of the billing cycle. Otherwise, Google defers the
   234  	// cancelation at renewal_time, and will not issue a refund.
   235  	CancelImmediately bool `json:"cancelImmediately,omitempty"`
   236  	// CancellationReason: Specifies the reason for the cancellation.
   237  	//
   238  	// Possible values:
   239  	//   "CANCELLATION_REASON_UNSPECIFIED" - Reason is unspecified.
   240  	//   "CANCELLATION_REASON_FRAUD" - Fraudualant transaction.
   241  	//   "CANCELLATION_REASON_REMORSE" - Buyer's remorse.
   242  	//   "CANCELLATION_REASON_ACCIDENTAL_PURCHASE" - Accidential purchase.
   243  	//   "CANCELLATION_REASON_PAST_DUE" - Payment is past due.
   244  	//   "CANCELLATION_REASON_ACCOUNT_CLOSED" - Used for notification only, do not
   245  	// use in Cancel API. User account closed.
   246  	//   "CANCELLATION_REASON_UPGRADE_DOWNGRADE" - Used for notification only, do
   247  	// not use in Cancel API. Cancellation due to upgrade or downgrade.
   248  	//   "CANCELLATION_REASON_USER_DELINQUENCY" - Cancellation due to user
   249  	// delinquency
   250  	//   "CANCELLATION_REASON_SYSTEM_ERROR" - Used for notification only, do not
   251  	// use in Cancel API. Cancellation due to an unrecoverable system error.
   252  	//   "CANCELLATION_REASON_SYSTEM_CANCEL" - Used for notification only, do not
   253  	// use in Cancel API. The subscription is cancelled by Google automatically
   254  	// since it is no longer valid.
   255  	//   "CANCELLATION_REASON_OTHER" - Other reason.
   256  	CancellationReason string `json:"cancellationReason,omitempty"`
   257  	// ForceSendFields is a list of field names (e.g. "CancelImmediately") to
   258  	// unconditionally include in API requests. By default, fields with empty or
   259  	// default values are omitted from API requests. See
   260  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   261  	// details.
   262  	ForceSendFields []string `json:"-"`
   263  	// NullFields is a list of field names (e.g. "CancelImmediately") to include in
   264  	// API requests with the JSON null value. By default, fields with empty values
   265  	// are omitted from API requests. See
   266  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   267  	NullFields []string `json:"-"`
   268  }
   269  
   270  func (s *GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest) MarshalJSON() ([]byte, error) {
   271  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest
   272  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   273  }
   274  
   275  // GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse:
   276  // Response that contains the cancelled subscription resource.
   277  type GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse struct {
   278  	// Subscription: The cancelled subscription resource.
   279  	Subscription *GoogleCloudPaymentsResellerSubscriptionV1Subscription `json:"subscription,omitempty"`
   280  
   281  	// ServerResponse contains the HTTP response code and headers from the server.
   282  	googleapi.ServerResponse `json:"-"`
   283  	// ForceSendFields is a list of field names (e.g. "Subscription") to
   284  	// unconditionally include in API requests. By default, fields with empty or
   285  	// default values are omitted from API requests. See
   286  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   287  	// details.
   288  	ForceSendFields []string `json:"-"`
   289  	// NullFields is a list of field names (e.g. "Subscription") to include in API
   290  	// requests with the JSON null value. By default, fields with empty values are
   291  	// omitted from API requests. See
   292  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   293  	NullFields []string `json:"-"`
   294  }
   295  
   296  func (s *GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse) MarshalJSON() ([]byte, error) {
   297  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse
   298  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   299  }
   300  
   301  // GoogleCloudPaymentsResellerSubscriptionV1Duration: Describes the length of a
   302  // period of a time.
   303  type GoogleCloudPaymentsResellerSubscriptionV1Duration struct {
   304  	// Count: number of duration units to be included.
   305  	Count int64 `json:"count,omitempty"`
   306  	// Unit: The unit used for the duration
   307  	//
   308  	// Possible values:
   309  	//   "UNIT_UNSPECIFIED" - Default value, reserved as an invalid or an
   310  	// unexpected value.
   311  	//   "MONTH" - Unit of a calendar month.
   312  	//   "DAY" - Unit of a day.
   313  	//   "HOUR" - Unit of an hour. It is used for testing.
   314  	Unit string `json:"unit,omitempty"`
   315  	// ForceSendFields is a list of field names (e.g. "Count") to unconditionally
   316  	// include in API requests. By default, fields with empty or default values are
   317  	// omitted from API requests. See
   318  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   319  	// details.
   320  	ForceSendFields []string `json:"-"`
   321  	// NullFields is a list of field names (e.g. "Count") to include in API
   322  	// requests with the JSON null value. By default, fields with empty values are
   323  	// omitted from API requests. See
   324  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   325  	NullFields []string `json:"-"`
   326  }
   327  
   328  func (s *GoogleCloudPaymentsResellerSubscriptionV1Duration) MarshalJSON() ([]byte, error) {
   329  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1Duration
   330  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   331  }
   332  
   333  // GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest: Partner
   334  // request for entitling the previously provisioned subscription to an end
   335  // user. The end user identity is inferred from the request OAuth context.
   336  type GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest struct {
   337  	// LineItemEntitlementDetails: Optional. The line items to be entitled. If
   338  	// unspecified, all line items will be entitled.
   339  	LineItemEntitlementDetails []*GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequestLineItemEntitlementDetails `json:"lineItemEntitlementDetails,omitempty"`
   340  	// ForceSendFields is a list of field names (e.g. "LineItemEntitlementDetails")
   341  	// to unconditionally include in API requests. By default, fields with empty or
   342  	// default values are omitted from API requests. See
   343  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   344  	// details.
   345  	ForceSendFields []string `json:"-"`
   346  	// NullFields is a list of field names (e.g. "LineItemEntitlementDetails") to
   347  	// include in API requests with the JSON null value. By default, fields with
   348  	// empty values are omitted from API requests. See
   349  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   350  	NullFields []string `json:"-"`
   351  }
   352  
   353  func (s *GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest) MarshalJSON() ([]byte, error) {
   354  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest
   355  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   356  }
   357  
   358  // GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequestLineItemEn
   359  // titlementDetails: The details of the line item to be entitled.
   360  type GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequestLineItemEntitlementDetails struct {
   361  	// LineItemIndex: Required. The index of the line item to be entitled.
   362  	LineItemIndex int64 `json:"lineItemIndex,omitempty"`
   363  	// Products: Optional. Only applicable if the line item corresponds to a hard
   364  	// bundle. Product resource names that identify the bundle elements to be
   365  	// entitled in the line item. If unspecified, all bundle elements will be
   366  	// entitled. The format is 'partners/{partner_id}/products/{product_id}'.
   367  	Products []string `json:"products,omitempty"`
   368  	// ForceSendFields is a list of field names (e.g. "LineItemIndex") to
   369  	// unconditionally include in API requests. By default, fields with empty or
   370  	// default values are omitted from API requests. See
   371  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   372  	// details.
   373  	ForceSendFields []string `json:"-"`
   374  	// NullFields is a list of field names (e.g. "LineItemIndex") to include in API
   375  	// requests with the JSON null value. By default, fields with empty values are
   376  	// omitted from API requests. See
   377  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   378  	NullFields []string `json:"-"`
   379  }
   380  
   381  func (s *GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequestLineItemEntitlementDetails) MarshalJSON() ([]byte, error) {
   382  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequestLineItemEntitlementDetails
   383  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   384  }
   385  
   386  // GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse:
   387  // Response that contains the entitled subscription resource.
   388  type GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse struct {
   389  	// Subscription: The subscription that has user linked to it.
   390  	Subscription *GoogleCloudPaymentsResellerSubscriptionV1Subscription `json:"subscription,omitempty"`
   391  
   392  	// ServerResponse contains the HTTP response code and headers from the server.
   393  	googleapi.ServerResponse `json:"-"`
   394  	// ForceSendFields is a list of field names (e.g. "Subscription") to
   395  	// unconditionally include in API requests. By default, fields with empty or
   396  	// default values are omitted from API requests. See
   397  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   398  	// details.
   399  	ForceSendFields []string `json:"-"`
   400  	// NullFields is a list of field names (e.g. "Subscription") to include in API
   401  	// requests with the JSON null value. By default, fields with empty values are
   402  	// omitted from API requests. See
   403  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   404  	NullFields []string `json:"-"`
   405  }
   406  
   407  func (s *GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse) MarshalJSON() ([]byte, error) {
   408  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse
   409  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   410  }
   411  
   412  // GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest: Request
   413  // message for extending a Subscription resource. A new recurrence will be made
   414  // based on the subscription schedule defined by the original product.
   415  type GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest struct {
   416  	// Extension: Required. Specifies details of the extension. Currently, the
   417  	// duration of the extension must be exactly one billing cycle of the original
   418  	// subscription.
   419  	Extension *GoogleCloudPaymentsResellerSubscriptionV1Extension `json:"extension,omitempty"`
   420  	// RequestId: Required. Restricted to 36 ASCII characters. A random UUID is
   421  	// recommended. The idempotency key for the request. The ID generation logic is
   422  	// controlled by the partner. request_id should be the same as on retries of
   423  	// the same request. A different request_id must be used for a extension of a
   424  	// different cycle.
   425  	RequestId string `json:"requestId,omitempty"`
   426  	// ForceSendFields is a list of field names (e.g. "Extension") to
   427  	// unconditionally include in API requests. By default, fields with empty or
   428  	// default values are omitted from API requests. See
   429  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   430  	// details.
   431  	ForceSendFields []string `json:"-"`
   432  	// NullFields is a list of field names (e.g. "Extension") to include in API
   433  	// requests with the JSON null value. By default, fields with empty values are
   434  	// omitted from API requests. See
   435  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   436  	NullFields []string `json:"-"`
   437  }
   438  
   439  func (s *GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest) MarshalJSON() ([]byte, error) {
   440  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest
   441  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   442  }
   443  
   444  // GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse:
   445  // Response that contains the timestamps after the extension.
   446  type GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse struct {
   447  	// CycleEndTime: The time at which the subscription is expected to be extended,
   448  	// in ISO 8061 format. UTC timezone. Example,
   449  	// "cycleEndTime":"2019-08-31T17:28:54.564Z"
   450  	CycleEndTime string `json:"cycleEndTime,omitempty"`
   451  	// FreeTrialEndTime: End of the free trial period, in ISO 8061 format. UTC
   452  	// timezone. Example, "freeTrialEndTime":"2019-08-31T17:28:54.564Z" This time
   453  	// will be set the same as initial subscription creation time if no free trial
   454  	// period is offered to the partner.
   455  	FreeTrialEndTime string `json:"freeTrialEndTime,omitempty"`
   456  	// RenewalTime: Output only. The time at which the subscription is expected to
   457  	// be renewed by Google - a new charge will be incurred and the service
   458  	// entitlement will be renewed. A non-immediate cancellation will take place at
   459  	// this time too, before which, the service entitlement for the end user will
   460  	// remain valid. UTC timezone in ISO 8061 format. For example:
   461  	// "2019-08-31T17:28:54.564Z"
   462  	RenewalTime string `json:"renewalTime,omitempty"`
   463  
   464  	// ServerResponse contains the HTTP response code and headers from the server.
   465  	googleapi.ServerResponse `json:"-"`
   466  	// ForceSendFields is a list of field names (e.g. "CycleEndTime") to
   467  	// unconditionally include in API requests. By default, fields with empty or
   468  	// default values are omitted from API requests. See
   469  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   470  	// details.
   471  	ForceSendFields []string `json:"-"`
   472  	// NullFields is a list of field names (e.g. "CycleEndTime") to include in API
   473  	// requests with the JSON null value. By default, fields with empty values are
   474  	// omitted from API requests. See
   475  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   476  	NullFields []string `json:"-"`
   477  }
   478  
   479  func (s *GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse) MarshalJSON() ([]byte, error) {
   480  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse
   481  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   482  }
   483  
   484  // GoogleCloudPaymentsResellerSubscriptionV1Extension: Describes the details of
   485  // an extension request.
   486  type GoogleCloudPaymentsResellerSubscriptionV1Extension struct {
   487  	// Duration: Required. Specifies the period of access the subscription should
   488  	// grant.
   489  	Duration *GoogleCloudPaymentsResellerSubscriptionV1Duration `json:"duration,omitempty"`
   490  	// PartnerUserToken: Required. Identifier of the end-user in partner’s
   491  	// system.
   492  	PartnerUserToken string `json:"partnerUserToken,omitempty"`
   493  	// ForceSendFields is a list of field names (e.g. "Duration") to
   494  	// unconditionally include in API requests. By default, fields with empty or
   495  	// default values are omitted from API requests. See
   496  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   497  	// details.
   498  	ForceSendFields []string `json:"-"`
   499  	// NullFields is a list of field names (e.g. "Duration") to include in API
   500  	// requests with the JSON null value. By default, fields with empty values are
   501  	// omitted from API requests. See
   502  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   503  	NullFields []string `json:"-"`
   504  }
   505  
   506  func (s *GoogleCloudPaymentsResellerSubscriptionV1Extension) MarshalJSON() ([]byte, error) {
   507  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1Extension
   508  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   509  }
   510  
   511  // GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest:
   512  // Request to find eligible promotions for the current user.
   513  type GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest struct {
   514  	// Filter: Optional. Specifies the filters for the promotion results. The
   515  	// syntax is defined in https://google.aip.dev/160 with the following caveats:
   516  	// 1. Only the following features are supported: - Logical operator `AND` -
   517  	// Comparison operator `=` (no wildcards `*`) - Traversal operator `.` - Has
   518  	// operator `:` (no wildcards `*`) 2. Only the following fields are supported:
   519  	// - `applicableProducts` - `regionCodes` -
   520  	// `youtubePayload.partnerEligibilityId` - `youtubePayload.postalCode` 3.
   521  	// Unless explicitly mentioned above, other features are not supported.
   522  	// Example: `applicableProducts:partners/partner1/products/product1 AND
   523  	// regionCodes:US AND youtubePayload.postalCode=94043 AND
   524  	// youtubePayload.partnerEligibilityId=eligibility-id`
   525  	Filter string `json:"filter,omitempty"`
   526  	// PageSize: Optional. The maximum number of promotions to return. The service
   527  	// may return fewer than this value. If unspecified, at most 50 products will
   528  	// be returned. The maximum value is 1000; values above 1000 will be coerced to
   529  	// 1000.
   530  	PageSize int64 `json:"pageSize,omitempty"`
   531  	// PageToken: Optional. A page token, received from a previous `ListPromotions`
   532  	// call. Provide this to retrieve the subsequent page. When paginating, all
   533  	// other parameters provided to `ListPromotions` must match the call that
   534  	// provided the page token.
   535  	PageToken string `json:"pageToken,omitempty"`
   536  	// ForceSendFields is a list of field names (e.g. "Filter") to unconditionally
   537  	// include in API requests. By default, fields with empty or default values are
   538  	// omitted from API requests. See
   539  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   540  	// details.
   541  	ForceSendFields []string `json:"-"`
   542  	// NullFields is a list of field names (e.g. "Filter") to include in API
   543  	// requests with the JSON null value. By default, fields with empty values are
   544  	// omitted from API requests. See
   545  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   546  	NullFields []string `json:"-"`
   547  }
   548  
   549  func (s *GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest) MarshalJSON() ([]byte, error) {
   550  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest
   551  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   552  }
   553  
   554  // GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse:
   555  // Response containing the found promotions for the current user.
   556  type GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse struct {
   557  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   558  	// next page. If this field is empty, there are no subsequent pages.
   559  	NextPageToken string `json:"nextPageToken,omitempty"`
   560  	// Promotions: The promotions for the current user.
   561  	Promotions []*GoogleCloudPaymentsResellerSubscriptionV1Promotion `json:"promotions,omitempty"`
   562  
   563  	// ServerResponse contains the HTTP response code and headers from the server.
   564  	googleapi.ServerResponse `json:"-"`
   565  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   566  	// unconditionally include in API requests. By default, fields with empty or
   567  	// default values are omitted from API requests. See
   568  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   569  	// details.
   570  	ForceSendFields []string `json:"-"`
   571  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   572  	// requests with the JSON null value. By default, fields with empty values are
   573  	// omitted from API requests. See
   574  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   575  	NullFields []string `json:"-"`
   576  }
   577  
   578  func (s *GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse) MarshalJSON() ([]byte, error) {
   579  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse
   580  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   581  }
   582  
   583  // GoogleCloudPaymentsResellerSubscriptionV1FiniteBillingCycleDetails: Details
   584  // for a subscriptiin line item with finite billing cycles.
   585  type GoogleCloudPaymentsResellerSubscriptionV1FiniteBillingCycleDetails struct {
   586  	// BillingCycleCountLimit: Required. The number of a subscription line item
   587  	// billing cycles after which billing will stop automatically.
   588  	BillingCycleCountLimit int64 `json:"billingCycleCountLimit,omitempty,string"`
   589  	// ForceSendFields is a list of field names (e.g. "BillingCycleCountLimit") to
   590  	// unconditionally include in API requests. By default, fields with empty or
   591  	// default values are omitted from API requests. See
   592  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   593  	// details.
   594  	ForceSendFields []string `json:"-"`
   595  	// NullFields is a list of field names (e.g. "BillingCycleCountLimit") to
   596  	// include in API requests with the JSON null value. By default, fields with
   597  	// empty values are omitted from API requests. See
   598  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   599  	NullFields []string `json:"-"`
   600  }
   601  
   602  func (s *GoogleCloudPaymentsResellerSubscriptionV1FiniteBillingCycleDetails) MarshalJSON() ([]byte, error) {
   603  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1FiniteBillingCycleDetails
   604  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   605  }
   606  
   607  // GoogleCloudPaymentsResellerSubscriptionV1GoogleOnePayload: Payload specific
   608  // to Google One products.
   609  type GoogleCloudPaymentsResellerSubscriptionV1GoogleOnePayload struct {
   610  	// Campaigns: Campaign attributed to sales of this subscription.
   611  	Campaigns []string `json:"campaigns,omitempty"`
   612  	// Offering: The type of offering the subscription was sold by the partner.
   613  	// e.g. VAS.
   614  	//
   615  	// Possible values:
   616  	//   "OFFERING_UNSPECIFIED" - The type of partner offering is unspecified.
   617  	//   "OFFERING_VAS_BUNDLE" - Google One product purchased as a Value added
   618  	// service in addition to existing partner's products. Customer pays additional
   619  	// amount for Google One product.
   620  	//   "OFFERING_VAS_STANDALONE" - Google One product purchased by itself by
   621  	// customer as a value add service. Customer pays additional amount for Google
   622  	// One product.
   623  	//   "OFFERING_HARD_BUNDLE" - Product purchased as part of a hard bundle where
   624  	// Google One was included with the bundle. Google One pricing is included in
   625  	// the bundle.
   626  	//   "OFFERING_SOFT_BUNDLE" - Purchased as part of a bundle where Google One
   627  	// was provided as an option. Google One pricing is included in the bundle.
   628  	Offering string `json:"offering,omitempty"`
   629  	// SalesChannel: The type of sales channel through which the subscription was
   630  	// sold.
   631  	//
   632  	// Possible values:
   633  	//   "CHANNEL_UNSPECIFIED" - The channel type is unspecified.
   634  	//   "CHANNEL_RETAIL" - Sold at store.
   635  	//   "CHANNEL_ONLINE_WEB" - Sold through partner website.
   636  	//   "CHANNEL_ONLINE_ANDROID_APP" - Sold through partner android app.
   637  	//   "CHANNEL_ONLINE_IOS_APP" - Sold through partner iOS app.
   638  	SalesChannel string `json:"salesChannel,omitempty"`
   639  	// StoreId: The identifier for the partner store where the subscription was
   640  	// sold.
   641  	StoreId string `json:"storeId,omitempty"`
   642  	// ForceSendFields is a list of field names (e.g. "Campaigns") to
   643  	// unconditionally include in API requests. By default, fields with empty or
   644  	// default values are omitted from API requests. See
   645  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   646  	// details.
   647  	ForceSendFields []string `json:"-"`
   648  	// NullFields is a list of field names (e.g. "Campaigns") to include in API
   649  	// requests with the JSON null value. By default, fields with empty values are
   650  	// omitted from API requests. See
   651  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   652  	NullFields []string `json:"-"`
   653  }
   654  
   655  func (s *GoogleCloudPaymentsResellerSubscriptionV1GoogleOnePayload) MarshalJSON() ([]byte, error) {
   656  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1GoogleOnePayload
   657  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   658  }
   659  
   660  // GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse: Response that
   661  // contains the products.
   662  type GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse struct {
   663  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   664  	// next page. If this field is empty, there are no subsequent pages.
   665  	NextPageToken string `json:"nextPageToken,omitempty"`
   666  	// Products: The products for the specified partner.
   667  	Products []*GoogleCloudPaymentsResellerSubscriptionV1Product `json:"products,omitempty"`
   668  
   669  	// ServerResponse contains the HTTP response code and headers from the server.
   670  	googleapi.ServerResponse `json:"-"`
   671  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   672  	// unconditionally include in API requests. By default, fields with empty or
   673  	// default values are omitted from API requests. See
   674  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   675  	// details.
   676  	ForceSendFields []string `json:"-"`
   677  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   678  	// requests with the JSON null value. By default, fields with empty values are
   679  	// omitted from API requests. See
   680  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   681  	NullFields []string `json:"-"`
   682  }
   683  
   684  func (s *GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse) MarshalJSON() ([]byte, error) {
   685  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse
   686  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   687  }
   688  
   689  // GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse: Response
   690  // that contains the promotions.
   691  type GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse struct {
   692  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   693  	// next page. If this field is empty, there are no subsequent pages.
   694  	NextPageToken string `json:"nextPageToken,omitempty"`
   695  	// Promotions: The promotions for the specified partner.
   696  	Promotions []*GoogleCloudPaymentsResellerSubscriptionV1Promotion `json:"promotions,omitempty"`
   697  
   698  	// ServerResponse contains the HTTP response code and headers from the server.
   699  	googleapi.ServerResponse `json:"-"`
   700  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   701  	// unconditionally include in API requests. By default, fields with empty or
   702  	// default values are omitted from API requests. See
   703  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   704  	// details.
   705  	ForceSendFields []string `json:"-"`
   706  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   707  	// requests with the JSON null value. By default, fields with empty values are
   708  	// omitted from API requests. See
   709  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   710  	NullFields []string `json:"-"`
   711  }
   712  
   713  func (s *GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse) MarshalJSON() ([]byte, error) {
   714  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse
   715  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   716  }
   717  
   718  // GoogleCloudPaymentsResellerSubscriptionV1Location: Describes a location of
   719  // an end user.
   720  type GoogleCloudPaymentsResellerSubscriptionV1Location struct {
   721  	// PostalCode: The postal code this location refers to. Ex. "94043"
   722  	PostalCode string `json:"postalCode,omitempty"`
   723  	// RegionCode: 2-letter ISO region code for current content region. Ex.
   724  	// “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
   725  	RegionCode string `json:"regionCode,omitempty"`
   726  	// ForceSendFields is a list of field names (e.g. "PostalCode") to
   727  	// unconditionally include in API requests. By default, fields with empty or
   728  	// default values are omitted from API requests. See
   729  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   730  	// details.
   731  	ForceSendFields []string `json:"-"`
   732  	// NullFields is a list of field names (e.g. "PostalCode") to include in API
   733  	// requests with the JSON null value. By default, fields with empty values are
   734  	// omitted from API requests. See
   735  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   736  	NullFields []string `json:"-"`
   737  }
   738  
   739  func (s *GoogleCloudPaymentsResellerSubscriptionV1Location) MarshalJSON() ([]byte, error) {
   740  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1Location
   741  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   742  }
   743  
   744  // GoogleCloudPaymentsResellerSubscriptionV1Product: A Product resource that
   745  // defines a subscription service that can be resold.
   746  type GoogleCloudPaymentsResellerSubscriptionV1Product struct {
   747  	// BundleDetails: Output only. Output Only. Specifies the details for a bundle
   748  	// product.
   749  	BundleDetails *ProductBundleDetails `json:"bundleDetails,omitempty"`
   750  	// FiniteBillingCycleDetails: Optional. Details for a subscription line item
   751  	// with finite billing cycles. If unset, the line item will be charged
   752  	// indefinitely.
   753  	FiniteBillingCycleDetails *GoogleCloudPaymentsResellerSubscriptionV1FiniteBillingCycleDetails `json:"finiteBillingCycleDetails,omitempty"`
   754  	// Name: Identifier. Response only. Resource name of the product. It will have
   755  	// the format of "partners/{partner_id}/products/{product_id}"
   756  	Name string `json:"name,omitempty"`
   757  	// PriceConfigs: Output only. Price configs for the product in the available
   758  	// regions.
   759  	PriceConfigs []*GoogleCloudPaymentsResellerSubscriptionV1ProductPriceConfig `json:"priceConfigs,omitempty"`
   760  	// ProductType: Output only. Output Only. Specifies the type of the product.
   761  	//
   762  	// Possible values:
   763  	//   "PRODUCT_TYPE_UNSPECIFIED" - Unspecified. It's reserved as an unexpected
   764  	// value, should not be used.
   765  	//   "PRODUCT_TYPE_SUBSCRIPTION" - The product is a subscription.
   766  	//   "PRODUCT_TYPE_BUNDLE_SUBSCRIPTION" - The product is a bundled subscription
   767  	// plan, which includes multiple subscription elements.
   768  	ProductType string `json:"productType,omitempty"`
   769  	// RegionCodes: Output only. 2-letter ISO region code where the product is
   770  	// available in. Ex. "US" Please refers to:
   771  	// https://en.wikipedia.org/wiki/ISO_3166-1
   772  	RegionCodes []string `json:"regionCodes,omitempty"`
   773  	// SubscriptionBillingCycleDuration: Output only. Specifies the length of the
   774  	// billing cycle of the subscription.
   775  	SubscriptionBillingCycleDuration *GoogleCloudPaymentsResellerSubscriptionV1Duration `json:"subscriptionBillingCycleDuration,omitempty"`
   776  	// Titles: Output only. Localized human readable name of the product.
   777  	Titles []*GoogleTypeLocalizedText `json:"titles,omitempty"`
   778  	// ForceSendFields is a list of field names (e.g. "BundleDetails") to
   779  	// unconditionally include in API requests. By default, fields with empty or
   780  	// default values are omitted from API requests. See
   781  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   782  	// details.
   783  	ForceSendFields []string `json:"-"`
   784  	// NullFields is a list of field names (e.g. "BundleDetails") to include in API
   785  	// requests with the JSON null value. By default, fields with empty values are
   786  	// omitted from API requests. See
   787  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   788  	NullFields []string `json:"-"`
   789  }
   790  
   791  func (s *GoogleCloudPaymentsResellerSubscriptionV1Product) MarshalJSON() ([]byte, error) {
   792  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1Product
   793  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   794  }
   795  
   796  // GoogleCloudPaymentsResellerSubscriptionV1ProductBundleDetailsBundleElement:
   797  // The individual product that is included in the bundle.
   798  type GoogleCloudPaymentsResellerSubscriptionV1ProductBundleDetailsBundleElement struct {
   799  	// Product: Required. Output only. Product resource name that identifies the
   800  	// bundle element. The format is 'partners/{partner_id}/products/{product_id}'.
   801  	Product string `json:"product,omitempty"`
   802  	// ForceSendFields is a list of field names (e.g. "Product") to unconditionally
   803  	// include in API requests. By default, fields with empty or default values are
   804  	// omitted from API requests. See
   805  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   806  	// details.
   807  	ForceSendFields []string `json:"-"`
   808  	// NullFields is a list of field names (e.g. "Product") to include in API
   809  	// requests with the JSON null value. By default, fields with empty values are
   810  	// omitted from API requests. See
   811  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   812  	NullFields []string `json:"-"`
   813  }
   814  
   815  func (s *GoogleCloudPaymentsResellerSubscriptionV1ProductBundleDetailsBundleElement) MarshalJSON() ([]byte, error) {
   816  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ProductBundleDetailsBundleElement
   817  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   818  }
   819  
   820  // GoogleCloudPaymentsResellerSubscriptionV1ProductPayload: Specifies product
   821  // specific payload.
   822  type GoogleCloudPaymentsResellerSubscriptionV1ProductPayload struct {
   823  	// GoogleOnePayload: Product-specific payloads. Payload specific to Google One
   824  	// products.
   825  	GoogleOnePayload *GoogleCloudPaymentsResellerSubscriptionV1GoogleOnePayload `json:"googleOnePayload,omitempty"`
   826  	// YoutubePayload: Payload specific to Youtube products.
   827  	YoutubePayload *GoogleCloudPaymentsResellerSubscriptionV1YoutubePayload `json:"youtubePayload,omitempty"`
   828  	// ForceSendFields is a list of field names (e.g. "GoogleOnePayload") to
   829  	// unconditionally include in API requests. By default, fields with empty or
   830  	// default values are omitted from API requests. See
   831  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   832  	// details.
   833  	ForceSendFields []string `json:"-"`
   834  	// NullFields is a list of field names (e.g. "GoogleOnePayload") to include in
   835  	// API requests with the JSON null value. By default, fields with empty values
   836  	// are omitted from API requests. See
   837  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   838  	NullFields []string `json:"-"`
   839  }
   840  
   841  func (s *GoogleCloudPaymentsResellerSubscriptionV1ProductPayload) MarshalJSON() ([]byte, error) {
   842  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ProductPayload
   843  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   844  }
   845  
   846  // GoogleCloudPaymentsResellerSubscriptionV1ProductPriceConfig: Configs the
   847  // prices in an available region.
   848  type GoogleCloudPaymentsResellerSubscriptionV1ProductPriceConfig struct {
   849  	// Amount: Output only. The price in the region.
   850  	Amount *GoogleCloudPaymentsResellerSubscriptionV1Amount `json:"amount,omitempty"`
   851  	// RegionCode: Output only. 2-letter ISO region code where the product is
   852  	// available in. Ex. "US".
   853  	RegionCode string `json:"regionCode,omitempty"`
   854  	// ForceSendFields is a list of field names (e.g. "Amount") to unconditionally
   855  	// include in API requests. By default, fields with empty or default values are
   856  	// omitted from API requests. See
   857  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   858  	// details.
   859  	ForceSendFields []string `json:"-"`
   860  	// NullFields is a list of field names (e.g. "Amount") to include in API
   861  	// requests with the JSON null value. By default, fields with empty values are
   862  	// omitted from API requests. See
   863  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   864  	NullFields []string `json:"-"`
   865  }
   866  
   867  func (s *GoogleCloudPaymentsResellerSubscriptionV1ProductPriceConfig) MarshalJSON() ([]byte, error) {
   868  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ProductPriceConfig
   869  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   870  }
   871  
   872  // GoogleCloudPaymentsResellerSubscriptionV1Promotion: A Promotion resource
   873  // that defines a promotion for a subscription that can be resold.
   874  type GoogleCloudPaymentsResellerSubscriptionV1Promotion struct {
   875  	// ApplicableProducts: Output only. The product ids this promotion can be
   876  	// applied to.
   877  	ApplicableProducts []string `json:"applicableProducts,omitempty"`
   878  	// EndTime: Optional. Specifies the end time (exclusive) of the period that the
   879  	// promotion is available in. If unset, the promotion is available
   880  	// indefinitely.
   881  	EndTime string `json:"endTime,omitempty"`
   882  	// FreeTrialDuration: Optional. Specifies the duration of the free trial of the
   883  	// subscription when promotion_type is PROMOTION_TYPE_FREE_TRIAL
   884  	FreeTrialDuration *GoogleCloudPaymentsResellerSubscriptionV1Duration `json:"freeTrialDuration,omitempty"`
   885  	// IntroductoryPricingDetails: Optional. Specifies the introductory pricing
   886  	// details when the promotion_type is PROMOTION_TYPE_INTRODUCTORY_PRICING.
   887  	IntroductoryPricingDetails *GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetails `json:"introductoryPricingDetails,omitempty"`
   888  	// Name: Identifier. Response only. Resource name of the subscription
   889  	// promotion. It will have the format of
   890  	// "partners/{partner_id}/promotion/{promotion_id}"
   891  	Name string `json:"name,omitempty"`
   892  	// PromotionType: Output only. Output Only. Specifies the type of the
   893  	// promotion.
   894  	//
   895  	// Possible values:
   896  	//   "PROMOTION_TYPE_UNSPECIFIED" - The promotion type is unspecified.
   897  	//   "PROMOTION_TYPE_FREE_TRIAL" - The promotion is a free trial.
   898  	//   "PROMOTION_TYPE_INTRODUCTORY_PRICING" - The promotion is a reduced
   899  	// introductory pricing.
   900  	PromotionType string `json:"promotionType,omitempty"`
   901  	// RegionCodes: Output only. 2-letter ISO region code where the promotion is
   902  	// available in. Ex. "US" Please refers to:
   903  	// https://en.wikipedia.org/wiki/ISO_3166-1
   904  	RegionCodes []string `json:"regionCodes,omitempty"`
   905  	// StartTime: Optional. Specifies the start time (inclusive) of the period that
   906  	// the promotion is available in.
   907  	StartTime string `json:"startTime,omitempty"`
   908  	// Titles: Output only. Localized human readable name of the promotion.
   909  	Titles []*GoogleTypeLocalizedText `json:"titles,omitempty"`
   910  	// ForceSendFields is a list of field names (e.g. "ApplicableProducts") to
   911  	// unconditionally include in API requests. By default, fields with empty or
   912  	// default values are omitted from API requests. See
   913  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   914  	// details.
   915  	ForceSendFields []string `json:"-"`
   916  	// NullFields is a list of field names (e.g. "ApplicableProducts") to include
   917  	// in API requests with the JSON null value. By default, fields with empty
   918  	// values are omitted from API requests. See
   919  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   920  	NullFields []string `json:"-"`
   921  }
   922  
   923  func (s *GoogleCloudPaymentsResellerSubscriptionV1Promotion) MarshalJSON() ([]byte, error) {
   924  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1Promotion
   925  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   926  }
   927  
   928  // GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetails:
   929  //
   930  //	The details of a introductory pricing promotion.
   931  type GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetails struct {
   932  	// IntroductoryPricingSpecs: Output only. Specifies the introductory pricing
   933  	// periods.
   934  	IntroductoryPricingSpecs []*GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetailsIntroductoryPricingSpec `json:"introductoryPricingSpecs,omitempty"`
   935  	// ForceSendFields is a list of field names (e.g. "IntroductoryPricingSpecs")
   936  	// to unconditionally include in API requests. By default, fields with empty or
   937  	// default values are omitted from API requests. See
   938  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   939  	// details.
   940  	ForceSendFields []string `json:"-"`
   941  	// NullFields is a list of field names (e.g. "IntroductoryPricingSpecs") to
   942  	// include in API requests with the JSON null value. By default, fields with
   943  	// empty values are omitted from API requests. See
   944  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   945  	NullFields []string `json:"-"`
   946  }
   947  
   948  func (s *GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetails) MarshalJSON() ([]byte, error) {
   949  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetails
   950  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   951  }
   952  
   953  // GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetailsI
   954  // ntroductoryPricingSpec: The duration of an introductory pricing promotion.
   955  type GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetailsIntroductoryPricingSpec struct {
   956  	// DiscountAmount: Output only. The discount amount. The value is positive.
   957  	DiscountAmount *GoogleCloudPaymentsResellerSubscriptionV1Amount `json:"discountAmount,omitempty"`
   958  	// DiscountRatioMicros: Output only. The discount percentage in micros. For
   959  	// example, 50,000 represents 5%.
   960  	DiscountRatioMicros int64 `json:"discountRatioMicros,omitempty,string"`
   961  	// RecurrenceCount: Output only. Output Only. The duration of an introductory
   962  	// offer in billing cycles.
   963  	RecurrenceCount int64 `json:"recurrenceCount,omitempty"`
   964  	// RegionCode: Output only. 2-letter ISO region code where the product is
   965  	// available in. Ex. "US".
   966  	RegionCode string `json:"regionCode,omitempty"`
   967  	// ForceSendFields is a list of field names (e.g. "DiscountAmount") to
   968  	// unconditionally include in API requests. By default, fields with empty or
   969  	// default values are omitted from API requests. See
   970  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   971  	// details.
   972  	ForceSendFields []string `json:"-"`
   973  	// NullFields is a list of field names (e.g. "DiscountAmount") to include in
   974  	// API requests with the JSON null value. By default, fields with empty values
   975  	// are omitted from API requests. See
   976  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   977  	NullFields []string `json:"-"`
   978  }
   979  
   980  func (s *GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetailsIntroductoryPricingSpec) MarshalJSON() ([]byte, error) {
   981  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetailsIntroductoryPricingSpec
   982  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   983  }
   984  
   985  // GoogleCloudPaymentsResellerSubscriptionV1ServicePeriod: A description of
   986  // what time period or moment in time the product or service is being delivered
   987  // over.
   988  type GoogleCloudPaymentsResellerSubscriptionV1ServicePeriod struct {
   989  	// EndTime: Optional. The end time of the service period. Time is exclusive.
   990  	EndTime string `json:"endTime,omitempty"`
   991  	// StartTime: Required. The start time of the service period. Time is
   992  	// inclusive.
   993  	StartTime string `json:"startTime,omitempty"`
   994  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   995  	// include in API requests. By default, fields with empty or default values are
   996  	// omitted from API requests. See
   997  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   998  	// details.
   999  	ForceSendFields []string `json:"-"`
  1000  	// NullFields is a list of field names (e.g. "EndTime") to include in API
  1001  	// requests with the JSON null value. By default, fields with empty values are
  1002  	// omitted from API requests. See
  1003  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1004  	NullFields []string `json:"-"`
  1005  }
  1006  
  1007  func (s *GoogleCloudPaymentsResellerSubscriptionV1ServicePeriod) MarshalJSON() ([]byte, error) {
  1008  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1ServicePeriod
  1009  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1010  }
  1011  
  1012  // GoogleCloudPaymentsResellerSubscriptionV1Subscription: A subscription serves
  1013  // as a central billing entity between an external partner and Google. The
  1014  // underlying Google services rely on the subscription state to grant or revoke
  1015  // the user's service entitlement. It's important to note that the subscription
  1016  // state may not always perfectly align with the user's service entitlement.
  1017  // For example, some Google services may continue providing access to the user
  1018  // until the current billing cycle ends, even if the subscription has been
  1019  // immediately canceled. However, other services may not do the same. To fully
  1020  // understand the specific details, please consult the relevant contract or
  1021  // product policy.
  1022  type GoogleCloudPaymentsResellerSubscriptionV1Subscription struct {
  1023  	// CancellationDetails: Output only. Describes the details of a cancelled
  1024  	// subscription. Only applicable to subscription of state `STATE_CANCELLED`.
  1025  	CancellationDetails *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails `json:"cancellationDetails,omitempty"`
  1026  	// CreateTime: Output only. System generated timestamp when the subscription is
  1027  	// created. UTC timezone.
  1028  	CreateTime string `json:"createTime,omitempty"`
  1029  	// CycleEndTime: Output only. The time at which the subscription is expected to
  1030  	// be extended, in ISO 8061 format. UTC timezone. For example:
  1031  	// "2019-08-31T17:28:54.564Z"
  1032  	CycleEndTime string `json:"cycleEndTime,omitempty"`
  1033  	// EndUserEntitled: Output only. Indicates if the subscription is entitled to
  1034  	// the end user.
  1035  	EndUserEntitled bool `json:"endUserEntitled,omitempty"`
  1036  	// FreeTrialEndTime: Output only. End of the free trial period, in ISO 8061
  1037  	// format. For example, "2019-08-31T17:28:54.564Z". It will be set the same as
  1038  	// createTime if no free trial promotion is specified.
  1039  	FreeTrialEndTime string `json:"freeTrialEndTime,omitempty"`
  1040  	// LineItems: Required. The line items of the subscription.
  1041  	LineItems []*GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItem `json:"lineItems,omitempty"`
  1042  	// Name: Identifier. Resource name of the subscription. It will have the format
  1043  	// of "partners/{partner_id}/subscriptions/{subscription_id}". This is
  1044  	// available for authorizeAddon, but otherwise is response only.
  1045  	Name string `json:"name,omitempty"`
  1046  	// PartnerUserToken: Required. Identifier of the end-user in partner’s
  1047  	// system. The value is restricted to 63 ASCII characters at the maximum.
  1048  	PartnerUserToken string `json:"partnerUserToken,omitempty"`
  1049  	// ProcessingState: Output only. Describes the processing state of the
  1050  	// subscription. See more details at the lifecycle of a subscription
  1051  	// (/payments/reseller/subscription/reference/index/Receive.Notifications#paymen
  1052  	// ts-subscription-lifecycle).
  1053  	//
  1054  	// Possible values:
  1055  	//   "PROCESSING_STATE_UNSPECIFIED" - The processing state is unspecified.
  1056  	//   "PROCESSING_STATE_CANCELLING" - The subscription is being cancelled.
  1057  	//   "PROCESSING_STATE_RECURRING" - The subscription is recurring.
  1058  	ProcessingState string `json:"processingState,omitempty"`
  1059  	// Products: Optional. Deprecated: consider using `line_items` as the input.
  1060  	// Required. Resource name that identifies the purchased products. The format
  1061  	// will be 'partners/{partner_id}/products/{product_id}'.
  1062  	Products []string `json:"products,omitempty"`
  1063  	// PromotionSpecs: Optional. Subscription-level promotions. Only free trial is
  1064  	// supported on this level. It determines the first renewal time of the
  1065  	// subscription to be the end of the free trial period. Specify the promotion
  1066  	// resource name only when used as input.
  1067  	PromotionSpecs []*GoogleCloudPaymentsResellerSubscriptionV1SubscriptionPromotionSpec `json:"promotionSpecs,omitempty"`
  1068  	// Promotions: Optional. Deprecated: consider using the top-level
  1069  	// `promotion_specs` as the input. Optional. Resource name that identifies one
  1070  	// or more promotions that can be applied on the product. A typical promotion
  1071  	// for a subscription is Free trial. The format will be
  1072  	// 'partners/{partner_id}/promotions/{promotion_id}'.
  1073  	Promotions []string `json:"promotions,omitempty"`
  1074  	// PurchaseTime: Optional. The timestamp when the user transaction was made
  1075  	// with the Partner. Specify for the case of "bundle with choice", and it must
  1076  	// be before the provision_time (when the user makes a selection).
  1077  	PurchaseTime string `json:"purchaseTime,omitempty"`
  1078  	// RedirectUri: Output only. The place where partners should redirect the
  1079  	// end-user to after creation. This field might also be populated when creation
  1080  	// failed. However, Partners should always prepare a default URL to redirect
  1081  	// the user in case this field is empty.
  1082  	RedirectUri string `json:"redirectUri,omitempty"`
  1083  	// RenewalTime: Output only. The time at which the subscription is expected to
  1084  	// be renewed by Google - a new charge will be incurred and the service
  1085  	// entitlement will be renewed. A non-immediate cancellation will take place at
  1086  	// this time too, before which, the service entitlement for the end user will
  1087  	// remain valid. UTC timezone in ISO 8061 format. For example:
  1088  	// "2019-08-31T17:28:54.564Z"
  1089  	RenewalTime string `json:"renewalTime,omitempty"`
  1090  	// ServiceLocation: Required. The location that the service is provided as
  1091  	// indicated by the partner.
  1092  	ServiceLocation *GoogleCloudPaymentsResellerSubscriptionV1Location `json:"serviceLocation,omitempty"`
  1093  	// State: Output only. Describes the state of the subscription. See more
  1094  	// details at the lifecycle of a subscription
  1095  	// (/payments/reseller/subscription/reference/index/Receive.Notifications#paymen
  1096  	// ts-subscription-lifecycle).
  1097  	//
  1098  	// Possible values:
  1099  	//   "STATE_UNSPECIFIED" - The state is unspecified.
  1100  	//   "STATE_CREATED" - The subscription is created, a state before it is moved
  1101  	// to STATE_ACTIVE.
  1102  	//   "STATE_ACTIVE" - The subscription is active.
  1103  	//   "STATE_CANCELLED" - The subscription is cancelled. This is the final state
  1104  	// of the subscription, as it can no longer be modified or reactivated.
  1105  	//   "STATE_IN_GRACE_PERIOD" - The subscription is in grace period. It can
  1106  	// happen: 1) in manual extend mode, the subscription is not extended by the
  1107  	// partner at the end of current cycle. 2) for outbound authorization enabled
  1108  	// partners, a renewal purchase order is rejected.
  1109  	//   "STATE_CANCEL_AT_END_OF_CYCLE" - The subscription is waiting to be
  1110  	// cancelled by the next recurrence cycle.
  1111  	//   "STATE_SUSPENDED" - The subscription is suspended.
  1112  	State string `json:"state,omitempty"`
  1113  	// UpdateTime: Output only. System generated timestamp when the subscription is
  1114  	// most recently updated. UTC timezone.
  1115  	UpdateTime string `json:"updateTime,omitempty"`
  1116  	// UpgradeDowngradeDetails: Optional. Details about the previous subscription
  1117  	// that this new subscription upgrades/downgrades from. Only populated if this
  1118  	// subscription is an upgrade/downgrade from another subscription.
  1119  	UpgradeDowngradeDetails *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionUpgradeDowngradeDetails `json:"upgradeDowngradeDetails,omitempty"`
  1120  
  1121  	// ServerResponse contains the HTTP response code and headers from the server.
  1122  	googleapi.ServerResponse `json:"-"`
  1123  	// ForceSendFields is a list of field names (e.g. "CancellationDetails") to
  1124  	// unconditionally include in API requests. By default, fields with empty or
  1125  	// default values are omitted from API requests. See
  1126  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1127  	// details.
  1128  	ForceSendFields []string `json:"-"`
  1129  	// NullFields is a list of field names (e.g. "CancellationDetails") to include
  1130  	// in API requests with the JSON null value. By default, fields with empty
  1131  	// values are omitted from API requests. See
  1132  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1133  	NullFields []string `json:"-"`
  1134  }
  1135  
  1136  func (s *GoogleCloudPaymentsResellerSubscriptionV1Subscription) MarshalJSON() ([]byte, error) {
  1137  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1Subscription
  1138  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1139  }
  1140  
  1141  // GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails:
  1142  // Describes the details of a cancelled or cancelling subscription.
  1143  type GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails struct {
  1144  	// Reason: Output only. The reason of the cancellation.
  1145  	//
  1146  	// Possible values:
  1147  	//   "CANCELLATION_REASON_UNSPECIFIED" - Reason is unspecified.
  1148  	//   "CANCELLATION_REASON_FRAUD" - Fraudualant transaction.
  1149  	//   "CANCELLATION_REASON_REMORSE" - Buyer's remorse.
  1150  	//   "CANCELLATION_REASON_ACCIDENTAL_PURCHASE" - Accidential purchase.
  1151  	//   "CANCELLATION_REASON_PAST_DUE" - Payment is past due.
  1152  	//   "CANCELLATION_REASON_ACCOUNT_CLOSED" - Used for notification only, do not
  1153  	// use in Cancel API. User account closed.
  1154  	//   "CANCELLATION_REASON_UPGRADE_DOWNGRADE" - Used for notification only, do
  1155  	// not use in Cancel API. Cancellation due to upgrade or downgrade.
  1156  	//   "CANCELLATION_REASON_USER_DELINQUENCY" - Cancellation due to user
  1157  	// delinquency
  1158  	//   "CANCELLATION_REASON_SYSTEM_ERROR" - Used for notification only, do not
  1159  	// use in Cancel API. Cancellation due to an unrecoverable system error.
  1160  	//   "CANCELLATION_REASON_SYSTEM_CANCEL" - Used for notification only, do not
  1161  	// use in Cancel API. The subscription is cancelled by Google automatically
  1162  	// since it is no longer valid.
  1163  	//   "CANCELLATION_REASON_OTHER" - Other reason.
  1164  	Reason string `json:"reason,omitempty"`
  1165  	// ForceSendFields is a list of field names (e.g. "Reason") to unconditionally
  1166  	// include in API requests. By default, fields with empty or default values are
  1167  	// omitted from API requests. See
  1168  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1169  	// details.
  1170  	ForceSendFields []string `json:"-"`
  1171  	// NullFields is a list of field names (e.g. "Reason") to include in API
  1172  	// requests with the JSON null value. By default, fields with empty values are
  1173  	// omitted from API requests. See
  1174  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1175  	NullFields []string `json:"-"`
  1176  }
  1177  
  1178  func (s *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails) MarshalJSON() ([]byte, error) {
  1179  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails
  1180  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1181  }
  1182  
  1183  // GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItem: Individual
  1184  // line item definition of a subscription.
  1185  type GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItem struct {
  1186  	// Amount: Output only. The price of the product/service in this line item. The
  1187  	// amount could be the wholesale price, or it can include a cost of sale based
  1188  	// on the contract.
  1189  	Amount *GoogleCloudPaymentsResellerSubscriptionV1Amount `json:"amount,omitempty"`
  1190  	// BundleDetails: Output only. The bundle details for the line item. Only
  1191  	// populated if the line item corresponds to a hard bundle.
  1192  	BundleDetails *SubscriptionLineItemBundleDetails `json:"bundleDetails,omitempty"`
  1193  	// Description: Output only. Description of this line item.
  1194  	Description string `json:"description,omitempty"`
  1195  	// FiniteBillingCycleDetails: Optional. Details for a subscription line item
  1196  	// with finite billing cycles. If unset, the line item will be charged
  1197  	// indefinitely. Used only with LINE_ITEM_RECURRENCE_TYPE_PERIODIC.
  1198  	FiniteBillingCycleDetails *GoogleCloudPaymentsResellerSubscriptionV1FiniteBillingCycleDetails `json:"finiteBillingCycleDetails,omitempty"`
  1199  	// LineItemFreeTrialEndTime: Output only. The free trial end time will be
  1200  	// populated after the line item is successfully processed. End time of the
  1201  	// line item free trial period, in ISO 8061 format. For example,
  1202  	// "2019-08-31T17:28:54.564Z". It will be set the same as createTime if no free
  1203  	// trial promotion is specified.
  1204  	LineItemFreeTrialEndTime string `json:"lineItemFreeTrialEndTime,omitempty"`
  1205  	// LineItemIndex: Output only. A unique index of the subscription line item.
  1206  	LineItemIndex int64 `json:"lineItemIndex,omitempty"`
  1207  	// LineItemPromotionSpecs: Optional. The promotions applied on the line item.
  1208  	// It can be: - an introductory pricing promotion. - a free trial promotion.
  1209  	// This feature is not enabled. If used, the request will be rejected. When
  1210  	// used as input in Create or Provision API, specify its resource name only.
  1211  	LineItemPromotionSpecs []*GoogleCloudPaymentsResellerSubscriptionV1SubscriptionPromotionSpec `json:"lineItemPromotionSpecs,omitempty"`
  1212  	// OneTimeRecurrenceDetails: Output only. Details only set for a ONE_TIME
  1213  	// recurrence line item.
  1214  	OneTimeRecurrenceDetails *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemOneTimeRecurrenceDetails `json:"oneTimeRecurrenceDetails,omitempty"`
  1215  	// Product: Required. Product resource name that identifies one the line item
  1216  	// The format is 'partners/{partner_id}/products/{product_id}'.
  1217  	Product string `json:"product,omitempty"`
  1218  	// ProductPayload: Optional. Product specific payload for this line item.
  1219  	ProductPayload *GoogleCloudPaymentsResellerSubscriptionV1ProductPayload `json:"productPayload,omitempty"`
  1220  	// RecurrenceType: Output only. The recurrence type of the line item.
  1221  	//
  1222  	// Possible values:
  1223  	//   "LINE_ITEM_RECURRENCE_TYPE_UNSPECIFIED" - The line item recurrence type is
  1224  	// unspecified.
  1225  	//   "LINE_ITEM_RECURRENCE_TYPE_PERIODIC" - The line item recurs periodically.
  1226  	//   "LINE_ITEM_RECURRENCE_TYPE_ONE_TIME" - The line item does not recur in the
  1227  	// future.
  1228  	RecurrenceType string `json:"recurrenceType,omitempty"`
  1229  	// State: Output only. The state of the line item.
  1230  	//
  1231  	// Possible values:
  1232  	//   "LINE_ITEM_STATE_UNSPECIFIED" - Unspecified state.
  1233  	//   "LINE_ITEM_STATE_ACTIVE" - The line item is in ACTIVE state. If the
  1234  	// subscription is cancelled or suspended, the line item will not be charged
  1235  	// even if the line item is active.
  1236  	//   "LINE_ITEM_STATE_INACTIVE" - The line item is in INACTIVE state.
  1237  	//   "LINE_ITEM_STATE_NEW" - The line item is new, and is not activated or
  1238  	// charged yet.
  1239  	//   "LINE_ITEM_STATE_ACTIVATING" - The line item is being activated in order
  1240  	// to be charged. If a free trial applies to the line item, the line item is
  1241  	// pending a prorated charge at the end of the free trial period, as indicated
  1242  	// by `line_item_free_trial_end_time`.
  1243  	//   "LINE_ITEM_STATE_DEACTIVATING" - The line item is being deactivated, and a
  1244  	// prorated refund in being processed.
  1245  	//   "LINE_ITEM_STATE_WAITING_TO_DEACTIVATE" - The line item is scheduled to be
  1246  	// deactivated at the end of the current cycle.
  1247  	//   "LINE_ITEM_STATE_OFF_CYCLE_CHARGING" - Line item is being charged
  1248  	// off-cycle.
  1249  	State string `json:"state,omitempty"`
  1250  	// ForceSendFields is a list of field names (e.g. "Amount") to unconditionally
  1251  	// include in API requests. By default, fields with empty or default values are
  1252  	// omitted from API requests. See
  1253  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1254  	// details.
  1255  	ForceSendFields []string `json:"-"`
  1256  	// NullFields is a list of field names (e.g. "Amount") to include in API
  1257  	// requests with the JSON null value. By default, fields with empty values are
  1258  	// omitted from API requests. See
  1259  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1260  	NullFields []string `json:"-"`
  1261  }
  1262  
  1263  func (s *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItem) MarshalJSON() ([]byte, error) {
  1264  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItem
  1265  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1266  }
  1267  
  1268  // GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemBundleDetailsBun
  1269  // dleElementDetails: The details for an element in the hard bundle.
  1270  type GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemBundleDetailsBundleElementDetails struct {
  1271  	// Product: Output only. Product resource name that identifies the bundle
  1272  	// element. The format is 'partners/{partner_id}/products/{product_id}'.
  1273  	Product string `json:"product,omitempty"`
  1274  	// UserAccountLinkedTime: Output only. The time when this product is linked to
  1275  	// an end user.
  1276  	UserAccountLinkedTime string `json:"userAccountLinkedTime,omitempty"`
  1277  	// ForceSendFields is a list of field names (e.g. "Product") to unconditionally
  1278  	// include in API requests. By default, fields with empty or default values are
  1279  	// omitted from API requests. See
  1280  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1281  	// details.
  1282  	ForceSendFields []string `json:"-"`
  1283  	// NullFields is a list of field names (e.g. "Product") to include in API
  1284  	// requests with the JSON null value. By default, fields with empty values are
  1285  	// omitted from API requests. See
  1286  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1287  	NullFields []string `json:"-"`
  1288  }
  1289  
  1290  func (s *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemBundleDetailsBundleElementDetails) MarshalJSON() ([]byte, error) {
  1291  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemBundleDetailsBundleElementDetails
  1292  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1293  }
  1294  
  1295  // GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemOneTimeRecurrenc
  1296  // eDetails: Details for a ONE_TIME recurrence line item.
  1297  type GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemOneTimeRecurrenceDetails struct {
  1298  	// ServicePeriod: Output only. The service period of the ONE_TIME line item.
  1299  	ServicePeriod *GoogleCloudPaymentsResellerSubscriptionV1ServicePeriod `json:"servicePeriod,omitempty"`
  1300  	// ForceSendFields is a list of field names (e.g. "ServicePeriod") to
  1301  	// unconditionally include in API requests. By default, fields with empty or
  1302  	// default values are omitted from API requests. See
  1303  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1304  	// details.
  1305  	ForceSendFields []string `json:"-"`
  1306  	// NullFields is a list of field names (e.g. "ServicePeriod") to include in API
  1307  	// requests with the JSON null value. By default, fields with empty values are
  1308  	// omitted from API requests. See
  1309  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1310  	NullFields []string `json:"-"`
  1311  }
  1312  
  1313  func (s *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemOneTimeRecurrenceDetails) MarshalJSON() ([]byte, error) {
  1314  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemOneTimeRecurrenceDetails
  1315  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1316  }
  1317  
  1318  // GoogleCloudPaymentsResellerSubscriptionV1SubscriptionPromotionSpec:
  1319  // Describes the spec for one promotion.
  1320  type GoogleCloudPaymentsResellerSubscriptionV1SubscriptionPromotionSpec struct {
  1321  	// FreeTrialDuration: Output only. The duration of the free trial if the
  1322  	// promotion is of type FREE_TRIAL.
  1323  	FreeTrialDuration *GoogleCloudPaymentsResellerSubscriptionV1Duration `json:"freeTrialDuration,omitempty"`
  1324  	// IntroductoryPricingDetails: Output only. The details of the introductory
  1325  	// pricing spec if the promotion is of type INTRODUCTORY_PRICING.
  1326  	IntroductoryPricingDetails *GoogleCloudPaymentsResellerSubscriptionV1PromotionIntroductoryPricingDetails `json:"introductoryPricingDetails,omitempty"`
  1327  	// Promotion: Required. Promotion resource name that identifies a promotion.
  1328  	// The format is 'partners/{partner_id}/promotions/{promotion_id}'.
  1329  	Promotion string `json:"promotion,omitempty"`
  1330  	// Type: Output only. The type of the promotion for the spec.
  1331  	//
  1332  	// Possible values:
  1333  	//   "PROMOTION_TYPE_UNSPECIFIED" - The promotion type is unspecified.
  1334  	//   "PROMOTION_TYPE_FREE_TRIAL" - The promotion is a free trial.
  1335  	//   "PROMOTION_TYPE_INTRODUCTORY_PRICING" - The promotion is a reduced
  1336  	// introductory pricing.
  1337  	Type string `json:"type,omitempty"`
  1338  	// ForceSendFields is a list of field names (e.g. "FreeTrialDuration") to
  1339  	// unconditionally include in API requests. By default, fields with empty or
  1340  	// default values are omitted from API requests. See
  1341  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1342  	// details.
  1343  	ForceSendFields []string `json:"-"`
  1344  	// NullFields is a list of field names (e.g. "FreeTrialDuration") to include in
  1345  	// API requests with the JSON null value. By default, fields with empty values
  1346  	// are omitted from API requests. See
  1347  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1348  	NullFields []string `json:"-"`
  1349  }
  1350  
  1351  func (s *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionPromotionSpec) MarshalJSON() ([]byte, error) {
  1352  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1SubscriptionPromotionSpec
  1353  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1354  }
  1355  
  1356  // GoogleCloudPaymentsResellerSubscriptionV1SubscriptionUpgradeDowngradeDetails:
  1357  //
  1358  //	Details about the previous subscription that this new subscription
  1359  //
  1360  // upgrades/downgrades from.
  1361  type GoogleCloudPaymentsResellerSubscriptionV1SubscriptionUpgradeDowngradeDetails struct {
  1362  	// BillingCycleSpec: Required. Specifies the billing cycle spec for the new
  1363  	// upgraded/downgraded subscription.
  1364  	//
  1365  	// Possible values:
  1366  	//   "BILLING_CYCLE_SPEC_UNSPECIFIED" - Billing cycle spec is not specified.
  1367  	//   "BILLING_CYCLE_SPEC_ALIGN_WITH_PREVIOUS_SUBSCRIPTION" - The billing cycle
  1368  	// of the new subscription aligns with the previous subscription it upgrades or
  1369  	// downgrades from.
  1370  	//   "BILLING_CYCLE_SPEC_START_IMMEDIATELY" - The billing cycle of the new
  1371  	// subscription starts immediately.
  1372  	BillingCycleSpec string `json:"billingCycleSpec,omitempty"`
  1373  	// PreviousSubscriptionId: Required. The previous subscription id to be
  1374  	// replaced. This is not the full resource name, use the subscription_id
  1375  	// segment only.
  1376  	PreviousSubscriptionId string `json:"previousSubscriptionId,omitempty"`
  1377  	// ForceSendFields is a list of field names (e.g. "BillingCycleSpec") to
  1378  	// unconditionally include in API requests. By default, fields with empty or
  1379  	// default values are omitted from API requests. See
  1380  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1381  	// details.
  1382  	ForceSendFields []string `json:"-"`
  1383  	// NullFields is a list of field names (e.g. "BillingCycleSpec") to include in
  1384  	// API requests with the JSON null value. By default, fields with empty values
  1385  	// are omitted from API requests. See
  1386  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1387  	NullFields []string `json:"-"`
  1388  }
  1389  
  1390  func (s *GoogleCloudPaymentsResellerSubscriptionV1SubscriptionUpgradeDowngradeDetails) MarshalJSON() ([]byte, error) {
  1391  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1SubscriptionUpgradeDowngradeDetails
  1392  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1393  }
  1394  
  1395  // GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest:
  1396  // Request to revoke a cancellation request.
  1397  type GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest struct {
  1398  }
  1399  
  1400  // GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse:
  1401  // Response that contains the updated subscription resource.
  1402  type GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse struct {
  1403  	// Subscription: The updated subscription resource.
  1404  	Subscription *GoogleCloudPaymentsResellerSubscriptionV1Subscription `json:"subscription,omitempty"`
  1405  
  1406  	// ServerResponse contains the HTTP response code and headers from the server.
  1407  	googleapi.ServerResponse `json:"-"`
  1408  	// ForceSendFields is a list of field names (e.g. "Subscription") to
  1409  	// unconditionally include in API requests. By default, fields with empty or
  1410  	// default values are omitted from API requests. See
  1411  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1412  	// details.
  1413  	ForceSendFields []string `json:"-"`
  1414  	// NullFields is a list of field names (e.g. "Subscription") to include in API
  1415  	// requests with the JSON null value. By default, fields with empty values are
  1416  	// omitted from API requests. See
  1417  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1418  	NullFields []string `json:"-"`
  1419  }
  1420  
  1421  func (s *GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse) MarshalJSON() ([]byte, error) {
  1422  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse
  1423  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1424  }
  1425  
  1426  // GoogleCloudPaymentsResellerSubscriptionV1YoutubePayload: Payload specific to
  1427  // Youtube products.
  1428  type GoogleCloudPaymentsResellerSubscriptionV1YoutubePayload struct {
  1429  	// AccessEndTime: Output only. The access expiration time for this line item.
  1430  	AccessEndTime string `json:"accessEndTime,omitempty"`
  1431  	// PartnerEligibilityIds: The list of eligibility_ids which are applicable for
  1432  	// the line item.
  1433  	PartnerEligibilityIds []string `json:"partnerEligibilityIds,omitempty"`
  1434  	// PartnerPlanType: Optional. Specifies the plan type offered to the end user
  1435  	// by the partner.
  1436  	//
  1437  	// Possible values:
  1438  	//   "PARTNER_PLAN_TYPE_UNSPECIFIED" - Unspecified. Should not use, reserved as
  1439  	// an invalid value.
  1440  	//   "PARTNER_PLAN_TYPE_STANDALONE" - This item is offered as a standalone
  1441  	// product to the user.
  1442  	//   "PARTNER_PLAN_TYPE_HARD_BUNDLE" - This item is bundled with another
  1443  	// partner offering, the item is provisioned at purchase time.
  1444  	//   "PARTNER_PLAN_TYPE_SOFT_BUNDLE" - This item is bundled with another
  1445  	// partner offering, the item is provisioned after puchase, when the user opts
  1446  	// in this Google service.
  1447  	PartnerPlanType string `json:"partnerPlanType,omitempty"`
  1448  	// ForceSendFields is a list of field names (e.g. "AccessEndTime") to
  1449  	// unconditionally include in API requests. By default, fields with empty or
  1450  	// default values are omitted from API requests. See
  1451  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1452  	// details.
  1453  	ForceSendFields []string `json:"-"`
  1454  	// NullFields is a list of field names (e.g. "AccessEndTime") to include in API
  1455  	// requests with the JSON null value. By default, fields with empty values are
  1456  	// omitted from API requests. See
  1457  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1458  	NullFields []string `json:"-"`
  1459  }
  1460  
  1461  func (s *GoogleCloudPaymentsResellerSubscriptionV1YoutubePayload) MarshalJSON() ([]byte, error) {
  1462  	type NoMethod GoogleCloudPaymentsResellerSubscriptionV1YoutubePayload
  1463  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1464  }
  1465  
  1466  // GoogleTypeLocalizedText: Localized variant of a text in a particular
  1467  // language.
  1468  type GoogleTypeLocalizedText struct {
  1469  	// LanguageCode: The text's BCP-47 language code, such as "en-US" or "sr-Latn".
  1470  	// For more information, see
  1471  	// http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  1472  	LanguageCode string `json:"languageCode,omitempty"`
  1473  	// Text: Localized string in the language corresponding to language_code below.
  1474  	Text string `json:"text,omitempty"`
  1475  	// ForceSendFields is a list of field names (e.g. "LanguageCode") to
  1476  	// unconditionally include in API requests. By default, fields with empty or
  1477  	// default values are omitted from API requests. See
  1478  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1479  	// details.
  1480  	ForceSendFields []string `json:"-"`
  1481  	// NullFields is a list of field names (e.g. "LanguageCode") to include in API
  1482  	// requests with the JSON null value. By default, fields with empty values are
  1483  	// omitted from API requests. See
  1484  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1485  	NullFields []string `json:"-"`
  1486  }
  1487  
  1488  func (s *GoogleTypeLocalizedText) MarshalJSON() ([]byte, error) {
  1489  	type NoMethod GoogleTypeLocalizedText
  1490  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1491  }
  1492  
  1493  // ProductBundleDetails: Details for a bundle product.
  1494  type ProductBundleDetails struct {
  1495  	// BundleElements: The individual products that are included in the bundle.
  1496  	BundleElements []*GoogleCloudPaymentsResellerSubscriptionV1ProductBundleDetailsBundleElement `json:"bundleElements,omitempty"`
  1497  	// EntitlementMode: The entitlement mode of the bundle product.
  1498  	//
  1499  	// Possible values:
  1500  	//   "ENTITLEMENT_MODE_UNSPECIFIED" - Unspecified. It's reserved as an
  1501  	// unexpected value, should not be used.
  1502  	//   "ENTITLEMENT_MODE_FULL" - All the bundle elements must be fully activated
  1503  	// in a single request.
  1504  	//   "ENTITLEMENT_MODE_INCREMENTAL" - The bundle elements could be
  1505  	// incrementally activated.
  1506  	EntitlementMode string `json:"entitlementMode,omitempty"`
  1507  	// ForceSendFields is a list of field names (e.g. "BundleElements") to
  1508  	// unconditionally include in API requests. By default, fields with empty or
  1509  	// default values are omitted from API requests. See
  1510  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1511  	// details.
  1512  	ForceSendFields []string `json:"-"`
  1513  	// NullFields is a list of field names (e.g. "BundleElements") to include in
  1514  	// API requests with the JSON null value. By default, fields with empty values
  1515  	// are omitted from API requests. See
  1516  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1517  	NullFields []string `json:"-"`
  1518  }
  1519  
  1520  func (s *ProductBundleDetails) MarshalJSON() ([]byte, error) {
  1521  	type NoMethod ProductBundleDetails
  1522  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1523  }
  1524  
  1525  // SubscriptionLineItemBundleDetails: The bundle details for a line item
  1526  // corresponding to a hard bundle.
  1527  type SubscriptionLineItemBundleDetails struct {
  1528  	// BundleElementDetails: Output only. The details for each element in the hard
  1529  	// bundle.
  1530  	BundleElementDetails []*GoogleCloudPaymentsResellerSubscriptionV1SubscriptionLineItemBundleDetailsBundleElementDetails `json:"bundleElementDetails,omitempty"`
  1531  	// ForceSendFields is a list of field names (e.g. "BundleElementDetails") to
  1532  	// unconditionally include in API requests. By default, fields with empty or
  1533  	// default values are omitted from API requests. See
  1534  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1535  	// details.
  1536  	ForceSendFields []string `json:"-"`
  1537  	// NullFields is a list of field names (e.g. "BundleElementDetails") to include
  1538  	// in API requests with the JSON null value. By default, fields with empty
  1539  	// values are omitted from API requests. See
  1540  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1541  	NullFields []string `json:"-"`
  1542  }
  1543  
  1544  func (s *SubscriptionLineItemBundleDetails) MarshalJSON() ([]byte, error) {
  1545  	type NoMethod SubscriptionLineItemBundleDetails
  1546  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1547  }
  1548  
  1549  type PartnersProductsListCall struct {
  1550  	s            *Service
  1551  	parent       string
  1552  	urlParams_   gensupport.URLParams
  1553  	ifNoneMatch_ string
  1554  	ctx_         context.Context
  1555  	header_      http.Header
  1556  }
  1557  
  1558  // List: To retrieve the products that can be resold by the partner. It should
  1559  // be autenticated with a service account.
  1560  //
  1561  //   - parent: The parent, the partner that can resell. Format:
  1562  //     partners/{partner}.
  1563  func (r *PartnersProductsService) List(parent string) *PartnersProductsListCall {
  1564  	c := &PartnersProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1565  	c.parent = parent
  1566  	return c
  1567  }
  1568  
  1569  // Filter sets the optional parameter "filter": Specifies the filters for the
  1570  // product results. The syntax is defined in https://google.aip.dev/160 with
  1571  // the following caveats: 1. Only the following features are supported: -
  1572  // Logical operator `AND` - Comparison operator `=` (no wildcards `*`) -
  1573  // Traversal operator `.` - Has operator `:` (no wildcards `*`) 2. Only the
  1574  // following fields are supported: - `regionCodes` -
  1575  // `youtubePayload.partnerEligibilityId` - `youtubePayload.postalCode` 3.
  1576  // Unless explicitly mentioned above, other features are not supported.
  1577  // Example: `regionCodes:US AND youtubePayload.postalCode=94043 AND
  1578  // youtubePayload.partnerEligibilityId=eligibility-id`
  1579  func (c *PartnersProductsListCall) Filter(filter string) *PartnersProductsListCall {
  1580  	c.urlParams_.Set("filter", filter)
  1581  	return c
  1582  }
  1583  
  1584  // PageSize sets the optional parameter "pageSize": The maximum number of
  1585  // products to return. The service may return fewer than this value. If
  1586  // unspecified, at most 50 products will be returned. The maximum value is
  1587  // 1000; values above 1000 will be coerced to 1000.
  1588  func (c *PartnersProductsListCall) PageSize(pageSize int64) *PartnersProductsListCall {
  1589  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1590  	return c
  1591  }
  1592  
  1593  // PageToken sets the optional parameter "pageToken": A page token, received
  1594  // from a previous `ListProducts` call. Provide this to retrieve the subsequent
  1595  // page. When paginating, all other parameters provided to `ListProducts` must
  1596  // match the call that provided the page token.
  1597  func (c *PartnersProductsListCall) PageToken(pageToken string) *PartnersProductsListCall {
  1598  	c.urlParams_.Set("pageToken", pageToken)
  1599  	return c
  1600  }
  1601  
  1602  // Fields allows partial responses to be retrieved. See
  1603  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1604  // details.
  1605  func (c *PartnersProductsListCall) Fields(s ...googleapi.Field) *PartnersProductsListCall {
  1606  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1607  	return c
  1608  }
  1609  
  1610  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1611  // object's ETag matches the given value. This is useful for getting updates
  1612  // only after the object has changed since the last request.
  1613  func (c *PartnersProductsListCall) IfNoneMatch(entityTag string) *PartnersProductsListCall {
  1614  	c.ifNoneMatch_ = entityTag
  1615  	return c
  1616  }
  1617  
  1618  // Context sets the context to be used in this call's Do method.
  1619  func (c *PartnersProductsListCall) Context(ctx context.Context) *PartnersProductsListCall {
  1620  	c.ctx_ = ctx
  1621  	return c
  1622  }
  1623  
  1624  // Header returns a http.Header that can be modified by the caller to add
  1625  // headers to the request.
  1626  func (c *PartnersProductsListCall) Header() http.Header {
  1627  	if c.header_ == nil {
  1628  		c.header_ = make(http.Header)
  1629  	}
  1630  	return c.header_
  1631  }
  1632  
  1633  func (c *PartnersProductsListCall) doRequest(alt string) (*http.Response, error) {
  1634  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1635  	if c.ifNoneMatch_ != "" {
  1636  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1637  	}
  1638  	var body io.Reader = nil
  1639  	c.urlParams_.Set("alt", alt)
  1640  	c.urlParams_.Set("prettyPrint", "false")
  1641  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products")
  1642  	urls += "?" + c.urlParams_.Encode()
  1643  	req, err := http.NewRequest("GET", urls, body)
  1644  	if err != nil {
  1645  		return nil, err
  1646  	}
  1647  	req.Header = reqHeaders
  1648  	googleapi.Expand(req.URL, map[string]string{
  1649  		"parent": c.parent,
  1650  	})
  1651  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1652  }
  1653  
  1654  // Do executes the "paymentsresellersubscription.partners.products.list" call.
  1655  // Any non-2xx status code is an error. Response headers are in either
  1656  // *GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse.ServerResponse
  1657  // .Header or (if a response was returned at all) in
  1658  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1659  // whether the returned error was because http.StatusNotModified was returned.
  1660  func (c *PartnersProductsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse, error) {
  1661  	gensupport.SetOptions(c.urlParams_, opts...)
  1662  	res, err := c.doRequest("json")
  1663  	if res != nil && res.StatusCode == http.StatusNotModified {
  1664  		if res.Body != nil {
  1665  			res.Body.Close()
  1666  		}
  1667  		return nil, gensupport.WrapError(&googleapi.Error{
  1668  			Code:   res.StatusCode,
  1669  			Header: res.Header,
  1670  		})
  1671  	}
  1672  	if err != nil {
  1673  		return nil, err
  1674  	}
  1675  	defer googleapi.CloseBody(res)
  1676  	if err := googleapi.CheckResponse(res); err != nil {
  1677  		return nil, gensupport.WrapError(err)
  1678  	}
  1679  	ret := &GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse{
  1680  		ServerResponse: googleapi.ServerResponse{
  1681  			Header:         res.Header,
  1682  			HTTPStatusCode: res.StatusCode,
  1683  		},
  1684  	}
  1685  	target := &ret
  1686  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1687  		return nil, err
  1688  	}
  1689  	return ret, nil
  1690  }
  1691  
  1692  // Pages invokes f for each page of results.
  1693  // A non-nil error returned from f will halt the iteration.
  1694  // The provided context supersedes any context provided to the Context method.
  1695  func (c *PartnersProductsListCall) Pages(ctx context.Context, f func(*GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse) error) error {
  1696  	c.ctx_ = ctx
  1697  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1698  	for {
  1699  		x, err := c.Do()
  1700  		if err != nil {
  1701  			return err
  1702  		}
  1703  		if err := f(x); err != nil {
  1704  			return err
  1705  		}
  1706  		if x.NextPageToken == "" {
  1707  			return nil
  1708  		}
  1709  		c.PageToken(x.NextPageToken)
  1710  	}
  1711  }
  1712  
  1713  type PartnersPromotionsFindEligibleCall struct {
  1714  	s                                                                      *Service
  1715  	parent                                                                 string
  1716  	googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest *GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest
  1717  	urlParams_                                                             gensupport.URLParams
  1718  	ctx_                                                                   context.Context
  1719  	header_                                                                http.Header
  1720  }
  1721  
  1722  // FindEligible: To find eligible promotions for the current user. The API
  1723  // requires user authorization via OAuth. The bare minimum oauth scope `openid`
  1724  // is sufficient, which will skip the consent screen.
  1725  //
  1726  //   - parent: The parent, the partner that can resell. Format:
  1727  //     partners/{partner}.
  1728  func (r *PartnersPromotionsService) FindEligible(parent string, googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest *GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest) *PartnersPromotionsFindEligibleCall {
  1729  	c := &PartnersPromotionsFindEligibleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1730  	c.parent = parent
  1731  	c.googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest = googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest
  1732  	return c
  1733  }
  1734  
  1735  // Fields allows partial responses to be retrieved. See
  1736  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1737  // details.
  1738  func (c *PartnersPromotionsFindEligibleCall) Fields(s ...googleapi.Field) *PartnersPromotionsFindEligibleCall {
  1739  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1740  	return c
  1741  }
  1742  
  1743  // Context sets the context to be used in this call's Do method.
  1744  func (c *PartnersPromotionsFindEligibleCall) Context(ctx context.Context) *PartnersPromotionsFindEligibleCall {
  1745  	c.ctx_ = ctx
  1746  	return c
  1747  }
  1748  
  1749  // Header returns a http.Header that can be modified by the caller to add
  1750  // headers to the request.
  1751  func (c *PartnersPromotionsFindEligibleCall) Header() http.Header {
  1752  	if c.header_ == nil {
  1753  		c.header_ = make(http.Header)
  1754  	}
  1755  	return c.header_
  1756  }
  1757  
  1758  func (c *PartnersPromotionsFindEligibleCall) doRequest(alt string) (*http.Response, error) {
  1759  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1760  	var body io.Reader = nil
  1761  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest)
  1762  	if err != nil {
  1763  		return nil, err
  1764  	}
  1765  	c.urlParams_.Set("alt", alt)
  1766  	c.urlParams_.Set("prettyPrint", "false")
  1767  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/promotions:findEligible")
  1768  	urls += "?" + c.urlParams_.Encode()
  1769  	req, err := http.NewRequest("POST", urls, body)
  1770  	if err != nil {
  1771  		return nil, err
  1772  	}
  1773  	req.Header = reqHeaders
  1774  	googleapi.Expand(req.URL, map[string]string{
  1775  		"parent": c.parent,
  1776  	})
  1777  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1778  }
  1779  
  1780  // Do executes the "paymentsresellersubscription.partners.promotions.findEligible" call.
  1781  // Any non-2xx status code is an error. Response headers are in either
  1782  // *GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse.Serv
  1783  // erResponse.Header or (if a response was returned at all) in
  1784  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1785  // whether the returned error was because http.StatusNotModified was returned.
  1786  func (c *PartnersPromotionsFindEligibleCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse, error) {
  1787  	gensupport.SetOptions(c.urlParams_, opts...)
  1788  	res, err := c.doRequest("json")
  1789  	if res != nil && res.StatusCode == http.StatusNotModified {
  1790  		if res.Body != nil {
  1791  			res.Body.Close()
  1792  		}
  1793  		return nil, gensupport.WrapError(&googleapi.Error{
  1794  			Code:   res.StatusCode,
  1795  			Header: res.Header,
  1796  		})
  1797  	}
  1798  	if err != nil {
  1799  		return nil, err
  1800  	}
  1801  	defer googleapi.CloseBody(res)
  1802  	if err := googleapi.CheckResponse(res); err != nil {
  1803  		return nil, gensupport.WrapError(err)
  1804  	}
  1805  	ret := &GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse{
  1806  		ServerResponse: googleapi.ServerResponse{
  1807  			Header:         res.Header,
  1808  			HTTPStatusCode: res.StatusCode,
  1809  		},
  1810  	}
  1811  	target := &ret
  1812  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1813  		return nil, err
  1814  	}
  1815  	return ret, nil
  1816  }
  1817  
  1818  // Pages invokes f for each page of results.
  1819  // A non-nil error returned from f will halt the iteration.
  1820  // The provided context supersedes any context provided to the Context method.
  1821  func (c *PartnersPromotionsFindEligibleCall) Pages(ctx context.Context, f func(*GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse) error) error {
  1822  	c.ctx_ = ctx
  1823  	defer func(pt string) {
  1824  		c.googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest.PageToken = pt
  1825  	}(c.googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest.PageToken)
  1826  	for {
  1827  		x, err := c.Do()
  1828  		if err != nil {
  1829  			return err
  1830  		}
  1831  		if err := f(x); err != nil {
  1832  			return err
  1833  		}
  1834  		if x.NextPageToken == "" {
  1835  			return nil
  1836  		}
  1837  		c.googlecloudpaymentsresellersubscriptionv1findeligiblepromotionsrequest.PageToken = x.NextPageToken
  1838  	}
  1839  }
  1840  
  1841  type PartnersPromotionsListCall struct {
  1842  	s            *Service
  1843  	parent       string
  1844  	urlParams_   gensupport.URLParams
  1845  	ifNoneMatch_ string
  1846  	ctx_         context.Context
  1847  	header_      http.Header
  1848  }
  1849  
  1850  // List: To retrieve the promotions, such as free trial, that can be used by
  1851  // the partner. It should be autenticated with a service account.
  1852  //
  1853  //   - parent: The parent, the partner that can resell. Format:
  1854  //     partners/{partner}.
  1855  func (r *PartnersPromotionsService) List(parent string) *PartnersPromotionsListCall {
  1856  	c := &PartnersPromotionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1857  	c.parent = parent
  1858  	return c
  1859  }
  1860  
  1861  // Filter sets the optional parameter "filter": Specifies the filters for the
  1862  // promotion results. The syntax is defined in https://google.aip.dev/160 with
  1863  // the following caveats: 1. Only the following features are supported: -
  1864  // Logical operator `AND` - Comparison operator `=` (no wildcards `*`) -
  1865  // Traversal operator `.` - Has operator `:` (no wildcards `*`) 2. Only the
  1866  // following fields are supported: - `applicableProducts` - `regionCodes` -
  1867  // `youtubePayload.partnerEligibilityId` - `youtubePayload.postalCode` 3.
  1868  // Unless explicitly mentioned above, other features are not supported.
  1869  // Example: `applicableProducts:partners/partner1/products/product1 AND
  1870  // regionCodes:US AND youtubePayload.postalCode=94043 AND
  1871  // youtubePayload.partnerEligibilityId=eligibility-id`
  1872  func (c *PartnersPromotionsListCall) Filter(filter string) *PartnersPromotionsListCall {
  1873  	c.urlParams_.Set("filter", filter)
  1874  	return c
  1875  }
  1876  
  1877  // PageSize sets the optional parameter "pageSize": The maximum number of
  1878  // promotions to return. The service may return fewer than this value. If
  1879  // unspecified, at most 50 products will be returned. The maximum value is
  1880  // 1000; values above 1000 will be coerced to 1000.
  1881  func (c *PartnersPromotionsListCall) PageSize(pageSize int64) *PartnersPromotionsListCall {
  1882  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1883  	return c
  1884  }
  1885  
  1886  // PageToken sets the optional parameter "pageToken": A page token, received
  1887  // from a previous `ListPromotions` call. Provide this to retrieve the
  1888  // subsequent page. When paginating, all other parameters provided to
  1889  // `ListPromotions` must match the call that provided the page token.
  1890  func (c *PartnersPromotionsListCall) PageToken(pageToken string) *PartnersPromotionsListCall {
  1891  	c.urlParams_.Set("pageToken", pageToken)
  1892  	return c
  1893  }
  1894  
  1895  // Fields allows partial responses to be retrieved. See
  1896  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1897  // details.
  1898  func (c *PartnersPromotionsListCall) Fields(s ...googleapi.Field) *PartnersPromotionsListCall {
  1899  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1900  	return c
  1901  }
  1902  
  1903  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1904  // object's ETag matches the given value. This is useful for getting updates
  1905  // only after the object has changed since the last request.
  1906  func (c *PartnersPromotionsListCall) IfNoneMatch(entityTag string) *PartnersPromotionsListCall {
  1907  	c.ifNoneMatch_ = entityTag
  1908  	return c
  1909  }
  1910  
  1911  // Context sets the context to be used in this call's Do method.
  1912  func (c *PartnersPromotionsListCall) Context(ctx context.Context) *PartnersPromotionsListCall {
  1913  	c.ctx_ = ctx
  1914  	return c
  1915  }
  1916  
  1917  // Header returns a http.Header that can be modified by the caller to add
  1918  // headers to the request.
  1919  func (c *PartnersPromotionsListCall) Header() http.Header {
  1920  	if c.header_ == nil {
  1921  		c.header_ = make(http.Header)
  1922  	}
  1923  	return c.header_
  1924  }
  1925  
  1926  func (c *PartnersPromotionsListCall) doRequest(alt string) (*http.Response, error) {
  1927  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1928  	if c.ifNoneMatch_ != "" {
  1929  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1930  	}
  1931  	var body io.Reader = nil
  1932  	c.urlParams_.Set("alt", alt)
  1933  	c.urlParams_.Set("prettyPrint", "false")
  1934  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/promotions")
  1935  	urls += "?" + c.urlParams_.Encode()
  1936  	req, err := http.NewRequest("GET", urls, body)
  1937  	if err != nil {
  1938  		return nil, err
  1939  	}
  1940  	req.Header = reqHeaders
  1941  	googleapi.Expand(req.URL, map[string]string{
  1942  		"parent": c.parent,
  1943  	})
  1944  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1945  }
  1946  
  1947  // Do executes the "paymentsresellersubscription.partners.promotions.list" call.
  1948  // Any non-2xx status code is an error. Response headers are in either
  1949  // *GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse.ServerRespon
  1950  // se.Header or (if a response was returned at all) in
  1951  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1952  // whether the returned error was because http.StatusNotModified was returned.
  1953  func (c *PartnersPromotionsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse, error) {
  1954  	gensupport.SetOptions(c.urlParams_, opts...)
  1955  	res, err := c.doRequest("json")
  1956  	if res != nil && res.StatusCode == http.StatusNotModified {
  1957  		if res.Body != nil {
  1958  			res.Body.Close()
  1959  		}
  1960  		return nil, gensupport.WrapError(&googleapi.Error{
  1961  			Code:   res.StatusCode,
  1962  			Header: res.Header,
  1963  		})
  1964  	}
  1965  	if err != nil {
  1966  		return nil, err
  1967  	}
  1968  	defer googleapi.CloseBody(res)
  1969  	if err := googleapi.CheckResponse(res); err != nil {
  1970  		return nil, gensupport.WrapError(err)
  1971  	}
  1972  	ret := &GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse{
  1973  		ServerResponse: googleapi.ServerResponse{
  1974  			Header:         res.Header,
  1975  			HTTPStatusCode: res.StatusCode,
  1976  		},
  1977  	}
  1978  	target := &ret
  1979  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1980  		return nil, err
  1981  	}
  1982  	return ret, nil
  1983  }
  1984  
  1985  // Pages invokes f for each page of results.
  1986  // A non-nil error returned from f will halt the iteration.
  1987  // The provided context supersedes any context provided to the Context method.
  1988  func (c *PartnersPromotionsListCall) Pages(ctx context.Context, f func(*GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse) error) error {
  1989  	c.ctx_ = ctx
  1990  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1991  	for {
  1992  		x, err := c.Do()
  1993  		if err != nil {
  1994  			return err
  1995  		}
  1996  		if err := f(x); err != nil {
  1997  			return err
  1998  		}
  1999  		if x.NextPageToken == "" {
  2000  			return nil
  2001  		}
  2002  		c.PageToken(x.NextPageToken)
  2003  	}
  2004  }
  2005  
  2006  type PartnersSubscriptionsCancelCall struct {
  2007  	s                                                                  *Service
  2008  	name                                                               string
  2009  	googlecloudpaymentsresellersubscriptionv1cancelsubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest
  2010  	urlParams_                                                         gensupport.URLParams
  2011  	ctx_                                                               context.Context
  2012  	header_                                                            http.Header
  2013  }
  2014  
  2015  // Cancel: Used by partners to cancel a subscription service either immediately
  2016  // or by the end of the current billing cycle for their customers. It should be
  2017  // called directly by the partner using service accounts.
  2018  //
  2019  //   - name: The name of the subscription resource to be cancelled. It will have
  2020  //     the format of "partners/{partner_id}/subscriptions/{subscription_id}".
  2021  func (r *PartnersSubscriptionsService) Cancel(name string, googlecloudpaymentsresellersubscriptionv1cancelsubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest) *PartnersSubscriptionsCancelCall {
  2022  	c := &PartnersSubscriptionsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2023  	c.name = name
  2024  	c.googlecloudpaymentsresellersubscriptionv1cancelsubscriptionrequest = googlecloudpaymentsresellersubscriptionv1cancelsubscriptionrequest
  2025  	return c
  2026  }
  2027  
  2028  // Fields allows partial responses to be retrieved. See
  2029  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2030  // details.
  2031  func (c *PartnersSubscriptionsCancelCall) Fields(s ...googleapi.Field) *PartnersSubscriptionsCancelCall {
  2032  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2033  	return c
  2034  }
  2035  
  2036  // Context sets the context to be used in this call's Do method.
  2037  func (c *PartnersSubscriptionsCancelCall) Context(ctx context.Context) *PartnersSubscriptionsCancelCall {
  2038  	c.ctx_ = ctx
  2039  	return c
  2040  }
  2041  
  2042  // Header returns a http.Header that can be modified by the caller to add
  2043  // headers to the request.
  2044  func (c *PartnersSubscriptionsCancelCall) Header() http.Header {
  2045  	if c.header_ == nil {
  2046  		c.header_ = make(http.Header)
  2047  	}
  2048  	return c.header_
  2049  }
  2050  
  2051  func (c *PartnersSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) {
  2052  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2053  	var body io.Reader = nil
  2054  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1cancelsubscriptionrequest)
  2055  	if err != nil {
  2056  		return nil, err
  2057  	}
  2058  	c.urlParams_.Set("alt", alt)
  2059  	c.urlParams_.Set("prettyPrint", "false")
  2060  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  2061  	urls += "?" + c.urlParams_.Encode()
  2062  	req, err := http.NewRequest("POST", urls, body)
  2063  	if err != nil {
  2064  		return nil, err
  2065  	}
  2066  	req.Header = reqHeaders
  2067  	googleapi.Expand(req.URL, map[string]string{
  2068  		"name": c.name,
  2069  	})
  2070  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2071  }
  2072  
  2073  // Do executes the "paymentsresellersubscription.partners.subscriptions.cancel" call.
  2074  // Any non-2xx status code is an error. Response headers are in either
  2075  // *GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse.ServerRe
  2076  // sponse.Header or (if a response was returned at all) in
  2077  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2078  // whether the returned error was because http.StatusNotModified was returned.
  2079  func (c *PartnersSubscriptionsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse, error) {
  2080  	gensupport.SetOptions(c.urlParams_, opts...)
  2081  	res, err := c.doRequest("json")
  2082  	if res != nil && res.StatusCode == http.StatusNotModified {
  2083  		if res.Body != nil {
  2084  			res.Body.Close()
  2085  		}
  2086  		return nil, gensupport.WrapError(&googleapi.Error{
  2087  			Code:   res.StatusCode,
  2088  			Header: res.Header,
  2089  		})
  2090  	}
  2091  	if err != nil {
  2092  		return nil, err
  2093  	}
  2094  	defer googleapi.CloseBody(res)
  2095  	if err := googleapi.CheckResponse(res); err != nil {
  2096  		return nil, gensupport.WrapError(err)
  2097  	}
  2098  	ret := &GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse{
  2099  		ServerResponse: googleapi.ServerResponse{
  2100  			Header:         res.Header,
  2101  			HTTPStatusCode: res.StatusCode,
  2102  		},
  2103  	}
  2104  	target := &ret
  2105  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2106  		return nil, err
  2107  	}
  2108  	return ret, nil
  2109  }
  2110  
  2111  type PartnersSubscriptionsCreateCall struct {
  2112  	s                                                     *Service
  2113  	parentid                                              string
  2114  	googlecloudpaymentsresellersubscriptionv1subscription *GoogleCloudPaymentsResellerSubscriptionV1Subscription
  2115  	urlParams_                                            gensupport.URLParams
  2116  	ctx_                                                  context.Context
  2117  	header_                                               http.Header
  2118  }
  2119  
  2120  // Create: Used by partners to create a subscription for their customers. The
  2121  // created subscription is associated with the end user inferred from the end
  2122  // user credentials. This API must be authorized by the end user using OAuth.
  2123  //
  2124  //   - parent: The parent resource name, which is the identifier of the partner.
  2125  //     It will have the format of "partners/{partner_id}".
  2126  func (r *PartnersSubscriptionsService) Create(parentid string, googlecloudpaymentsresellersubscriptionv1subscription *GoogleCloudPaymentsResellerSubscriptionV1Subscription) *PartnersSubscriptionsCreateCall {
  2127  	c := &PartnersSubscriptionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2128  	c.parentid = parentid
  2129  	c.googlecloudpaymentsresellersubscriptionv1subscription = googlecloudpaymentsresellersubscriptionv1subscription
  2130  	return c
  2131  }
  2132  
  2133  // SubscriptionId sets the optional parameter "subscriptionId": Required.
  2134  // Identifies the subscription resource on the Partner side. The value is
  2135  // restricted to 63 ASCII characters at the maximum. If a subscription was
  2136  // previously created with the same subscription_id, we will directly return
  2137  // that one.
  2138  func (c *PartnersSubscriptionsCreateCall) SubscriptionId(subscriptionId string) *PartnersSubscriptionsCreateCall {
  2139  	c.urlParams_.Set("subscriptionId", subscriptionId)
  2140  	return c
  2141  }
  2142  
  2143  // Fields allows partial responses to be retrieved. See
  2144  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2145  // details.
  2146  func (c *PartnersSubscriptionsCreateCall) Fields(s ...googleapi.Field) *PartnersSubscriptionsCreateCall {
  2147  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2148  	return c
  2149  }
  2150  
  2151  // Context sets the context to be used in this call's Do method.
  2152  func (c *PartnersSubscriptionsCreateCall) Context(ctx context.Context) *PartnersSubscriptionsCreateCall {
  2153  	c.ctx_ = ctx
  2154  	return c
  2155  }
  2156  
  2157  // Header returns a http.Header that can be modified by the caller to add
  2158  // headers to the request.
  2159  func (c *PartnersSubscriptionsCreateCall) Header() http.Header {
  2160  	if c.header_ == nil {
  2161  		c.header_ = make(http.Header)
  2162  	}
  2163  	return c.header_
  2164  }
  2165  
  2166  func (c *PartnersSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) {
  2167  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2168  	var body io.Reader = nil
  2169  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1subscription)
  2170  	if err != nil {
  2171  		return nil, err
  2172  	}
  2173  	c.urlParams_.Set("alt", alt)
  2174  	c.urlParams_.Set("prettyPrint", "false")
  2175  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subscriptions")
  2176  	urls += "?" + c.urlParams_.Encode()
  2177  	req, err := http.NewRequest("POST", urls, body)
  2178  	if err != nil {
  2179  		return nil, err
  2180  	}
  2181  	req.Header = reqHeaders
  2182  	googleapi.Expand(req.URL, map[string]string{
  2183  		"parent": c.parentid,
  2184  	})
  2185  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2186  }
  2187  
  2188  // Do executes the "paymentsresellersubscription.partners.subscriptions.create" call.
  2189  // Any non-2xx status code is an error. Response headers are in either
  2190  // *GoogleCloudPaymentsResellerSubscriptionV1Subscription.ServerResponse.Header
  2191  // or (if a response was returned at all) in error.(*googleapi.Error).Header.
  2192  // Use googleapi.IsNotModified to check whether the returned error was because
  2193  // http.StatusNotModified was returned.
  2194  func (c *PartnersSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1Subscription, error) {
  2195  	gensupport.SetOptions(c.urlParams_, opts...)
  2196  	res, err := c.doRequest("json")
  2197  	if res != nil && res.StatusCode == http.StatusNotModified {
  2198  		if res.Body != nil {
  2199  			res.Body.Close()
  2200  		}
  2201  		return nil, gensupport.WrapError(&googleapi.Error{
  2202  			Code:   res.StatusCode,
  2203  			Header: res.Header,
  2204  		})
  2205  	}
  2206  	if err != nil {
  2207  		return nil, err
  2208  	}
  2209  	defer googleapi.CloseBody(res)
  2210  	if err := googleapi.CheckResponse(res); err != nil {
  2211  		return nil, gensupport.WrapError(err)
  2212  	}
  2213  	ret := &GoogleCloudPaymentsResellerSubscriptionV1Subscription{
  2214  		ServerResponse: googleapi.ServerResponse{
  2215  			Header:         res.Header,
  2216  			HTTPStatusCode: res.StatusCode,
  2217  		},
  2218  	}
  2219  	target := &ret
  2220  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2221  		return nil, err
  2222  	}
  2223  	return ret, nil
  2224  }
  2225  
  2226  type PartnersSubscriptionsEntitleCall struct {
  2227  	s                                                                   *Service
  2228  	name                                                                string
  2229  	googlecloudpaymentsresellersubscriptionv1entitlesubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest
  2230  	urlParams_                                                          gensupport.URLParams
  2231  	ctx_                                                                context.Context
  2232  	header_                                                             http.Header
  2233  }
  2234  
  2235  // Entitle: Used by partners to entitle a previously provisioned subscription
  2236  // to the current end user. The end user identity is inferred from the
  2237  // authorized credential of the request. This API must be authorized by the end
  2238  // user using OAuth.
  2239  //
  2240  //   - name: The name of the subscription resource that is entitled to the
  2241  //     current end user. It will have the format of
  2242  //     "partners/{partner_id}/subscriptions/{subscription_id}".
  2243  func (r *PartnersSubscriptionsService) Entitle(name string, googlecloudpaymentsresellersubscriptionv1entitlesubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest) *PartnersSubscriptionsEntitleCall {
  2244  	c := &PartnersSubscriptionsEntitleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2245  	c.name = name
  2246  	c.googlecloudpaymentsresellersubscriptionv1entitlesubscriptionrequest = googlecloudpaymentsresellersubscriptionv1entitlesubscriptionrequest
  2247  	return c
  2248  }
  2249  
  2250  // Fields allows partial responses to be retrieved. See
  2251  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2252  // details.
  2253  func (c *PartnersSubscriptionsEntitleCall) Fields(s ...googleapi.Field) *PartnersSubscriptionsEntitleCall {
  2254  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2255  	return c
  2256  }
  2257  
  2258  // Context sets the context to be used in this call's Do method.
  2259  func (c *PartnersSubscriptionsEntitleCall) Context(ctx context.Context) *PartnersSubscriptionsEntitleCall {
  2260  	c.ctx_ = ctx
  2261  	return c
  2262  }
  2263  
  2264  // Header returns a http.Header that can be modified by the caller to add
  2265  // headers to the request.
  2266  func (c *PartnersSubscriptionsEntitleCall) Header() http.Header {
  2267  	if c.header_ == nil {
  2268  		c.header_ = make(http.Header)
  2269  	}
  2270  	return c.header_
  2271  }
  2272  
  2273  func (c *PartnersSubscriptionsEntitleCall) doRequest(alt string) (*http.Response, error) {
  2274  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2275  	var body io.Reader = nil
  2276  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1entitlesubscriptionrequest)
  2277  	if err != nil {
  2278  		return nil, err
  2279  	}
  2280  	c.urlParams_.Set("alt", alt)
  2281  	c.urlParams_.Set("prettyPrint", "false")
  2282  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:entitle")
  2283  	urls += "?" + c.urlParams_.Encode()
  2284  	req, err := http.NewRequest("POST", urls, body)
  2285  	if err != nil {
  2286  		return nil, err
  2287  	}
  2288  	req.Header = reqHeaders
  2289  	googleapi.Expand(req.URL, map[string]string{
  2290  		"name": c.name,
  2291  	})
  2292  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2293  }
  2294  
  2295  // Do executes the "paymentsresellersubscription.partners.subscriptions.entitle" call.
  2296  // Any non-2xx status code is an error. Response headers are in either
  2297  // *GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse.ServerR
  2298  // esponse.Header or (if a response was returned at all) in
  2299  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2300  // whether the returned error was because http.StatusNotModified was returned.
  2301  func (c *PartnersSubscriptionsEntitleCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse, error) {
  2302  	gensupport.SetOptions(c.urlParams_, opts...)
  2303  	res, err := c.doRequest("json")
  2304  	if res != nil && res.StatusCode == http.StatusNotModified {
  2305  		if res.Body != nil {
  2306  			res.Body.Close()
  2307  		}
  2308  		return nil, gensupport.WrapError(&googleapi.Error{
  2309  			Code:   res.StatusCode,
  2310  			Header: res.Header,
  2311  		})
  2312  	}
  2313  	if err != nil {
  2314  		return nil, err
  2315  	}
  2316  	defer googleapi.CloseBody(res)
  2317  	if err := googleapi.CheckResponse(res); err != nil {
  2318  		return nil, gensupport.WrapError(err)
  2319  	}
  2320  	ret := &GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse{
  2321  		ServerResponse: googleapi.ServerResponse{
  2322  			Header:         res.Header,
  2323  			HTTPStatusCode: res.StatusCode,
  2324  		},
  2325  	}
  2326  	target := &ret
  2327  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2328  		return nil, err
  2329  	}
  2330  	return ret, nil
  2331  }
  2332  
  2333  type PartnersSubscriptionsExtendCall struct {
  2334  	s                                                                  *Service
  2335  	name                                                               string
  2336  	googlecloudpaymentsresellersubscriptionv1extendsubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest
  2337  	urlParams_                                                         gensupport.URLParams
  2338  	ctx_                                                               context.Context
  2339  	header_                                                            http.Header
  2340  }
  2341  
  2342  // Extend: [Opt-in only] Most partners should be on auto-extend by default.
  2343  // Used by partners to extend a subscription service for their customers on an
  2344  // ongoing basis for the subscription to remain active and renewable. It should
  2345  // be called directly by the partner using service accounts.
  2346  //
  2347  //   - name: The name of the subscription resource to be extended. It will have
  2348  //     the format of "partners/{partner_id}/subscriptions/{subscription_id}".
  2349  func (r *PartnersSubscriptionsService) Extend(name string, googlecloudpaymentsresellersubscriptionv1extendsubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest) *PartnersSubscriptionsExtendCall {
  2350  	c := &PartnersSubscriptionsExtendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2351  	c.name = name
  2352  	c.googlecloudpaymentsresellersubscriptionv1extendsubscriptionrequest = googlecloudpaymentsresellersubscriptionv1extendsubscriptionrequest
  2353  	return c
  2354  }
  2355  
  2356  // Fields allows partial responses to be retrieved. See
  2357  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2358  // details.
  2359  func (c *PartnersSubscriptionsExtendCall) Fields(s ...googleapi.Field) *PartnersSubscriptionsExtendCall {
  2360  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2361  	return c
  2362  }
  2363  
  2364  // Context sets the context to be used in this call's Do method.
  2365  func (c *PartnersSubscriptionsExtendCall) Context(ctx context.Context) *PartnersSubscriptionsExtendCall {
  2366  	c.ctx_ = ctx
  2367  	return c
  2368  }
  2369  
  2370  // Header returns a http.Header that can be modified by the caller to add
  2371  // headers to the request.
  2372  func (c *PartnersSubscriptionsExtendCall) Header() http.Header {
  2373  	if c.header_ == nil {
  2374  		c.header_ = make(http.Header)
  2375  	}
  2376  	return c.header_
  2377  }
  2378  
  2379  func (c *PartnersSubscriptionsExtendCall) doRequest(alt string) (*http.Response, error) {
  2380  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2381  	var body io.Reader = nil
  2382  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1extendsubscriptionrequest)
  2383  	if err != nil {
  2384  		return nil, err
  2385  	}
  2386  	c.urlParams_.Set("alt", alt)
  2387  	c.urlParams_.Set("prettyPrint", "false")
  2388  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:extend")
  2389  	urls += "?" + c.urlParams_.Encode()
  2390  	req, err := http.NewRequest("POST", urls, body)
  2391  	if err != nil {
  2392  		return nil, err
  2393  	}
  2394  	req.Header = reqHeaders
  2395  	googleapi.Expand(req.URL, map[string]string{
  2396  		"name": c.name,
  2397  	})
  2398  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2399  }
  2400  
  2401  // Do executes the "paymentsresellersubscription.partners.subscriptions.extend" call.
  2402  // Any non-2xx status code is an error. Response headers are in either
  2403  // *GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse.ServerRe
  2404  // sponse.Header or (if a response was returned at all) in
  2405  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2406  // whether the returned error was because http.StatusNotModified was returned.
  2407  func (c *PartnersSubscriptionsExtendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse, error) {
  2408  	gensupport.SetOptions(c.urlParams_, opts...)
  2409  	res, err := c.doRequest("json")
  2410  	if res != nil && res.StatusCode == http.StatusNotModified {
  2411  		if res.Body != nil {
  2412  			res.Body.Close()
  2413  		}
  2414  		return nil, gensupport.WrapError(&googleapi.Error{
  2415  			Code:   res.StatusCode,
  2416  			Header: res.Header,
  2417  		})
  2418  	}
  2419  	if err != nil {
  2420  		return nil, err
  2421  	}
  2422  	defer googleapi.CloseBody(res)
  2423  	if err := googleapi.CheckResponse(res); err != nil {
  2424  		return nil, gensupport.WrapError(err)
  2425  	}
  2426  	ret := &GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse{
  2427  		ServerResponse: googleapi.ServerResponse{
  2428  			Header:         res.Header,
  2429  			HTTPStatusCode: res.StatusCode,
  2430  		},
  2431  	}
  2432  	target := &ret
  2433  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2434  		return nil, err
  2435  	}
  2436  	return ret, nil
  2437  }
  2438  
  2439  type PartnersSubscriptionsGetCall struct {
  2440  	s            *Service
  2441  	name         string
  2442  	urlParams_   gensupport.URLParams
  2443  	ifNoneMatch_ string
  2444  	ctx_         context.Context
  2445  	header_      http.Header
  2446  }
  2447  
  2448  // Get: Used by partners to get a subscription by id. It should be called
  2449  // directly by the partner using service accounts.
  2450  //
  2451  //   - name: The name of the subscription resource to retrieve. It will have the
  2452  //     format of "partners/{partner_id}/subscriptions/{subscription_id}".
  2453  func (r *PartnersSubscriptionsService) Get(name string) *PartnersSubscriptionsGetCall {
  2454  	c := &PartnersSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2455  	c.name = name
  2456  	return c
  2457  }
  2458  
  2459  // Fields allows partial responses to be retrieved. See
  2460  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2461  // details.
  2462  func (c *PartnersSubscriptionsGetCall) Fields(s ...googleapi.Field) *PartnersSubscriptionsGetCall {
  2463  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2464  	return c
  2465  }
  2466  
  2467  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2468  // object's ETag matches the given value. This is useful for getting updates
  2469  // only after the object has changed since the last request.
  2470  func (c *PartnersSubscriptionsGetCall) IfNoneMatch(entityTag string) *PartnersSubscriptionsGetCall {
  2471  	c.ifNoneMatch_ = entityTag
  2472  	return c
  2473  }
  2474  
  2475  // Context sets the context to be used in this call's Do method.
  2476  func (c *PartnersSubscriptionsGetCall) Context(ctx context.Context) *PartnersSubscriptionsGetCall {
  2477  	c.ctx_ = ctx
  2478  	return c
  2479  }
  2480  
  2481  // Header returns a http.Header that can be modified by the caller to add
  2482  // headers to the request.
  2483  func (c *PartnersSubscriptionsGetCall) Header() http.Header {
  2484  	if c.header_ == nil {
  2485  		c.header_ = make(http.Header)
  2486  	}
  2487  	return c.header_
  2488  }
  2489  
  2490  func (c *PartnersSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  2491  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2492  	if c.ifNoneMatch_ != "" {
  2493  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2494  	}
  2495  	var body io.Reader = nil
  2496  	c.urlParams_.Set("alt", alt)
  2497  	c.urlParams_.Set("prettyPrint", "false")
  2498  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2499  	urls += "?" + c.urlParams_.Encode()
  2500  	req, err := http.NewRequest("GET", urls, body)
  2501  	if err != nil {
  2502  		return nil, err
  2503  	}
  2504  	req.Header = reqHeaders
  2505  	googleapi.Expand(req.URL, map[string]string{
  2506  		"name": c.name,
  2507  	})
  2508  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2509  }
  2510  
  2511  // Do executes the "paymentsresellersubscription.partners.subscriptions.get" call.
  2512  // Any non-2xx status code is an error. Response headers are in either
  2513  // *GoogleCloudPaymentsResellerSubscriptionV1Subscription.ServerResponse.Header
  2514  // or (if a response was returned at all) in error.(*googleapi.Error).Header.
  2515  // Use googleapi.IsNotModified to check whether the returned error was because
  2516  // http.StatusNotModified was returned.
  2517  func (c *PartnersSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1Subscription, error) {
  2518  	gensupport.SetOptions(c.urlParams_, opts...)
  2519  	res, err := c.doRequest("json")
  2520  	if res != nil && res.StatusCode == http.StatusNotModified {
  2521  		if res.Body != nil {
  2522  			res.Body.Close()
  2523  		}
  2524  		return nil, gensupport.WrapError(&googleapi.Error{
  2525  			Code:   res.StatusCode,
  2526  			Header: res.Header,
  2527  		})
  2528  	}
  2529  	if err != nil {
  2530  		return nil, err
  2531  	}
  2532  	defer googleapi.CloseBody(res)
  2533  	if err := googleapi.CheckResponse(res); err != nil {
  2534  		return nil, gensupport.WrapError(err)
  2535  	}
  2536  	ret := &GoogleCloudPaymentsResellerSubscriptionV1Subscription{
  2537  		ServerResponse: googleapi.ServerResponse{
  2538  			Header:         res.Header,
  2539  			HTTPStatusCode: res.StatusCode,
  2540  		},
  2541  	}
  2542  	target := &ret
  2543  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2544  		return nil, err
  2545  	}
  2546  	return ret, nil
  2547  }
  2548  
  2549  type PartnersSubscriptionsProvisionCall struct {
  2550  	s                                                     *Service
  2551  	parentid                                              string
  2552  	googlecloudpaymentsresellersubscriptionv1subscription *GoogleCloudPaymentsResellerSubscriptionV1Subscription
  2553  	urlParams_                                            gensupport.URLParams
  2554  	ctx_                                                  context.Context
  2555  	header_                                               http.Header
  2556  }
  2557  
  2558  // Provision: Used by partners to provision a subscription for their customers.
  2559  // This creates a subscription without associating it with the end user
  2560  // account. EntitleSubscription must be called separately using OAuth in order
  2561  // for the end user account to be associated with the subscription. It should
  2562  // be called directly by the partner using service accounts.
  2563  //
  2564  //   - parent: The parent resource name, which is the identifier of the partner.
  2565  //     It will have the format of "partners/{partner_id}".
  2566  func (r *PartnersSubscriptionsService) Provision(parentid string, googlecloudpaymentsresellersubscriptionv1subscription *GoogleCloudPaymentsResellerSubscriptionV1Subscription) *PartnersSubscriptionsProvisionCall {
  2567  	c := &PartnersSubscriptionsProvisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2568  	c.parentid = parentid
  2569  	c.googlecloudpaymentsresellersubscriptionv1subscription = googlecloudpaymentsresellersubscriptionv1subscription
  2570  	return c
  2571  }
  2572  
  2573  // SubscriptionId sets the optional parameter "subscriptionId": Required.
  2574  // Identifies the subscription resource on the Partner side. The value is
  2575  // restricted to 63 ASCII characters at the maximum. If a subscription was
  2576  // previously created with the same subscription_id, we will directly return
  2577  // that one.
  2578  func (c *PartnersSubscriptionsProvisionCall) SubscriptionId(subscriptionId string) *PartnersSubscriptionsProvisionCall {
  2579  	c.urlParams_.Set("subscriptionId", subscriptionId)
  2580  	return c
  2581  }
  2582  
  2583  // Fields allows partial responses to be retrieved. See
  2584  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2585  // details.
  2586  func (c *PartnersSubscriptionsProvisionCall) Fields(s ...googleapi.Field) *PartnersSubscriptionsProvisionCall {
  2587  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2588  	return c
  2589  }
  2590  
  2591  // Context sets the context to be used in this call's Do method.
  2592  func (c *PartnersSubscriptionsProvisionCall) Context(ctx context.Context) *PartnersSubscriptionsProvisionCall {
  2593  	c.ctx_ = ctx
  2594  	return c
  2595  }
  2596  
  2597  // Header returns a http.Header that can be modified by the caller to add
  2598  // headers to the request.
  2599  func (c *PartnersSubscriptionsProvisionCall) Header() http.Header {
  2600  	if c.header_ == nil {
  2601  		c.header_ = make(http.Header)
  2602  	}
  2603  	return c.header_
  2604  }
  2605  
  2606  func (c *PartnersSubscriptionsProvisionCall) doRequest(alt string) (*http.Response, error) {
  2607  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2608  	var body io.Reader = nil
  2609  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1subscription)
  2610  	if err != nil {
  2611  		return nil, err
  2612  	}
  2613  	c.urlParams_.Set("alt", alt)
  2614  	c.urlParams_.Set("prettyPrint", "false")
  2615  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subscriptions:provision")
  2616  	urls += "?" + c.urlParams_.Encode()
  2617  	req, err := http.NewRequest("POST", urls, body)
  2618  	if err != nil {
  2619  		return nil, err
  2620  	}
  2621  	req.Header = reqHeaders
  2622  	googleapi.Expand(req.URL, map[string]string{
  2623  		"parent": c.parentid,
  2624  	})
  2625  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2626  }
  2627  
  2628  // Do executes the "paymentsresellersubscription.partners.subscriptions.provision" call.
  2629  // Any non-2xx status code is an error. Response headers are in either
  2630  // *GoogleCloudPaymentsResellerSubscriptionV1Subscription.ServerResponse.Header
  2631  // or (if a response was returned at all) in error.(*googleapi.Error).Header.
  2632  // Use googleapi.IsNotModified to check whether the returned error was because
  2633  // http.StatusNotModified was returned.
  2634  func (c *PartnersSubscriptionsProvisionCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1Subscription, error) {
  2635  	gensupport.SetOptions(c.urlParams_, opts...)
  2636  	res, err := c.doRequest("json")
  2637  	if res != nil && res.StatusCode == http.StatusNotModified {
  2638  		if res.Body != nil {
  2639  			res.Body.Close()
  2640  		}
  2641  		return nil, gensupport.WrapError(&googleapi.Error{
  2642  			Code:   res.StatusCode,
  2643  			Header: res.Header,
  2644  		})
  2645  	}
  2646  	if err != nil {
  2647  		return nil, err
  2648  	}
  2649  	defer googleapi.CloseBody(res)
  2650  	if err := googleapi.CheckResponse(res); err != nil {
  2651  		return nil, gensupport.WrapError(err)
  2652  	}
  2653  	ret := &GoogleCloudPaymentsResellerSubscriptionV1Subscription{
  2654  		ServerResponse: googleapi.ServerResponse{
  2655  			Header:         res.Header,
  2656  			HTTPStatusCode: res.StatusCode,
  2657  		},
  2658  	}
  2659  	target := &ret
  2660  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2661  		return nil, err
  2662  	}
  2663  	return ret, nil
  2664  }
  2665  
  2666  type PartnersSubscriptionsUndoCancelCall struct {
  2667  	s                                                                      *Service
  2668  	name                                                                   string
  2669  	googlecloudpaymentsresellersubscriptionv1undocancelsubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest
  2670  	urlParams_                                                             gensupport.URLParams
  2671  	ctx_                                                                   context.Context
  2672  	header_                                                                http.Header
  2673  }
  2674  
  2675  // UndoCancel: Used by partners to revoke the pending cancellation of a
  2676  // subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If
  2677  // the subscription is already cancelled, the request will fail. It should be
  2678  // called directly by the partner using service accounts.
  2679  //
  2680  //   - name: The name of the subscription resource whose pending cancellation
  2681  //     needs to be undone. It will have the format of
  2682  //     "partners/{partner_id}/subscriptions/{subscription_id}".
  2683  func (r *PartnersSubscriptionsService) UndoCancel(name string, googlecloudpaymentsresellersubscriptionv1undocancelsubscriptionrequest *GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest) *PartnersSubscriptionsUndoCancelCall {
  2684  	c := &PartnersSubscriptionsUndoCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2685  	c.name = name
  2686  	c.googlecloudpaymentsresellersubscriptionv1undocancelsubscriptionrequest = googlecloudpaymentsresellersubscriptionv1undocancelsubscriptionrequest
  2687  	return c
  2688  }
  2689  
  2690  // Fields allows partial responses to be retrieved. See
  2691  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2692  // details.
  2693  func (c *PartnersSubscriptionsUndoCancelCall) Fields(s ...googleapi.Field) *PartnersSubscriptionsUndoCancelCall {
  2694  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2695  	return c
  2696  }
  2697  
  2698  // Context sets the context to be used in this call's Do method.
  2699  func (c *PartnersSubscriptionsUndoCancelCall) Context(ctx context.Context) *PartnersSubscriptionsUndoCancelCall {
  2700  	c.ctx_ = ctx
  2701  	return c
  2702  }
  2703  
  2704  // Header returns a http.Header that can be modified by the caller to add
  2705  // headers to the request.
  2706  func (c *PartnersSubscriptionsUndoCancelCall) Header() http.Header {
  2707  	if c.header_ == nil {
  2708  		c.header_ = make(http.Header)
  2709  	}
  2710  	return c.header_
  2711  }
  2712  
  2713  func (c *PartnersSubscriptionsUndoCancelCall) doRequest(alt string) (*http.Response, error) {
  2714  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2715  	var body io.Reader = nil
  2716  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpaymentsresellersubscriptionv1undocancelsubscriptionrequest)
  2717  	if err != nil {
  2718  		return nil, err
  2719  	}
  2720  	c.urlParams_.Set("alt", alt)
  2721  	c.urlParams_.Set("prettyPrint", "false")
  2722  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:undoCancel")
  2723  	urls += "?" + c.urlParams_.Encode()
  2724  	req, err := http.NewRequest("POST", urls, body)
  2725  	if err != nil {
  2726  		return nil, err
  2727  	}
  2728  	req.Header = reqHeaders
  2729  	googleapi.Expand(req.URL, map[string]string{
  2730  		"name": c.name,
  2731  	})
  2732  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2733  }
  2734  
  2735  // Do executes the "paymentsresellersubscription.partners.subscriptions.undoCancel" call.
  2736  // Any non-2xx status code is an error. Response headers are in either
  2737  // *GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse.Serv
  2738  // erResponse.Header or (if a response was returned at all) in
  2739  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2740  // whether the returned error was because http.StatusNotModified was returned.
  2741  func (c *PartnersSubscriptionsUndoCancelCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse, error) {
  2742  	gensupport.SetOptions(c.urlParams_, opts...)
  2743  	res, err := c.doRequest("json")
  2744  	if res != nil && res.StatusCode == http.StatusNotModified {
  2745  		if res.Body != nil {
  2746  			res.Body.Close()
  2747  		}
  2748  		return nil, gensupport.WrapError(&googleapi.Error{
  2749  			Code:   res.StatusCode,
  2750  			Header: res.Header,
  2751  		})
  2752  	}
  2753  	if err != nil {
  2754  		return nil, err
  2755  	}
  2756  	defer googleapi.CloseBody(res)
  2757  	if err := googleapi.CheckResponse(res); err != nil {
  2758  		return nil, gensupport.WrapError(err)
  2759  	}
  2760  	ret := &GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse{
  2761  		ServerResponse: googleapi.ServerResponse{
  2762  			Header:         res.Header,
  2763  			HTTPStatusCode: res.StatusCode,
  2764  		},
  2765  	}
  2766  	target := &ret
  2767  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2768  		return nil, err
  2769  	}
  2770  	return ret, nil
  2771  }
  2772  

View as plain text