...

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

Documentation: google.golang.org/api/pubsub/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 pubsub provides access to the Cloud Pub/Sub API.
     8  //
     9  // This package is DEPRECATED. Use package cloud.google.com/go/pubsub instead.
    10  //
    11  // For product documentation, see: https://cloud.google.com/pubsub/docs
    12  //
    13  // # Library status
    14  //
    15  // These client libraries are officially supported by Google. However, this
    16  // library is considered complete and is in maintenance mode. This means
    17  // that we will address critical bugs and security issues but will not add
    18  // any new features.
    19  //
    20  // When possible, we recommend using our newer
    21  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    22  // that are still actively being worked and iterated on.
    23  //
    24  // # Creating a client
    25  //
    26  // Usage example:
    27  //
    28  //	import "google.golang.org/api/pubsub/v1"
    29  //	...
    30  //	ctx := context.Background()
    31  //	pubsubService, err := pubsub.NewService(ctx)
    32  //
    33  // In this example, Google Application Default Credentials are used for
    34  // authentication. For information on how to create and obtain Application
    35  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    36  //
    37  // # Other authentication options
    38  //
    39  // By default, all available scopes (see "Constants") are used to authenticate.
    40  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    41  //
    42  //	pubsubService, err := pubsub.NewService(ctx, option.WithScopes(pubsub.PubsubScope))
    43  //
    44  // To use an API key for authentication (note: some APIs do not support API
    45  // keys), use [google.golang.org/api/option.WithAPIKey]:
    46  //
    47  //	pubsubService, err := pubsub.NewService(ctx, option.WithAPIKey("AIza..."))
    48  //
    49  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    50  // flow, use [google.golang.org/api/option.WithTokenSource]:
    51  //
    52  //	config := &oauth2.Config{...}
    53  //	// ...
    54  //	token, err := config.Exchange(ctx, ...)
    55  //	pubsubService, err := pubsub.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    56  //
    57  // See [google.golang.org/api/option.ClientOption] for details on options.
    58  package pubsub // import "google.golang.org/api/pubsub/v1"
    59  
    60  import (
    61  	"bytes"
    62  	"context"
    63  	"encoding/json"
    64  	"errors"
    65  	"fmt"
    66  	"io"
    67  	"net/http"
    68  	"net/url"
    69  	"strconv"
    70  	"strings"
    71  
    72  	googleapi "google.golang.org/api/googleapi"
    73  	internal "google.golang.org/api/internal"
    74  	gensupport "google.golang.org/api/internal/gensupport"
    75  	option "google.golang.org/api/option"
    76  	internaloption "google.golang.org/api/option/internaloption"
    77  	htransport "google.golang.org/api/transport/http"
    78  )
    79  
    80  // Always reference these packages, just in case the auto-generated code
    81  // below doesn't.
    82  var _ = bytes.NewBuffer
    83  var _ = strconv.Itoa
    84  var _ = fmt.Sprintf
    85  var _ = json.NewDecoder
    86  var _ = io.Copy
    87  var _ = url.Parse
    88  var _ = gensupport.MarshalJSON
    89  var _ = googleapi.Version
    90  var _ = errors.New
    91  var _ = strings.Replace
    92  var _ = context.Canceled
    93  var _ = internaloption.WithDefaultEndpoint
    94  var _ = internal.Version
    95  
    96  const apiId = "pubsub:v1"
    97  const apiName = "pubsub"
    98  const apiVersion = "v1"
    99  const basePath = "https://pubsub.googleapis.com/"
   100  const basePathTemplate = "https://pubsub.UNIVERSE_DOMAIN/"
   101  const mtlsBasePath = "https://pubsub.mtls.googleapis.com/"
   102  
   103  // OAuth2 scopes used by this API.
   104  const (
   105  	// See, edit, configure, and delete your Google Cloud data and see the email
   106  	// address for your Google Account.
   107  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   108  
   109  	// View and manage Pub/Sub topics and subscriptions
   110  	PubsubScope = "https://www.googleapis.com/auth/pubsub"
   111  )
   112  
   113  // NewService creates a new Service.
   114  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   115  	scopesOption := internaloption.WithDefaultScopes(
   116  		"https://www.googleapis.com/auth/cloud-platform",
   117  		"https://www.googleapis.com/auth/pubsub",
   118  	)
   119  	// NOTE: prepend, so we don't override user-specified scopes.
   120  	opts = append([]option.ClientOption{scopesOption}, opts...)
   121  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   122  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   123  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   124  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   125  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   126  	if err != nil {
   127  		return nil, err
   128  	}
   129  	s, err := New(client)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	if endpoint != "" {
   134  		s.BasePath = endpoint
   135  	}
   136  	return s, nil
   137  }
   138  
   139  // New creates a new Service. It uses the provided http.Client for requests.
   140  //
   141  // Deprecated: please use NewService instead.
   142  // To provide a custom HTTP client, use option.WithHTTPClient.
   143  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   144  func New(client *http.Client) (*Service, error) {
   145  	if client == nil {
   146  		return nil, errors.New("client is nil")
   147  	}
   148  	s := &Service{client: client, BasePath: basePath}
   149  	s.Projects = NewProjectsService(s)
   150  	return s, nil
   151  }
   152  
   153  type Service struct {
   154  	client    *http.Client
   155  	BasePath  string // API endpoint base URL
   156  	UserAgent string // optional additional User-Agent fragment
   157  
   158  	Projects *ProjectsService
   159  }
   160  
   161  func (s *Service) userAgent() string {
   162  	if s.UserAgent == "" {
   163  		return googleapi.UserAgent
   164  	}
   165  	return googleapi.UserAgent + " " + s.UserAgent
   166  }
   167  
   168  func NewProjectsService(s *Service) *ProjectsService {
   169  	rs := &ProjectsService{s: s}
   170  	rs.Schemas = NewProjectsSchemasService(s)
   171  	rs.Snapshots = NewProjectsSnapshotsService(s)
   172  	rs.Subscriptions = NewProjectsSubscriptionsService(s)
   173  	rs.Topics = NewProjectsTopicsService(s)
   174  	return rs
   175  }
   176  
   177  type ProjectsService struct {
   178  	s *Service
   179  
   180  	Schemas *ProjectsSchemasService
   181  
   182  	Snapshots *ProjectsSnapshotsService
   183  
   184  	Subscriptions *ProjectsSubscriptionsService
   185  
   186  	Topics *ProjectsTopicsService
   187  }
   188  
   189  func NewProjectsSchemasService(s *Service) *ProjectsSchemasService {
   190  	rs := &ProjectsSchemasService{s: s}
   191  	return rs
   192  }
   193  
   194  type ProjectsSchemasService struct {
   195  	s *Service
   196  }
   197  
   198  func NewProjectsSnapshotsService(s *Service) *ProjectsSnapshotsService {
   199  	rs := &ProjectsSnapshotsService{s: s}
   200  	return rs
   201  }
   202  
   203  type ProjectsSnapshotsService struct {
   204  	s *Service
   205  }
   206  
   207  func NewProjectsSubscriptionsService(s *Service) *ProjectsSubscriptionsService {
   208  	rs := &ProjectsSubscriptionsService{s: s}
   209  	return rs
   210  }
   211  
   212  type ProjectsSubscriptionsService struct {
   213  	s *Service
   214  }
   215  
   216  func NewProjectsTopicsService(s *Service) *ProjectsTopicsService {
   217  	rs := &ProjectsTopicsService{s: s}
   218  	rs.Snapshots = NewProjectsTopicsSnapshotsService(s)
   219  	rs.Subscriptions = NewProjectsTopicsSubscriptionsService(s)
   220  	return rs
   221  }
   222  
   223  type ProjectsTopicsService struct {
   224  	s *Service
   225  
   226  	Snapshots *ProjectsTopicsSnapshotsService
   227  
   228  	Subscriptions *ProjectsTopicsSubscriptionsService
   229  }
   230  
   231  func NewProjectsTopicsSnapshotsService(s *Service) *ProjectsTopicsSnapshotsService {
   232  	rs := &ProjectsTopicsSnapshotsService{s: s}
   233  	return rs
   234  }
   235  
   236  type ProjectsTopicsSnapshotsService struct {
   237  	s *Service
   238  }
   239  
   240  func NewProjectsTopicsSubscriptionsService(s *Service) *ProjectsTopicsSubscriptionsService {
   241  	rs := &ProjectsTopicsSubscriptionsService{s: s}
   242  	return rs
   243  }
   244  
   245  type ProjectsTopicsSubscriptionsService struct {
   246  	s *Service
   247  }
   248  
   249  // AcknowledgeRequest: Request for the Acknowledge method.
   250  type AcknowledgeRequest struct {
   251  	// AckIds: Required. The acknowledgment ID for the messages being acknowledged
   252  	// that was returned by the Pub/Sub system in the `Pull` response. Must not be
   253  	// empty.
   254  	AckIds []string `json:"ackIds,omitempty"`
   255  	// ForceSendFields is a list of field names (e.g. "AckIds") to unconditionally
   256  	// include in API requests. By default, fields with empty or default values are
   257  	// omitted from API requests. See
   258  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   259  	// details.
   260  	ForceSendFields []string `json:"-"`
   261  	// NullFields is a list of field names (e.g. "AckIds") to include in API
   262  	// requests with the JSON null value. By default, fields with empty values are
   263  	// omitted from API requests. See
   264  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   265  	NullFields []string `json:"-"`
   266  }
   267  
   268  func (s *AcknowledgeRequest) MarshalJSON() ([]byte, error) {
   269  	type NoMethod AcknowledgeRequest
   270  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   271  }
   272  
   273  // AvroConfig: Configuration for writing message data in Avro format. Message
   274  // payloads and metadata will be written to files as an Avro binary.
   275  type AvroConfig struct {
   276  	// WriteMetadata: Optional. When true, write the subscription name, message_id,
   277  	// publish_time, attributes, and ordering_key as additional fields in the
   278  	// output. The subscription name, message_id, and publish_time fields are put
   279  	// in their own fields while all other message properties other than data (for
   280  	// example, an ordering_key, if present) are added as entries in the attributes
   281  	// map.
   282  	WriteMetadata bool `json:"writeMetadata,omitempty"`
   283  	// ForceSendFields is a list of field names (e.g. "WriteMetadata") 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. "WriteMetadata") 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 *AvroConfig) MarshalJSON() ([]byte, error) {
   297  	type NoMethod AvroConfig
   298  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   299  }
   300  
   301  // AwsKinesis: Ingestion settings for Amazon Kinesis Data Streams.
   302  type AwsKinesis struct {
   303  	// AwsRoleArn: Required. AWS role ARN to be used for Federated Identity
   304  	// authentication with Kinesis. Check the Pub/Sub docs for how to set up this
   305  	// role and the required permissions that need to be attached to it.
   306  	AwsRoleArn string `json:"awsRoleArn,omitempty"`
   307  	// ConsumerArn: Required. The Kinesis consumer ARN to used for ingestion in
   308  	// Enhanced Fan-Out mode. The consumer must be already created and ready to be
   309  	// used.
   310  	ConsumerArn string `json:"consumerArn,omitempty"`
   311  	// GcpServiceAccount: Required. The GCP service account to be used for
   312  	// Federated Identity authentication with Kinesis (via a
   313  	// `AssumeRoleWithWebIdentity` call for the provided role). The `aws_role_arn`
   314  	// must be set up with `accounts.google.com:sub` equals to this service account
   315  	// number.
   316  	GcpServiceAccount string `json:"gcpServiceAccount,omitempty"`
   317  	// State: Output only. An output-only field that indicates the state of the
   318  	// Kinesis ingestion source.
   319  	//
   320  	// Possible values:
   321  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
   322  	//   "ACTIVE" - Ingestion is active.
   323  	//   "KINESIS_PERMISSION_DENIED" - Permission denied encountered while
   324  	// consuming data from Kinesis. This can happen if: - The provided
   325  	// `aws_role_arn` does not exist or does not have the appropriate permissions
   326  	// attached. - The provided `aws_role_arn` is not set up properly for Identity
   327  	// Federation using `gcp_service_account`. - The Pub/Sub SA is not granted the
   328  	// `iam.serviceAccounts.getOpenIdToken` permission on `gcp_service_account`.
   329  	//   "PUBLISH_PERMISSION_DENIED" - Permission denied encountered while
   330  	// publishing to the topic. This can happen if the Pub/Sub SA has not been
   331  	// granted the [appropriate publish
   332  	// permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publi
   333  	// sher)
   334  	//   "STREAM_NOT_FOUND" - The Kinesis stream does not exist.
   335  	//   "CONSUMER_NOT_FOUND" - The Kinesis consumer does not exist.
   336  	State string `json:"state,omitempty"`
   337  	// StreamArn: Required. The Kinesis stream ARN to ingest data from.
   338  	StreamArn string `json:"streamArn,omitempty"`
   339  	// ForceSendFields is a list of field names (e.g. "AwsRoleArn") to
   340  	// unconditionally include in API requests. By default, fields with empty or
   341  	// default values are omitted from API requests. See
   342  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   343  	// details.
   344  	ForceSendFields []string `json:"-"`
   345  	// NullFields is a list of field names (e.g. "AwsRoleArn") to include in API
   346  	// requests with the JSON null value. By default, fields with empty values are
   347  	// omitted from API requests. See
   348  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   349  	NullFields []string `json:"-"`
   350  }
   351  
   352  func (s *AwsKinesis) MarshalJSON() ([]byte, error) {
   353  	type NoMethod AwsKinesis
   354  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   355  }
   356  
   357  // BigQueryConfig: Configuration for a BigQuery subscription.
   358  type BigQueryConfig struct {
   359  	// DropUnknownFields: Optional. When true and use_topic_schema is true, any
   360  	// fields that are a part of the topic schema that are not part of the BigQuery
   361  	// table schema are dropped when writing to BigQuery. Otherwise, the schemas
   362  	// must be kept in sync and any messages with extra fields are not written and
   363  	// remain in the subscription's backlog.
   364  	DropUnknownFields bool `json:"dropUnknownFields,omitempty"`
   365  	// ServiceAccountEmail: Optional. The service account to use to write to
   366  	// BigQuery. The subscription creator or updater that specifies this field must
   367  	// have `iam.serviceAccounts.actAs` permission on the service account. If not
   368  	// specified, the Pub/Sub service agent
   369  	// (https://cloud.google.com/iam/docs/service-agents),
   370  	// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
   371  	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
   372  	// State: Output only. An output-only field that indicates whether or not the
   373  	// subscription can receive messages.
   374  	//
   375  	// Possible values:
   376  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
   377  	//   "ACTIVE" - The subscription can actively send messages to BigQuery
   378  	//   "PERMISSION_DENIED" - Cannot write to the BigQuery table because of
   379  	// permission denied errors. This can happen if - Pub/Sub SA has not been
   380  	// granted the [appropriate BigQuery IAM
   381  	// permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_
   382  	// bigquery_service_account) - bigquery.googleapis.com API is not enabled for
   383  	// the project
   384  	// ([instructions](https://cloud.google.com/service-usage/docs/enable-disable))
   385  	//   "NOT_FOUND" - Cannot write to the BigQuery table because it does not
   386  	// exist.
   387  	//   "SCHEMA_MISMATCH" - Cannot write to the BigQuery table due to a schema
   388  	// mismatch.
   389  	//   "IN_TRANSIT_LOCATION_RESTRICTION" - Cannot write to the destination
   390  	// because enforce_in_transit is set to true and the destination locations are
   391  	// not in the allowed regions.
   392  	State string `json:"state,omitempty"`
   393  	// Table: Optional. The name of the table to which to write data, of the form
   394  	// {projectId}.{datasetId}.{tableId}
   395  	Table string `json:"table,omitempty"`
   396  	// UseTableSchema: Optional. When true, use the BigQuery table's schema as the
   397  	// columns to write to in BigQuery. `use_table_schema` and `use_topic_schema`
   398  	// cannot be enabled at the same time.
   399  	UseTableSchema bool `json:"useTableSchema,omitempty"`
   400  	// UseTopicSchema: Optional. When true, use the topic's schema as the columns
   401  	// to write to in BigQuery, if it exists. `use_topic_schema` and
   402  	// `use_table_schema` cannot be enabled at the same time.
   403  	UseTopicSchema bool `json:"useTopicSchema,omitempty"`
   404  	// WriteMetadata: Optional. When true, write the subscription name, message_id,
   405  	// publish_time, attributes, and ordering_key to additional columns in the
   406  	// table. The subscription name, message_id, and publish_time fields are put in
   407  	// their own columns while all other message properties (other than data) are
   408  	// written to a JSON object in the attributes column.
   409  	WriteMetadata bool `json:"writeMetadata,omitempty"`
   410  	// ForceSendFields is a list of field names (e.g. "DropUnknownFields") to
   411  	// unconditionally include in API requests. By default, fields with empty or
   412  	// default values are omitted from API requests. See
   413  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   414  	// details.
   415  	ForceSendFields []string `json:"-"`
   416  	// NullFields is a list of field names (e.g. "DropUnknownFields") to include in
   417  	// API requests with the JSON null value. By default, fields with empty values
   418  	// are omitted from API requests. See
   419  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   420  	NullFields []string `json:"-"`
   421  }
   422  
   423  func (s *BigQueryConfig) MarshalJSON() ([]byte, error) {
   424  	type NoMethod BigQueryConfig
   425  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   426  }
   427  
   428  // Binding: Associates `members`, or principals, with a `role`.
   429  type Binding struct {
   430  	// Condition: The condition that is associated with this binding. If the
   431  	// condition evaluates to `true`, then this binding applies to the current
   432  	// request. If the condition evaluates to `false`, then this binding does not
   433  	// apply to the current request. However, a different role binding might grant
   434  	// the same role to one or more of the principals in this binding. To learn
   435  	// which resources support conditions in their IAM policies, see the IAM
   436  	// documentation
   437  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   438  	Condition *Expr `json:"condition,omitempty"`
   439  	// Members: Specifies the principals requesting access for a Google Cloud
   440  	// resource. `members` can have the following values: * `allUsers`: A special
   441  	// identifier that represents anyone who is on the internet; with or without a
   442  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   443  	// represents anyone who is authenticated with a Google account or a service
   444  	// account. Does not include identities that come from external identity
   445  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   446  	// address that represents a specific Google account. For example,
   447  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   448  	// represents a Google service account. For example,
   449  	// `my-other-app@appspot.gserviceaccount.com`. *
   450  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   451  	// identifier for a Kubernetes service account
   452  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   453  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   454  	// `group:{emailid}`: An email address that represents a Google group. For
   455  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   456  	// (primary) that represents all the users of that domain. For example,
   457  	// `google.com` or `example.com`. *
   458  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   459  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   460  	// pool. *
   461  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   462  	// group/{group_id}`: All workforce identities in a group. *
   463  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   464  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   465  	// a specific attribute value. *
   466  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   467  	// *`: All identities in a workforce identity pool. *
   468  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   469  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   470  	// identity in a workload identity pool. *
   471  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   472  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   473  	// group. *
   474  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   475  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   476  	// `: All identities in a workload identity pool with a certain attribute. *
   477  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   478  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   479  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   480  	// unique identifier) representing a user that has been recently deleted. For
   481  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   482  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   483  	// retains the role in the binding. *
   484  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   485  	// unique identifier) representing a service account that has been recently
   486  	// deleted. For example,
   487  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   488  	// service account is undeleted, this value reverts to
   489  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   490  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   491  	// address (plus unique identifier) representing a Google group that has been
   492  	// recently deleted. For example,
   493  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   494  	// this value reverts to `group:{emailid}` and the recovered group retains the
   495  	// role in the binding. *
   496  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   497  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   498  	// workforce identity pool. For example,
   499  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   500  	// ol-id/subject/my-subject-attribute-value`.
   501  	Members []string `json:"members,omitempty"`
   502  	// Role: Role that is assigned to the list of `members`, or principals. For
   503  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   504  	// of the IAM roles and permissions, see the IAM documentation
   505  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   506  	// available pre-defined roles, see here
   507  	// (https://cloud.google.com/iam/docs/understanding-roles).
   508  	Role string `json:"role,omitempty"`
   509  	// ForceSendFields is a list of field names (e.g. "Condition") to
   510  	// unconditionally include in API requests. By default, fields with empty or
   511  	// default values are omitted from API requests. See
   512  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   513  	// details.
   514  	ForceSendFields []string `json:"-"`
   515  	// NullFields is a list of field names (e.g. "Condition") to include in API
   516  	// requests with the JSON null value. By default, fields with empty values are
   517  	// omitted from API requests. See
   518  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   519  	NullFields []string `json:"-"`
   520  }
   521  
   522  func (s *Binding) MarshalJSON() ([]byte, error) {
   523  	type NoMethod Binding
   524  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   525  }
   526  
   527  // CloudStorageConfig: Configuration for a Cloud Storage subscription.
   528  type CloudStorageConfig struct {
   529  	// AvroConfig: Optional. If set, message data will be written to Cloud Storage
   530  	// in Avro format.
   531  	AvroConfig *AvroConfig `json:"avroConfig,omitempty"`
   532  	// Bucket: Required. User-provided name for the Cloud Storage bucket. The
   533  	// bucket must be created by the user. The bucket name must be without any
   534  	// prefix like "gs://". See the [bucket naming requirements]
   535  	// (https://cloud.google.com/storage/docs/buckets#naming).
   536  	Bucket string `json:"bucket,omitempty"`
   537  	// FilenameDatetimeFormat: Optional. User-provided format string specifying how
   538  	// to represent datetimes in Cloud Storage filenames. See the datetime format
   539  	// guidance
   540  	// (https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names).
   541  	FilenameDatetimeFormat string `json:"filenameDatetimeFormat,omitempty"`
   542  	// FilenamePrefix: Optional. User-provided prefix for Cloud Storage filename.
   543  	// See the object naming requirements
   544  	// (https://cloud.google.com/storage/docs/objects#naming).
   545  	FilenamePrefix string `json:"filenamePrefix,omitempty"`
   546  	// FilenameSuffix: Optional. User-provided suffix for Cloud Storage filename.
   547  	// See the object naming requirements
   548  	// (https://cloud.google.com/storage/docs/objects#naming). Must not end in "/".
   549  	FilenameSuffix string `json:"filenameSuffix,omitempty"`
   550  	// MaxBytes: Optional. The maximum bytes that can be written to a Cloud Storage
   551  	// file before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit
   552  	// may be exceeded in cases where messages are larger than the limit.
   553  	MaxBytes int64 `json:"maxBytes,omitempty,string"`
   554  	// MaxDuration: Optional. The maximum duration that can elapse before a new
   555  	// Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5
   556  	// minutes. May not exceed the subscription's acknowledgement deadline.
   557  	MaxDuration string `json:"maxDuration,omitempty"`
   558  	// ServiceAccountEmail: Optional. The service account to use to write to Cloud
   559  	// Storage. The subscription creator or updater that specifies this field must
   560  	// have `iam.serviceAccounts.actAs` permission on the service account. If not
   561  	// specified, the Pub/Sub service agent
   562  	// (https://cloud.google.com/iam/docs/service-agents),
   563  	// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
   564  	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
   565  	// State: Output only. An output-only field that indicates whether or not the
   566  	// subscription can receive messages.
   567  	//
   568  	// Possible values:
   569  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
   570  	//   "ACTIVE" - The subscription can actively send messages to Cloud Storage.
   571  	//   "PERMISSION_DENIED" - Cannot write to the Cloud Storage bucket because of
   572  	// permission denied errors.
   573  	//   "NOT_FOUND" - Cannot write to the Cloud Storage bucket because it does not
   574  	// exist.
   575  	//   "IN_TRANSIT_LOCATION_RESTRICTION" - Cannot write to the destination
   576  	// because enforce_in_transit is set to true and the destination locations are
   577  	// not in the allowed regions.
   578  	//   "SCHEMA_MISMATCH" - Cannot write to the Cloud Storage bucket due to an
   579  	// incompatibility between the topic schema and subscription settings.
   580  	State string `json:"state,omitempty"`
   581  	// TextConfig: Optional. If set, message data will be written to Cloud Storage
   582  	// in text format.
   583  	TextConfig *TextConfig `json:"textConfig,omitempty"`
   584  	// ForceSendFields is a list of field names (e.g. "AvroConfig") to
   585  	// unconditionally include in API requests. By default, fields with empty or
   586  	// default values are omitted from API requests. See
   587  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   588  	// details.
   589  	ForceSendFields []string `json:"-"`
   590  	// NullFields is a list of field names (e.g. "AvroConfig") to include in API
   591  	// requests with the JSON null value. By default, fields with empty values are
   592  	// omitted from API requests. See
   593  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   594  	NullFields []string `json:"-"`
   595  }
   596  
   597  func (s *CloudStorageConfig) MarshalJSON() ([]byte, error) {
   598  	type NoMethod CloudStorageConfig
   599  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   600  }
   601  
   602  // CommitSchemaRequest: Request for CommitSchema method.
   603  type CommitSchemaRequest struct {
   604  	// Schema: Required. The schema revision to commit.
   605  	Schema *Schema `json:"schema,omitempty"`
   606  	// ForceSendFields is a list of field names (e.g. "Schema") to unconditionally
   607  	// include in API requests. By default, fields with empty or default values are
   608  	// omitted from API requests. See
   609  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   610  	// details.
   611  	ForceSendFields []string `json:"-"`
   612  	// NullFields is a list of field names (e.g. "Schema") to include in API
   613  	// requests with the JSON null value. By default, fields with empty values are
   614  	// omitted from API requests. See
   615  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   616  	NullFields []string `json:"-"`
   617  }
   618  
   619  func (s *CommitSchemaRequest) MarshalJSON() ([]byte, error) {
   620  	type NoMethod CommitSchemaRequest
   621  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   622  }
   623  
   624  // CreateSnapshotRequest: Request for the `CreateSnapshot` method.
   625  type CreateSnapshotRequest struct {
   626  	// Labels: Optional. See Creating and managing labels
   627  	// (https://cloud.google.com/pubsub/docs/labels).
   628  	Labels map[string]string `json:"labels,omitempty"`
   629  	// Subscription: Required. The subscription whose backlog the snapshot retains.
   630  	// Specifically, the created snapshot is guaranteed to retain: (a) The existing
   631  	// backlog on the subscription. More precisely, this is defined as the messages
   632  	// in the subscription's backlog that are unacknowledged upon the successful
   633  	// completion of the `CreateSnapshot` request; as well as: (b) Any messages
   634  	// published to the subscription's topic following the successful completion of
   635  	// the CreateSnapshot request. Format is
   636  	// `projects/{project}/subscriptions/{sub}`.
   637  	Subscription string `json:"subscription,omitempty"`
   638  	// ForceSendFields is a list of field names (e.g. "Labels") to unconditionally
   639  	// include in API requests. By default, fields with empty or default values are
   640  	// omitted from API requests. See
   641  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   642  	// details.
   643  	ForceSendFields []string `json:"-"`
   644  	// NullFields is a list of field names (e.g. "Labels") to include in API
   645  	// requests with the JSON null value. By default, fields with empty values are
   646  	// omitted from API requests. See
   647  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   648  	NullFields []string `json:"-"`
   649  }
   650  
   651  func (s *CreateSnapshotRequest) MarshalJSON() ([]byte, error) {
   652  	type NoMethod CreateSnapshotRequest
   653  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   654  }
   655  
   656  // DeadLetterPolicy: Dead lettering is done on a best effort basis. The same
   657  // message might be dead lettered multiple times. If validation on any of the
   658  // fields fails at subscription creation/updation, the create/update
   659  // subscription request will fail.
   660  type DeadLetterPolicy struct {
   661  	// DeadLetterTopic: Optional. The name of the topic to which dead letter
   662  	// messages should be published. Format is
   663  	// `projects/{project}/topics/{topic}`.The Pub/Sub service account associated
   664  	// with the enclosing subscription's parent project (i.e.,
   665  	// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
   666  	// permission to Publish() to this topic. The operation will fail if the topic
   667  	// does not exist. Users should ensure that there is a subscription attached to
   668  	// this topic since messages published to a topic with no subscriptions are
   669  	// lost.
   670  	DeadLetterTopic string `json:"deadLetterTopic,omitempty"`
   671  	// MaxDeliveryAttempts: Optional. The maximum number of delivery attempts for
   672  	// any message. The value must be between 5 and 100. The number of delivery
   673  	// attempts is defined as 1 + (the sum of number of NACKs and number of times
   674  	// the acknowledgement deadline has been exceeded for the message). A NACK is
   675  	// any call to ModifyAckDeadline with a 0 deadline. Note that client libraries
   676  	// may automatically extend ack_deadlines. This field will be honored on a best
   677  	// effort basis. If this parameter is 0, a default value of 5 is used.
   678  	MaxDeliveryAttempts int64 `json:"maxDeliveryAttempts,omitempty"`
   679  	// ForceSendFields is a list of field names (e.g. "DeadLetterTopic") to
   680  	// unconditionally include in API requests. By default, fields with empty or
   681  	// default values are omitted from API requests. See
   682  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   683  	// details.
   684  	ForceSendFields []string `json:"-"`
   685  	// NullFields is a list of field names (e.g. "DeadLetterTopic") to include in
   686  	// API requests with the JSON null value. By default, fields with empty values
   687  	// are omitted from API requests. See
   688  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   689  	NullFields []string `json:"-"`
   690  }
   691  
   692  func (s *DeadLetterPolicy) MarshalJSON() ([]byte, error) {
   693  	type NoMethod DeadLetterPolicy
   694  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   695  }
   696  
   697  // DetachSubscriptionResponse: Response for the DetachSubscription method.
   698  // Reserved for future use.
   699  type DetachSubscriptionResponse struct {
   700  	// ServerResponse contains the HTTP response code and headers from the server.
   701  	googleapi.ServerResponse `json:"-"`
   702  }
   703  
   704  // Empty: A generic empty message that you can re-use to avoid defining
   705  // duplicated empty messages in your APIs. A typical example is to use it as
   706  // the request or the response type of an API method. For instance: service Foo
   707  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   708  type Empty struct {
   709  	// ServerResponse contains the HTTP response code and headers from the server.
   710  	googleapi.ServerResponse `json:"-"`
   711  }
   712  
   713  // ExpirationPolicy: A policy that specifies the conditions for resource
   714  // expiration (i.e., automatic resource deletion).
   715  type ExpirationPolicy struct {
   716  	// Ttl: Optional. Specifies the "time-to-live" duration for an associated
   717  	// resource. The resource expires if it is not active for a period of `ttl`.
   718  	// The definition of "activity" depends on the type of the associated resource.
   719  	// The minimum and maximum allowed values for `ttl` depend on the type of the
   720  	// associated resource, as well. If `ttl` is not set, the associated resource
   721  	// never expires.
   722  	Ttl string `json:"ttl,omitempty"`
   723  	// ForceSendFields is a list of field names (e.g. "Ttl") to unconditionally
   724  	// include in API requests. By default, fields with empty or default values are
   725  	// omitted from API requests. See
   726  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   727  	// details.
   728  	ForceSendFields []string `json:"-"`
   729  	// NullFields is a list of field names (e.g. "Ttl") to include in API requests
   730  	// with the JSON null value. By default, fields with empty values are omitted
   731  	// from API requests. See
   732  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   733  	NullFields []string `json:"-"`
   734  }
   735  
   736  func (s *ExpirationPolicy) MarshalJSON() ([]byte, error) {
   737  	type NoMethod ExpirationPolicy
   738  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   739  }
   740  
   741  // Expr: Represents a textual expression in the Common Expression Language
   742  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   743  // of CEL are documented at https://github.com/google/cel-spec. Example
   744  // (Comparison): title: "Summary size limit" description: "Determines if a
   745  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   746  // Example (Equality): title: "Requestor is owner" description: "Determines if
   747  // requestor is the document owner" expression: "document.owner ==
   748  // request.auth.claims.email" Example (Logic): title: "Public documents"
   749  // description: "Determine whether the document should be publicly visible"
   750  // expression: "document.type != 'private' && document.type != 'internal'"
   751  // Example (Data Manipulation): title: "Notification string" description:
   752  // "Create a notification string with a timestamp." expression: "'New message
   753  // received at ' + string(document.create_time)" The exact variables and
   754  // functions that may be referenced within an expression are determined by the
   755  // service that evaluates it. See the service documentation for additional
   756  // information.
   757  type Expr struct {
   758  	// Description: Optional. Description of the expression. This is a longer text
   759  	// which describes the expression, e.g. when hovered over it in a UI.
   760  	Description string `json:"description,omitempty"`
   761  	// Expression: Textual representation of an expression in Common Expression
   762  	// Language syntax.
   763  	Expression string `json:"expression,omitempty"`
   764  	// Location: Optional. String indicating the location of the expression for
   765  	// error reporting, e.g. a file name and a position in the file.
   766  	Location string `json:"location,omitempty"`
   767  	// Title: Optional. Title for the expression, i.e. a short string describing
   768  	// its purpose. This can be used e.g. in UIs which allow to enter the
   769  	// expression.
   770  	Title string `json:"title,omitempty"`
   771  	// ForceSendFields is a list of field names (e.g. "Description") to
   772  	// unconditionally include in API requests. By default, fields with empty or
   773  	// default values are omitted from API requests. See
   774  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   775  	// details.
   776  	ForceSendFields []string `json:"-"`
   777  	// NullFields is a list of field names (e.g. "Description") to include in API
   778  	// requests with the JSON null value. By default, fields with empty values are
   779  	// omitted from API requests. See
   780  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   781  	NullFields []string `json:"-"`
   782  }
   783  
   784  func (s *Expr) MarshalJSON() ([]byte, error) {
   785  	type NoMethod Expr
   786  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   787  }
   788  
   789  // IngestionDataSourceSettings: Settings for an ingestion data source on a
   790  // topic.
   791  type IngestionDataSourceSettings struct {
   792  	// AwsKinesis: Optional. Amazon Kinesis Data Streams.
   793  	AwsKinesis *AwsKinesis `json:"awsKinesis,omitempty"`
   794  	// ForceSendFields is a list of field names (e.g. "AwsKinesis") to
   795  	// unconditionally include in API requests. By default, fields with empty or
   796  	// default values are omitted from API requests. See
   797  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   798  	// details.
   799  	ForceSendFields []string `json:"-"`
   800  	// NullFields is a list of field names (e.g. "AwsKinesis") to include in API
   801  	// requests with the JSON null value. By default, fields with empty values are
   802  	// omitted from API requests. See
   803  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   804  	NullFields []string `json:"-"`
   805  }
   806  
   807  func (s *IngestionDataSourceSettings) MarshalJSON() ([]byte, error) {
   808  	type NoMethod IngestionDataSourceSettings
   809  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   810  }
   811  
   812  // ListSchemaRevisionsResponse: Response for the `ListSchemaRevisions` method.
   813  type ListSchemaRevisionsResponse struct {
   814  	// NextPageToken: A token that can be sent as `page_token` to retrieve the next
   815  	// page. If this field is empty, there are no subsequent pages.
   816  	NextPageToken string `json:"nextPageToken,omitempty"`
   817  	// Schemas: The revisions of the schema.
   818  	Schemas []*Schema `json:"schemas,omitempty"`
   819  
   820  	// ServerResponse contains the HTTP response code and headers from the server.
   821  	googleapi.ServerResponse `json:"-"`
   822  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   823  	// unconditionally include in API requests. By default, fields with empty or
   824  	// default values are omitted from API requests. See
   825  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   826  	// details.
   827  	ForceSendFields []string `json:"-"`
   828  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   829  	// requests with the JSON null value. By default, fields with empty values are
   830  	// omitted from API requests. See
   831  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   832  	NullFields []string `json:"-"`
   833  }
   834  
   835  func (s *ListSchemaRevisionsResponse) MarshalJSON() ([]byte, error) {
   836  	type NoMethod ListSchemaRevisionsResponse
   837  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   838  }
   839  
   840  // ListSchemasResponse: Response for the `ListSchemas` method.
   841  type ListSchemasResponse struct {
   842  	// NextPageToken: If not empty, indicates that there may be more schemas that
   843  	// match the request; this value should be passed in a new
   844  	// `ListSchemasRequest`.
   845  	NextPageToken string `json:"nextPageToken,omitempty"`
   846  	// Schemas: The resulting schemas.
   847  	Schemas []*Schema `json:"schemas,omitempty"`
   848  
   849  	// ServerResponse contains the HTTP response code and headers from the server.
   850  	googleapi.ServerResponse `json:"-"`
   851  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   852  	// unconditionally include in API requests. By default, fields with empty or
   853  	// default values are omitted from API requests. See
   854  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   855  	// details.
   856  	ForceSendFields []string `json:"-"`
   857  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   858  	// requests with the JSON null value. By default, fields with empty values are
   859  	// omitted from API requests. See
   860  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   861  	NullFields []string `json:"-"`
   862  }
   863  
   864  func (s *ListSchemasResponse) MarshalJSON() ([]byte, error) {
   865  	type NoMethod ListSchemasResponse
   866  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   867  }
   868  
   869  // ListSnapshotsResponse: Response for the `ListSnapshots` method.
   870  type ListSnapshotsResponse struct {
   871  	// NextPageToken: Optional. If not empty, indicates that there may be more
   872  	// snapshot that match the request; this value should be passed in a new
   873  	// `ListSnapshotsRequest`.
   874  	NextPageToken string `json:"nextPageToken,omitempty"`
   875  	// Snapshots: Optional. The resulting snapshots.
   876  	Snapshots []*Snapshot `json:"snapshots,omitempty"`
   877  
   878  	// ServerResponse contains the HTTP response code and headers from the server.
   879  	googleapi.ServerResponse `json:"-"`
   880  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   881  	// unconditionally include in API requests. By default, fields with empty or
   882  	// default values are omitted from API requests. See
   883  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   884  	// details.
   885  	ForceSendFields []string `json:"-"`
   886  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   887  	// requests with the JSON null value. By default, fields with empty values are
   888  	// omitted from API requests. See
   889  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   890  	NullFields []string `json:"-"`
   891  }
   892  
   893  func (s *ListSnapshotsResponse) MarshalJSON() ([]byte, error) {
   894  	type NoMethod ListSnapshotsResponse
   895  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   896  }
   897  
   898  // ListSubscriptionsResponse: Response for the `ListSubscriptions` method.
   899  type ListSubscriptionsResponse struct {
   900  	// NextPageToken: Optional. If not empty, indicates that there may be more
   901  	// subscriptions that match the request; this value should be passed in a new
   902  	// `ListSubscriptionsRequest` to get more subscriptions.
   903  	NextPageToken string `json:"nextPageToken,omitempty"`
   904  	// Subscriptions: Optional. The subscriptions that match the request.
   905  	Subscriptions []*Subscription `json:"subscriptions,omitempty"`
   906  
   907  	// ServerResponse contains the HTTP response code and headers from the server.
   908  	googleapi.ServerResponse `json:"-"`
   909  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   910  	// unconditionally include in API requests. By default, fields with empty or
   911  	// default values are omitted from API requests. See
   912  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   913  	// details.
   914  	ForceSendFields []string `json:"-"`
   915  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   916  	// requests with the JSON null value. By default, fields with empty values are
   917  	// omitted from API requests. See
   918  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   919  	NullFields []string `json:"-"`
   920  }
   921  
   922  func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) {
   923  	type NoMethod ListSubscriptionsResponse
   924  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   925  }
   926  
   927  // ListTopicSnapshotsResponse: Response for the `ListTopicSnapshots` method.
   928  type ListTopicSnapshotsResponse struct {
   929  	// NextPageToken: Optional. If not empty, indicates that there may be more
   930  	// snapshots that match the request; this value should be passed in a new
   931  	// `ListTopicSnapshotsRequest` to get more snapshots.
   932  	NextPageToken string `json:"nextPageToken,omitempty"`
   933  	// Snapshots: Optional. The names of the snapshots that match the request.
   934  	Snapshots []string `json:"snapshots,omitempty"`
   935  
   936  	// ServerResponse contains the HTTP response code and headers from the server.
   937  	googleapi.ServerResponse `json:"-"`
   938  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   939  	// unconditionally include in API requests. By default, fields with empty or
   940  	// default values are omitted from API requests. See
   941  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   942  	// details.
   943  	ForceSendFields []string `json:"-"`
   944  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   945  	// requests with the JSON null value. By default, fields with empty values are
   946  	// omitted from API requests. See
   947  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   948  	NullFields []string `json:"-"`
   949  }
   950  
   951  func (s *ListTopicSnapshotsResponse) MarshalJSON() ([]byte, error) {
   952  	type NoMethod ListTopicSnapshotsResponse
   953  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   954  }
   955  
   956  // ListTopicSubscriptionsResponse: Response for the `ListTopicSubscriptions`
   957  // method.
   958  type ListTopicSubscriptionsResponse struct {
   959  	// NextPageToken: Optional. If not empty, indicates that there may be more
   960  	// subscriptions that match the request; this value should be passed in a new
   961  	// `ListTopicSubscriptionsRequest` to get more subscriptions.
   962  	NextPageToken string `json:"nextPageToken,omitempty"`
   963  	// Subscriptions: Optional. The names of subscriptions attached to the topic
   964  	// specified in the request.
   965  	Subscriptions []string `json:"subscriptions,omitempty"`
   966  
   967  	// ServerResponse contains the HTTP response code and headers from the server.
   968  	googleapi.ServerResponse `json:"-"`
   969  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   970  	// unconditionally include in API requests. By default, fields with empty or
   971  	// default values are omitted from API requests. See
   972  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   973  	// details.
   974  	ForceSendFields []string `json:"-"`
   975  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   976  	// requests with the JSON null value. By default, fields with empty values are
   977  	// omitted from API requests. See
   978  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   979  	NullFields []string `json:"-"`
   980  }
   981  
   982  func (s *ListTopicSubscriptionsResponse) MarshalJSON() ([]byte, error) {
   983  	type NoMethod ListTopicSubscriptionsResponse
   984  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   985  }
   986  
   987  // ListTopicsResponse: Response for the `ListTopics` method.
   988  type ListTopicsResponse struct {
   989  	// NextPageToken: Optional. If not empty, indicates that there may be more
   990  	// topics that match the request; this value should be passed in a new
   991  	// `ListTopicsRequest`.
   992  	NextPageToken string `json:"nextPageToken,omitempty"`
   993  	// Topics: Optional. The resulting topics.
   994  	Topics []*Topic `json:"topics,omitempty"`
   995  
   996  	// ServerResponse contains the HTTP response code and headers from the server.
   997  	googleapi.ServerResponse `json:"-"`
   998  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   999  	// unconditionally include in API requests. By default, fields with empty or
  1000  	// default values are omitted from API requests. See
  1001  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1002  	// details.
  1003  	ForceSendFields []string `json:"-"`
  1004  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1005  	// requests with the JSON null value. By default, fields with empty values are
  1006  	// omitted from API requests. See
  1007  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1008  	NullFields []string `json:"-"`
  1009  }
  1010  
  1011  func (s *ListTopicsResponse) MarshalJSON() ([]byte, error) {
  1012  	type NoMethod ListTopicsResponse
  1013  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1014  }
  1015  
  1016  // MessageStoragePolicy: A policy constraining the storage of messages
  1017  // published to the topic.
  1018  type MessageStoragePolicy struct {
  1019  	// AllowedPersistenceRegions: Optional. A list of IDs of Google Cloud regions
  1020  	// where messages that are published to the topic may be persisted in storage.
  1021  	// Messages published by publishers running in non-allowed Google Cloud regions
  1022  	// (or running outside of Google Cloud altogether) are routed for storage in
  1023  	// one of the allowed regions. An empty list means that no regions are allowed,
  1024  	// and is not a valid configuration.
  1025  	AllowedPersistenceRegions []string `json:"allowedPersistenceRegions,omitempty"`
  1026  	// EnforceInTransit: Optional. If true, `allowed_persistence_regions` is also
  1027  	// used to enforce in-transit guarantees for messages. That is, Pub/Sub will
  1028  	// fail Publish operations on this topic and subscribe operations on any
  1029  	// subscription attached to this topic in any region that is not in
  1030  	// `allowed_persistence_regions`.
  1031  	EnforceInTransit bool `json:"enforceInTransit,omitempty"`
  1032  	// ForceSendFields is a list of field names (e.g. "AllowedPersistenceRegions")
  1033  	// to unconditionally include in API requests. By default, fields with empty or
  1034  	// default values are omitted from API requests. See
  1035  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1036  	// details.
  1037  	ForceSendFields []string `json:"-"`
  1038  	// NullFields is a list of field names (e.g. "AllowedPersistenceRegions") to
  1039  	// include in API requests with the JSON null value. By default, fields with
  1040  	// empty values are omitted from API requests. See
  1041  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1042  	NullFields []string `json:"-"`
  1043  }
  1044  
  1045  func (s *MessageStoragePolicy) MarshalJSON() ([]byte, error) {
  1046  	type NoMethod MessageStoragePolicy
  1047  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1048  }
  1049  
  1050  // ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method.
  1051  type ModifyAckDeadlineRequest struct {
  1052  	// AckDeadlineSeconds: Required. The new ack deadline with respect to the time
  1053  	// this request was sent to the Pub/Sub system. For example, if the value is
  1054  	// 10, the new ack deadline will expire 10 seconds after the
  1055  	// `ModifyAckDeadline` call was made. Specifying zero might immediately make
  1056  	// the message available for delivery to another subscriber client. This
  1057  	// typically results in an increase in the rate of message redeliveries (that
  1058  	// is, duplicates). The minimum deadline you can specify is 0 seconds. The
  1059  	// maximum deadline you can specify in a single request is 600 seconds (10
  1060  	// minutes).
  1061  	AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"`
  1062  	// AckIds: Required. List of acknowledgment IDs.
  1063  	AckIds []string `json:"ackIds,omitempty"`
  1064  	// ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") to
  1065  	// unconditionally include in API requests. By default, fields with empty or
  1066  	// default values are omitted from API requests. See
  1067  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1068  	// details.
  1069  	ForceSendFields []string `json:"-"`
  1070  	// NullFields is a list of field names (e.g. "AckDeadlineSeconds") to include
  1071  	// in API requests with the JSON null value. By default, fields with empty
  1072  	// values are omitted from API requests. See
  1073  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1074  	NullFields []string `json:"-"`
  1075  }
  1076  
  1077  func (s *ModifyAckDeadlineRequest) MarshalJSON() ([]byte, error) {
  1078  	type NoMethod ModifyAckDeadlineRequest
  1079  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1080  }
  1081  
  1082  // ModifyPushConfigRequest: Request for the ModifyPushConfig method.
  1083  type ModifyPushConfigRequest struct {
  1084  	// PushConfig: Required. The push configuration for future deliveries. An empty
  1085  	// `pushConfig` indicates that the Pub/Sub system should stop pushing messages
  1086  	// from the given subscription and allow messages to be pulled and acknowledged
  1087  	// - effectively pausing the subscription if `Pull` or `StreamingPull` is not
  1088  	// called.
  1089  	PushConfig *PushConfig `json:"pushConfig,omitempty"`
  1090  	// ForceSendFields is a list of field names (e.g. "PushConfig") to
  1091  	// unconditionally include in API requests. By default, fields with empty or
  1092  	// default values are omitted from API requests. See
  1093  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1094  	// details.
  1095  	ForceSendFields []string `json:"-"`
  1096  	// NullFields is a list of field names (e.g. "PushConfig") to include in API
  1097  	// requests with the JSON null value. By default, fields with empty values are
  1098  	// omitted from API requests. See
  1099  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1100  	NullFields []string `json:"-"`
  1101  }
  1102  
  1103  func (s *ModifyPushConfigRequest) MarshalJSON() ([]byte, error) {
  1104  	type NoMethod ModifyPushConfigRequest
  1105  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1106  }
  1107  
  1108  // NoWrapper: Sets the `data` field as the HTTP body for delivery.
  1109  type NoWrapper struct {
  1110  	// WriteMetadata: Optional. When true, writes the Pub/Sub message metadata to
  1111  	// `x-goog-pubsub-:` headers of the HTTP request. Writes the Pub/Sub message
  1112  	// attributes to `:` headers of the HTTP request.
  1113  	WriteMetadata bool `json:"writeMetadata,omitempty"`
  1114  	// ForceSendFields is a list of field names (e.g. "WriteMetadata") to
  1115  	// unconditionally include in API requests. By default, fields with empty or
  1116  	// default values are omitted from API requests. See
  1117  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1118  	// details.
  1119  	ForceSendFields []string `json:"-"`
  1120  	// NullFields is a list of field names (e.g. "WriteMetadata") to include in API
  1121  	// requests with the JSON null value. By default, fields with empty values are
  1122  	// omitted from API requests. See
  1123  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1124  	NullFields []string `json:"-"`
  1125  }
  1126  
  1127  func (s *NoWrapper) MarshalJSON() ([]byte, error) {
  1128  	type NoMethod NoWrapper
  1129  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1130  }
  1131  
  1132  // OidcToken: Contains information needed for generating an OpenID Connect
  1133  // token (https://developers.google.com/identity/protocols/OpenIDConnect).
  1134  type OidcToken struct {
  1135  	// Audience: Optional. Audience to be used when generating OIDC token. The
  1136  	// audience claim identifies the recipients that the JWT is intended for. The
  1137  	// audience value is a single case-sensitive string. Having multiple values
  1138  	// (array) for the audience field is not supported. More info about the OIDC
  1139  	// JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
  1140  	// Note: if not specified, the Push endpoint URL will be used.
  1141  	Audience string `json:"audience,omitempty"`
  1142  	// ServiceAccountEmail: Optional. Service account email
  1143  	// (https://cloud.google.com/iam/docs/service-accounts) used for generating the
  1144  	// OIDC token. For more information on setting up authentication, see Push
  1145  	// subscriptions (https://cloud.google.com/pubsub/docs/push).
  1146  	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
  1147  	// ForceSendFields is a list of field names (e.g. "Audience") to
  1148  	// unconditionally include in API requests. By default, fields with empty or
  1149  	// default values are omitted from API requests. See
  1150  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1151  	// details.
  1152  	ForceSendFields []string `json:"-"`
  1153  	// NullFields is a list of field names (e.g. "Audience") to include in API
  1154  	// requests with the JSON null value. By default, fields with empty values are
  1155  	// omitted from API requests. See
  1156  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1157  	NullFields []string `json:"-"`
  1158  }
  1159  
  1160  func (s *OidcToken) MarshalJSON() ([]byte, error) {
  1161  	type NoMethod OidcToken
  1162  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1163  }
  1164  
  1165  // Policy: An Identity and Access Management (IAM) policy, which specifies
  1166  // access controls for Google Cloud resources. A `Policy` is a collection of
  1167  // `bindings`. A `binding` binds one or more `members`, or principals, to a
  1168  // single `role`. Principals can be user accounts, service accounts, Google
  1169  // groups, and domains (such as G Suite). A `role` is a named list of
  1170  // permissions; each `role` can be an IAM predefined role or a user-created
  1171  // custom role. For some types of Google Cloud resources, a `binding` can also
  1172  // specify a `condition`, which is a logical expression that allows access to a
  1173  // resource only if the expression evaluates to `true`. A condition can add
  1174  // constraints based on attributes of the request, the resource, or both. To
  1175  // learn which resources support conditions in their IAM policies, see the IAM
  1176  // documentation
  1177  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
  1178  // example:** ``` { "bindings": [ { "role":
  1179  // "roles/resourcemanager.organizationAdmin", "members": [
  1180  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
  1181  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
  1182  // "roles/resourcemanager.organizationViewer", "members": [
  1183  // "user:eve@example.com" ], "condition": { "title": "expirable access",
  1184  // "description": "Does not grant access after Sep 2020", "expression":
  1185  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
  1186  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
  1187  // members: - user:mike@example.com - group:admins@example.com -
  1188  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
  1189  // role: roles/resourcemanager.organizationAdmin - members: -
  1190  // user:eve@example.com role: roles/resourcemanager.organizationViewer
  1191  // condition: title: expirable access description: Does not grant access after
  1192  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
  1193  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
  1194  // see the IAM documentation (https://cloud.google.com/iam/docs/).
  1195  type Policy struct {
  1196  	// Bindings: Associates a list of `members`, or principals, with a `role`.
  1197  	// Optionally, may specify a `condition` that determines how and when the
  1198  	// `bindings` are applied. Each of the `bindings` must contain at least one
  1199  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
  1200  	// up to 250 of these principals can be Google groups. Each occurrence of a
  1201  	// principal counts towards these limits. For example, if the `bindings` grant
  1202  	// 50 different roles to `user:alice@example.com`, and not to any other
  1203  	// principal, then you can add another 1,450 principals to the `bindings` in
  1204  	// the `Policy`.
  1205  	Bindings []*Binding `json:"bindings,omitempty"`
  1206  	// Etag: `etag` is used for optimistic concurrency control as a way to help
  1207  	// prevent simultaneous updates of a policy from overwriting each other. It is
  1208  	// strongly suggested that systems make use of the `etag` in the
  1209  	// read-modify-write cycle to perform policy updates in order to avoid race
  1210  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
  1211  	// systems are expected to put that etag in the request to `setIamPolicy` to
  1212  	// ensure that their change will be applied to the same version of the policy.
  1213  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1214  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1215  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1216  	// the conditions in the version `3` policy are lost.
  1217  	Etag string `json:"etag,omitempty"`
  1218  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
  1219  	// `3`. Requests that specify an invalid value are rejected. Any operation that
  1220  	// affects conditional role bindings must specify version `3`. This requirement
  1221  	// applies to the following operations: * Getting a policy that includes a
  1222  	// conditional role binding * Adding a conditional role binding to a policy *
  1223  	// Changing a conditional role binding in a policy * Removing any role binding,
  1224  	// with or without a condition, from a policy that includes conditions
  1225  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1226  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1227  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1228  	// the conditions in the version `3` policy are lost. If a policy does not
  1229  	// include any conditions, operations on that policy may specify any valid
  1230  	// version or leave the field unset. To learn which resources support
  1231  	// conditions in their IAM policies, see the IAM documentation
  1232  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
  1233  	Version int64 `json:"version,omitempty"`
  1234  
  1235  	// ServerResponse contains the HTTP response code and headers from the server.
  1236  	googleapi.ServerResponse `json:"-"`
  1237  	// ForceSendFields is a list of field names (e.g. "Bindings") to
  1238  	// unconditionally include in API requests. By default, fields with empty or
  1239  	// default values are omitted from API requests. See
  1240  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1241  	// details.
  1242  	ForceSendFields []string `json:"-"`
  1243  	// NullFields is a list of field names (e.g. "Bindings") to include in API
  1244  	// requests with the JSON null value. By default, fields with empty values are
  1245  	// omitted from API requests. See
  1246  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1247  	NullFields []string `json:"-"`
  1248  }
  1249  
  1250  func (s *Policy) MarshalJSON() ([]byte, error) {
  1251  	type NoMethod Policy
  1252  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1253  }
  1254  
  1255  // PublishRequest: Request for the Publish method.
  1256  type PublishRequest struct {
  1257  	// Messages: Required. The messages to publish.
  1258  	Messages []*PubsubMessage `json:"messages,omitempty"`
  1259  	// ForceSendFields is a list of field names (e.g. "Messages") to
  1260  	// unconditionally include in API requests. By default, fields with empty or
  1261  	// default values are omitted from API requests. See
  1262  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1263  	// details.
  1264  	ForceSendFields []string `json:"-"`
  1265  	// NullFields is a list of field names (e.g. "Messages") to include in API
  1266  	// requests with the JSON null value. By default, fields with empty values are
  1267  	// omitted from API requests. See
  1268  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1269  	NullFields []string `json:"-"`
  1270  }
  1271  
  1272  func (s *PublishRequest) MarshalJSON() ([]byte, error) {
  1273  	type NoMethod PublishRequest
  1274  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1275  }
  1276  
  1277  // PublishResponse: Response for the `Publish` method.
  1278  type PublishResponse struct {
  1279  	// MessageIds: Optional. The server-assigned ID of each published message, in
  1280  	// the same order as the messages in the request. IDs are guaranteed to be
  1281  	// unique within the topic.
  1282  	MessageIds []string `json:"messageIds,omitempty"`
  1283  
  1284  	// ServerResponse contains the HTTP response code and headers from the server.
  1285  	googleapi.ServerResponse `json:"-"`
  1286  	// ForceSendFields is a list of field names (e.g. "MessageIds") to
  1287  	// unconditionally include in API requests. By default, fields with empty or
  1288  	// default values are omitted from API requests. See
  1289  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1290  	// details.
  1291  	ForceSendFields []string `json:"-"`
  1292  	// NullFields is a list of field names (e.g. "MessageIds") to include in API
  1293  	// requests with the JSON null value. By default, fields with empty values are
  1294  	// omitted from API requests. See
  1295  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1296  	NullFields []string `json:"-"`
  1297  }
  1298  
  1299  func (s *PublishResponse) MarshalJSON() ([]byte, error) {
  1300  	type NoMethod PublishResponse
  1301  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1302  }
  1303  
  1304  // PubsubMessage: A message that is published by publishers and consumed by
  1305  // subscribers. The message must contain either a non-empty data field or at
  1306  // least one attribute. Note that client libraries represent this object
  1307  // differently depending on the language. See the corresponding client library
  1308  // documentation (https://cloud.google.com/pubsub/docs/reference/libraries) for
  1309  // more information. See [quotas and limits]
  1310  // (https://cloud.google.com/pubsub/quotas) for more information about message
  1311  // limits.
  1312  type PubsubMessage struct {
  1313  	// Attributes: Optional. Attributes for this message. If this field is empty,
  1314  	// the message must contain non-empty data. This can be used to filter messages
  1315  	// on the subscription.
  1316  	Attributes map[string]string `json:"attributes,omitempty"`
  1317  	// Data: Optional. The message data field. If this field is empty, the message
  1318  	// must contain at least one attribute.
  1319  	Data string `json:"data,omitempty"`
  1320  	// MessageId: ID of this message, assigned by the server when the message is
  1321  	// published. Guaranteed to be unique within the topic. This value may be read
  1322  	// by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push
  1323  	// delivery. It must not be populated by the publisher in a `Publish` call.
  1324  	MessageId string `json:"messageId,omitempty"`
  1325  	// OrderingKey: Optional. If non-empty, identifies related messages for which
  1326  	// publish order should be respected. If a `Subscription` has
  1327  	// `enable_message_ordering` set to `true`, messages published with the same
  1328  	// non-empty `ordering_key` value will be delivered to subscribers in the order
  1329  	// in which they are received by the Pub/Sub system. All `PubsubMessage`s
  1330  	// published in a given `PublishRequest` must specify the same `ordering_key`
  1331  	// value. For more information, see ordering messages
  1332  	// (https://cloud.google.com/pubsub/docs/ordering).
  1333  	OrderingKey string `json:"orderingKey,omitempty"`
  1334  	// PublishTime: The time at which the message was published, populated by the
  1335  	// server when it receives the `Publish` call. It must not be populated by the
  1336  	// publisher in a `Publish` call.
  1337  	PublishTime string `json:"publishTime,omitempty"`
  1338  	// ForceSendFields is a list of field names (e.g. "Attributes") 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. "Attributes") to include in API
  1345  	// requests with the JSON null value. By default, fields with empty values are
  1346  	// 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 *PubsubMessage) MarshalJSON() ([]byte, error) {
  1352  	type NoMethod PubsubMessage
  1353  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1354  }
  1355  
  1356  // PubsubWrapper: The payload to the push endpoint is in the form of the JSON
  1357  // representation of a PubsubMessage
  1358  // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
  1359  type PubsubWrapper struct {
  1360  }
  1361  
  1362  // PullRequest: Request for the `Pull` method.
  1363  type PullRequest struct {
  1364  	// MaxMessages: Required. The maximum number of messages to return for this
  1365  	// request. Must be a positive integer. The Pub/Sub system may return fewer
  1366  	// than the number specified.
  1367  	MaxMessages int64 `json:"maxMessages,omitempty"`
  1368  	// ReturnImmediately: Optional. If this field set to true, the system will
  1369  	// respond immediately even if it there are no messages available to return in
  1370  	// the `Pull` response. Otherwise, the system may wait (for a bounded amount of
  1371  	// time) until at least one message is available, rather than returning no
  1372  	// messages. Warning: setting this field to `true` is discouraged because it
  1373  	// adversely impacts the performance of `Pull` operations. We recommend that
  1374  	// users do not set this field.
  1375  	ReturnImmediately bool `json:"returnImmediately,omitempty"`
  1376  	// ForceSendFields is a list of field names (e.g. "MaxMessages") to
  1377  	// unconditionally include in API requests. By default, fields with empty or
  1378  	// default values are omitted from API requests. See
  1379  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1380  	// details.
  1381  	ForceSendFields []string `json:"-"`
  1382  	// NullFields is a list of field names (e.g. "MaxMessages") to include in API
  1383  	// requests with the JSON null value. By default, fields with empty values are
  1384  	// omitted from API requests. See
  1385  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1386  	NullFields []string `json:"-"`
  1387  }
  1388  
  1389  func (s *PullRequest) MarshalJSON() ([]byte, error) {
  1390  	type NoMethod PullRequest
  1391  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1392  }
  1393  
  1394  // PullResponse: Response for the `Pull` method.
  1395  type PullResponse struct {
  1396  	// ReceivedMessages: Optional. Received Pub/Sub messages. The list will be
  1397  	// empty if there are no more messages available in the backlog, or if no
  1398  	// messages could be returned before the request timeout. For JSON, the
  1399  	// response can be entirely empty. The Pub/Sub system may return fewer than the
  1400  	// `maxMessages` requested even if there are more messages available in the
  1401  	// backlog.
  1402  	ReceivedMessages []*ReceivedMessage `json:"receivedMessages,omitempty"`
  1403  
  1404  	// ServerResponse contains the HTTP response code and headers from the server.
  1405  	googleapi.ServerResponse `json:"-"`
  1406  	// ForceSendFields is a list of field names (e.g. "ReceivedMessages") to
  1407  	// unconditionally include in API requests. By default, fields with empty or
  1408  	// default values are omitted from API requests. See
  1409  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1410  	// details.
  1411  	ForceSendFields []string `json:"-"`
  1412  	// NullFields is a list of field names (e.g. "ReceivedMessages") to include in
  1413  	// API requests with the JSON null value. By default, fields with empty values
  1414  	// are omitted from API requests. See
  1415  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1416  	NullFields []string `json:"-"`
  1417  }
  1418  
  1419  func (s *PullResponse) MarshalJSON() ([]byte, error) {
  1420  	type NoMethod PullResponse
  1421  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1422  }
  1423  
  1424  // PushConfig: Configuration for a push delivery endpoint.
  1425  type PushConfig struct {
  1426  	// Attributes: Optional. Endpoint configuration attributes that can be used to
  1427  	// control different aspects of the message delivery. The only currently
  1428  	// supported attribute is `x-goog-version`, which you can use to change the
  1429  	// format of the pushed message. This attribute indicates the version of the
  1430  	// data expected by the endpoint. This controls the shape of the pushed message
  1431  	// (i.e., its fields and metadata). If not present during the
  1432  	// `CreateSubscription` call, it will default to the version of the Pub/Sub API
  1433  	// used to make such call. If not present in a `ModifyPushConfig` call, its
  1434  	// value will not be changed. `GetSubscription` calls will always return a
  1435  	// valid version, even if the subscription was created without this attribute.
  1436  	// The only supported values for the `x-goog-version` attribute are: *
  1437  	// `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. * `v1`
  1438  	// or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. For
  1439  	// example: `attributes { "x-goog-version": "v1" }`
  1440  	Attributes map[string]string `json:"attributes,omitempty"`
  1441  	// NoWrapper: Optional. When set, the payload to the push endpoint is not
  1442  	// wrapped.
  1443  	NoWrapper *NoWrapper `json:"noWrapper,omitempty"`
  1444  	// OidcToken: Optional. If specified, Pub/Sub will generate and attach an OIDC
  1445  	// JWT token as an `Authorization` header in the HTTP request for every pushed
  1446  	// message.
  1447  	OidcToken *OidcToken `json:"oidcToken,omitempty"`
  1448  	// PubsubWrapper: Optional. When set, the payload to the push endpoint is in
  1449  	// the form of the JSON representation of a PubsubMessage
  1450  	// (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
  1451  	PubsubWrapper *PubsubWrapper `json:"pubsubWrapper,omitempty"`
  1452  	// PushEndpoint: Optional. A URL locating the endpoint to which messages should
  1453  	// be pushed. For example, a Webhook endpoint might use
  1454  	// `https://example.com/push`.
  1455  	PushEndpoint string `json:"pushEndpoint,omitempty"`
  1456  	// ForceSendFields is a list of field names (e.g. "Attributes") to
  1457  	// unconditionally include in API requests. By default, fields with empty or
  1458  	// default values are omitted from API requests. See
  1459  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1460  	// details.
  1461  	ForceSendFields []string `json:"-"`
  1462  	// NullFields is a list of field names (e.g. "Attributes") to include in API
  1463  	// requests with the JSON null value. By default, fields with empty values are
  1464  	// omitted from API requests. See
  1465  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1466  	NullFields []string `json:"-"`
  1467  }
  1468  
  1469  func (s *PushConfig) MarshalJSON() ([]byte, error) {
  1470  	type NoMethod PushConfig
  1471  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1472  }
  1473  
  1474  // ReceivedMessage: A message and its corresponding acknowledgment ID.
  1475  type ReceivedMessage struct {
  1476  	// AckId: Optional. This ID can be used to acknowledge the received message.
  1477  	AckId string `json:"ackId,omitempty"`
  1478  	// DeliveryAttempt: Optional. The approximate number of times that Pub/Sub has
  1479  	// attempted to deliver the associated message to a subscriber. More precisely,
  1480  	// this is 1 + (number of NACKs) + (number of ack_deadline exceeds) for this
  1481  	// message. A NACK is any call to ModifyAckDeadline with a 0 deadline. An
  1482  	// ack_deadline exceeds event is whenever a message is not acknowledged within
  1483  	// ack_deadline. Note that ack_deadline is initially
  1484  	// Subscription.ackDeadlineSeconds, but may get extended automatically by the
  1485  	// client library. Upon the first delivery of a given message,
  1486  	// `delivery_attempt` will have a value of 1. The value is calculated at best
  1487  	// effort and is approximate. If a DeadLetterPolicy is not set on the
  1488  	// subscription, this will be 0.
  1489  	DeliveryAttempt int64 `json:"deliveryAttempt,omitempty"`
  1490  	// Message: Optional. The message.
  1491  	Message *PubsubMessage `json:"message,omitempty"`
  1492  	// ForceSendFields is a list of field names (e.g. "AckId") to unconditionally
  1493  	// include in API requests. By default, fields with empty or default values are
  1494  	// omitted from API requests. See
  1495  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1496  	// details.
  1497  	ForceSendFields []string `json:"-"`
  1498  	// NullFields is a list of field names (e.g. "AckId") to include in API
  1499  	// requests with the JSON null value. By default, fields with empty values are
  1500  	// omitted from API requests. See
  1501  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1502  	NullFields []string `json:"-"`
  1503  }
  1504  
  1505  func (s *ReceivedMessage) MarshalJSON() ([]byte, error) {
  1506  	type NoMethod ReceivedMessage
  1507  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1508  }
  1509  
  1510  // RetryPolicy: A policy that specifies how Pub/Sub retries message delivery.
  1511  // Retry delay will be exponential based on provided minimum and maximum
  1512  // backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. RetryPolicy
  1513  // will be triggered on NACKs or acknowledgement deadline exceeded events for a
  1514  // given message. Retry Policy is implemented on a best effort basis. At times,
  1515  // the delay between consecutive deliveries may not match the configuration.
  1516  // That is, delay can be more or less than configured backoff.
  1517  type RetryPolicy struct {
  1518  	// MaximumBackoff: Optional. The maximum delay between consecutive deliveries
  1519  	// of a given message. Value should be between 0 and 600 seconds. Defaults to
  1520  	// 600 seconds.
  1521  	MaximumBackoff string `json:"maximumBackoff,omitempty"`
  1522  	// MinimumBackoff: Optional. The minimum delay between consecutive deliveries
  1523  	// of a given message. Value should be between 0 and 600 seconds. Defaults to
  1524  	// 10 seconds.
  1525  	MinimumBackoff string `json:"minimumBackoff,omitempty"`
  1526  	// ForceSendFields is a list of field names (e.g. "MaximumBackoff") to
  1527  	// unconditionally include in API requests. By default, fields with empty or
  1528  	// default values are omitted from API requests. See
  1529  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1530  	// details.
  1531  	ForceSendFields []string `json:"-"`
  1532  	// NullFields is a list of field names (e.g. "MaximumBackoff") to include in
  1533  	// API requests with the JSON null value. By default, fields with empty values
  1534  	// are omitted from API requests. See
  1535  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1536  	NullFields []string `json:"-"`
  1537  }
  1538  
  1539  func (s *RetryPolicy) MarshalJSON() ([]byte, error) {
  1540  	type NoMethod RetryPolicy
  1541  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1542  }
  1543  
  1544  // RollbackSchemaRequest: Request for the `RollbackSchema` method.
  1545  type RollbackSchemaRequest struct {
  1546  	// RevisionId: Required. The revision ID to roll back to. It must be a revision
  1547  	// of the same schema. Example: c7cfa2a8
  1548  	RevisionId string `json:"revisionId,omitempty"`
  1549  	// ForceSendFields is a list of field names (e.g. "RevisionId") to
  1550  	// unconditionally include in API requests. By default, fields with empty or
  1551  	// default values are omitted from API requests. See
  1552  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1553  	// details.
  1554  	ForceSendFields []string `json:"-"`
  1555  	// NullFields is a list of field names (e.g. "RevisionId") to include in API
  1556  	// requests with the JSON null value. By default, fields with empty values are
  1557  	// omitted from API requests. See
  1558  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1559  	NullFields []string `json:"-"`
  1560  }
  1561  
  1562  func (s *RollbackSchemaRequest) MarshalJSON() ([]byte, error) {
  1563  	type NoMethod RollbackSchemaRequest
  1564  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1565  }
  1566  
  1567  // Schema: A schema resource.
  1568  type Schema struct {
  1569  	// Definition: The definition of the schema. This should contain a string
  1570  	// representing the full definition of the schema that is a valid schema
  1571  	// definition of the type specified in `type`.
  1572  	Definition string `json:"definition,omitempty"`
  1573  	// Name: Required. Name of the schema. Format is
  1574  	// `projects/{project}/schemas/{schema}`.
  1575  	Name string `json:"name,omitempty"`
  1576  	// RevisionCreateTime: Output only. The timestamp that the revision was
  1577  	// created.
  1578  	RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
  1579  	// RevisionId: Output only. Immutable. The revision ID of the schema.
  1580  	RevisionId string `json:"revisionId,omitempty"`
  1581  	// Type: The type of the schema definition.
  1582  	//
  1583  	// Possible values:
  1584  	//   "TYPE_UNSPECIFIED" - Default value. This value is unused.
  1585  	//   "PROTOCOL_BUFFER" - A Protocol Buffer schema definition.
  1586  	//   "AVRO" - An Avro schema definition.
  1587  	Type string `json:"type,omitempty"`
  1588  
  1589  	// ServerResponse contains the HTTP response code and headers from the server.
  1590  	googleapi.ServerResponse `json:"-"`
  1591  	// ForceSendFields is a list of field names (e.g. "Definition") to
  1592  	// unconditionally include in API requests. By default, fields with empty or
  1593  	// default values are omitted from API requests. See
  1594  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1595  	// details.
  1596  	ForceSendFields []string `json:"-"`
  1597  	// NullFields is a list of field names (e.g. "Definition") to include in API
  1598  	// requests with the JSON null value. By default, fields with empty values are
  1599  	// omitted from API requests. See
  1600  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1601  	NullFields []string `json:"-"`
  1602  }
  1603  
  1604  func (s *Schema) MarshalJSON() ([]byte, error) {
  1605  	type NoMethod Schema
  1606  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1607  }
  1608  
  1609  // SchemaSettings: Settings for validating messages published against a schema.
  1610  type SchemaSettings struct {
  1611  	// Encoding: Optional. The encoding of messages validated against `schema`.
  1612  	//
  1613  	// Possible values:
  1614  	//   "ENCODING_UNSPECIFIED" - Unspecified
  1615  	//   "JSON" - JSON encoding
  1616  	//   "BINARY" - Binary encoding, as defined by the schema type. For some schema
  1617  	// types, binary encoding may not be available.
  1618  	Encoding string `json:"encoding,omitempty"`
  1619  	// FirstRevisionId: Optional. The minimum (inclusive) revision allowed for
  1620  	// validating messages. If empty or not present, allow any revision to be
  1621  	// validated against last_revision or any revision created before.
  1622  	FirstRevisionId string `json:"firstRevisionId,omitempty"`
  1623  	// LastRevisionId: Optional. The maximum (inclusive) revision allowed for
  1624  	// validating messages. If empty or not present, allow any revision to be
  1625  	// validated against first_revision or any revision created after.
  1626  	LastRevisionId string `json:"lastRevisionId,omitempty"`
  1627  	// Schema: Required. The name of the schema that messages published should be
  1628  	// validated against. Format is `projects/{project}/schemas/{schema}`. The
  1629  	// value of this field will be `_deleted-schema_` if the schema has been
  1630  	// deleted.
  1631  	Schema string `json:"schema,omitempty"`
  1632  	// ForceSendFields is a list of field names (e.g. "Encoding") to
  1633  	// unconditionally include in API requests. By default, fields with empty or
  1634  	// default values are omitted from API requests. See
  1635  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1636  	// details.
  1637  	ForceSendFields []string `json:"-"`
  1638  	// NullFields is a list of field names (e.g. "Encoding") to include in API
  1639  	// requests with the JSON null value. By default, fields with empty values are
  1640  	// omitted from API requests. See
  1641  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1642  	NullFields []string `json:"-"`
  1643  }
  1644  
  1645  func (s *SchemaSettings) MarshalJSON() ([]byte, error) {
  1646  	type NoMethod SchemaSettings
  1647  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1648  }
  1649  
  1650  // SeekRequest: Request for the `Seek` method.
  1651  type SeekRequest struct {
  1652  	// Snapshot: Optional. The snapshot to seek to. The snapshot's topic must be
  1653  	// the same as that of the provided subscription. Format is
  1654  	// `projects/{project}/snapshots/{snap}`.
  1655  	Snapshot string `json:"snapshot,omitempty"`
  1656  	// Time: Optional. The time to seek to. Messages retained in the subscription
  1657  	// that were published before this time are marked as acknowledged, and
  1658  	// messages retained in the subscription that were published after this time
  1659  	// are marked as unacknowledged. Note that this operation affects only those
  1660  	// messages retained in the subscription (configured by the combination of
  1661  	// `message_retention_duration` and `retain_acked_messages`). For example, if
  1662  	// `time` corresponds to a point before the message retention window (or to a
  1663  	// point before the system's notion of the subscription creation time), only
  1664  	// retained messages will be marked as unacknowledged, and already-expunged
  1665  	// messages will not be restored.
  1666  	Time string `json:"time,omitempty"`
  1667  	// ForceSendFields is a list of field names (e.g. "Snapshot") to
  1668  	// unconditionally include in API requests. By default, fields with empty or
  1669  	// default values are omitted from API requests. See
  1670  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1671  	// details.
  1672  	ForceSendFields []string `json:"-"`
  1673  	// NullFields is a list of field names (e.g. "Snapshot") to include in API
  1674  	// requests with the JSON null value. By default, fields with empty values are
  1675  	// omitted from API requests. See
  1676  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1677  	NullFields []string `json:"-"`
  1678  }
  1679  
  1680  func (s *SeekRequest) MarshalJSON() ([]byte, error) {
  1681  	type NoMethod SeekRequest
  1682  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1683  }
  1684  
  1685  // SeekResponse: Response for the `Seek` method (this response is empty).
  1686  type SeekResponse struct {
  1687  	// ServerResponse contains the HTTP response code and headers from the server.
  1688  	googleapi.ServerResponse `json:"-"`
  1689  }
  1690  
  1691  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  1692  type SetIamPolicyRequest struct {
  1693  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
  1694  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
  1695  	// policy but certain Google Cloud services (such as Projects) might reject
  1696  	// them.
  1697  	Policy *Policy `json:"policy,omitempty"`
  1698  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
  1699  	// include in API requests. By default, fields with empty or default values are
  1700  	// omitted from API requests. See
  1701  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1702  	// details.
  1703  	ForceSendFields []string `json:"-"`
  1704  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1705  	// requests with the JSON null value. By default, fields with empty values are
  1706  	// omitted from API requests. See
  1707  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1708  	NullFields []string `json:"-"`
  1709  }
  1710  
  1711  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1712  	type NoMethod SetIamPolicyRequest
  1713  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1714  }
  1715  
  1716  // Snapshot: A snapshot resource. Snapshots are used in Seek
  1717  // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
  1718  // allow you to manage message acknowledgments in bulk. That is, you can set
  1719  // the acknowledgment state of messages in an existing subscription to the
  1720  // state captured by a snapshot.
  1721  type Snapshot struct {
  1722  	// ExpireTime: Optional. The snapshot is guaranteed to exist up until this
  1723  	// time. A newly-created snapshot expires no later than 7 days from the time of
  1724  	// its creation. Its exact lifetime is determined at creation by the existing
  1725  	// backlog in the source subscription. Specifically, the lifetime of the
  1726  	// snapshot is `7 days - (age of oldest unacked message in the subscription)`.
  1727  	// For example, consider a subscription whose oldest unacked message is 3 days
  1728  	// old. If a snapshot is created from this subscription, the snapshot -- which
  1729  	// will always capture this 3-day-old backlog as long as the snapshot exists --
  1730  	// will expire in 4 days. The service will refuse to create a snapshot that
  1731  	// would expire in less than 1 hour after creation.
  1732  	ExpireTime string `json:"expireTime,omitempty"`
  1733  	// Labels: Optional. See [Creating and managing labels]
  1734  	// (https://cloud.google.com/pubsub/docs/labels).
  1735  	Labels map[string]string `json:"labels,omitempty"`
  1736  	// Name: Optional. The name of the snapshot.
  1737  	Name string `json:"name,omitempty"`
  1738  	// Topic: Optional. The name of the topic from which this snapshot is retaining
  1739  	// messages.
  1740  	Topic string `json:"topic,omitempty"`
  1741  
  1742  	// ServerResponse contains the HTTP response code and headers from the server.
  1743  	googleapi.ServerResponse `json:"-"`
  1744  	// ForceSendFields is a list of field names (e.g. "ExpireTime") to
  1745  	// unconditionally include in API requests. By default, fields with empty or
  1746  	// default values are omitted from API requests. See
  1747  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1748  	// details.
  1749  	ForceSendFields []string `json:"-"`
  1750  	// NullFields is a list of field names (e.g. "ExpireTime") to include in API
  1751  	// requests with the JSON null value. By default, fields with empty values are
  1752  	// omitted from API requests. See
  1753  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1754  	NullFields []string `json:"-"`
  1755  }
  1756  
  1757  func (s *Snapshot) MarshalJSON() ([]byte, error) {
  1758  	type NoMethod Snapshot
  1759  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1760  }
  1761  
  1762  // Subscription: A subscription resource. If none of `push_config`,
  1763  // `bigquery_config`, or `cloud_storage_config` is set, then the subscriber
  1764  // will pull and ack messages using API methods. At most one of these fields
  1765  // may be set.
  1766  type Subscription struct {
  1767  	// AckDeadlineSeconds: Optional. The approximate amount of time (on a
  1768  	// best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt
  1769  	// before resending the message. In the interval after the message is delivered
  1770  	// and before it is acknowledged, it is considered to be _outstanding_. During
  1771  	// that time period, the message will not be redelivered (on a best-effort
  1772  	// basis). For pull subscriptions, this value is used as the initial value for
  1773  	// the ack deadline. To override this value for a given message, call
  1774  	// `ModifyAckDeadline` with the corresponding `ack_id` if using non-streaming
  1775  	// pull or send the `ack_id` in a `StreamingModifyAckDeadlineRequest` if using
  1776  	// streaming pull. The minimum custom deadline you can specify is 10 seconds.
  1777  	// The maximum custom deadline you can specify is 600 seconds (10 minutes). If
  1778  	// this parameter is 0, a default value of 10 seconds is used. For push
  1779  	// delivery, this value is also used to set the request timeout for the call to
  1780  	// the push endpoint. If the subscriber never acknowledges the message, the
  1781  	// Pub/Sub system will eventually redeliver the message.
  1782  	AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"`
  1783  	// BigqueryConfig: Optional. If delivery to BigQuery is used with this
  1784  	// subscription, this field is used to configure it.
  1785  	BigqueryConfig *BigQueryConfig `json:"bigqueryConfig,omitempty"`
  1786  	// CloudStorageConfig: Optional. If delivery to Google Cloud Storage is used
  1787  	// with this subscription, this field is used to configure it.
  1788  	CloudStorageConfig *CloudStorageConfig `json:"cloudStorageConfig,omitempty"`
  1789  	// DeadLetterPolicy: Optional. A policy that specifies the conditions for dead
  1790  	// lettering messages in this subscription. If dead_letter_policy is not set,
  1791  	// dead lettering is disabled. The Pub/Sub service account associated with this
  1792  	// subscriptions's parent project (i.e.,
  1793  	// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
  1794  	// permission to Acknowledge() messages on this subscription.
  1795  	DeadLetterPolicy *DeadLetterPolicy `json:"deadLetterPolicy,omitempty"`
  1796  	// Detached: Optional. Indicates whether the subscription is detached from its
  1797  	// topic. Detached subscriptions don't receive messages from their topic and
  1798  	// don't retain any backlog. `Pull` and `StreamingPull` requests will return
  1799  	// FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
  1800  	// the endpoint will not be made.
  1801  	Detached bool `json:"detached,omitempty"`
  1802  	// EnableExactlyOnceDelivery: Optional. If true, Pub/Sub provides the following
  1803  	// guarantees for the delivery of a message with a given value of `message_id`
  1804  	// on this subscription: * The message sent to a subscriber is guaranteed not
  1805  	// to be resent before the message's acknowledgement deadline expires. * An
  1806  	// acknowledged message will not be resent to a subscriber. Note that
  1807  	// subscribers may still receive multiple copies of a message when
  1808  	// `enable_exactly_once_delivery` is true if the message was published multiple
  1809  	// times by a publisher client. These copies are considered distinct by Pub/Sub
  1810  	// and have distinct `message_id` values.
  1811  	EnableExactlyOnceDelivery bool `json:"enableExactlyOnceDelivery,omitempty"`
  1812  	// EnableMessageOrdering: Optional. If true, messages published with the same
  1813  	// `ordering_key` in `PubsubMessage` will be delivered to the subscribers in
  1814  	// the order in which they are received by the Pub/Sub system. Otherwise, they
  1815  	// may be delivered in any order.
  1816  	EnableMessageOrdering bool `json:"enableMessageOrdering,omitempty"`
  1817  	// ExpirationPolicy: Optional. A policy that specifies the conditions for this
  1818  	// subscription's expiration. A subscription is considered active as long as
  1819  	// any connected subscriber is successfully consuming messages from the
  1820  	// subscription or is issuing operations on the subscription. If
  1821  	// `expiration_policy` is not set, a *default policy* with `ttl` of 31 days
  1822  	// will be used. The minimum allowed value for `expiration_policy.ttl` is 1
  1823  	// day. If `expiration_policy` is set, but `expiration_policy.ttl` is not set,
  1824  	// the subscription never expires.
  1825  	ExpirationPolicy *ExpirationPolicy `json:"expirationPolicy,omitempty"`
  1826  	// Filter: Optional. An expression written in the Pub/Sub filter language
  1827  	// (https://cloud.google.com/pubsub/docs/filtering). If non-empty, then only
  1828  	// `PubsubMessage`s whose `attributes` field matches the filter are delivered
  1829  	// on this subscription. If empty, then no messages are filtered out.
  1830  	Filter string `json:"filter,omitempty"`
  1831  	// Labels: Optional. See Creating and managing labels
  1832  	// (https://cloud.google.com/pubsub/docs/labels).
  1833  	Labels map[string]string `json:"labels,omitempty"`
  1834  	// MessageRetentionDuration: Optional. How long to retain unacknowledged
  1835  	// messages in the subscription's backlog, from the moment a message is
  1836  	// published. If `retain_acked_messages` is true, then this also configures the
  1837  	// retention of acknowledged messages, and thus configures how far back in time
  1838  	// a `Seek` can be done. Defaults to 7 days. Cannot be more than 7 days or less
  1839  	// than 10 minutes.
  1840  	MessageRetentionDuration string `json:"messageRetentionDuration,omitempty"`
  1841  	// Name: Required. The name of the subscription. It must have the format
  1842  	// "projects/{project}/subscriptions/{subscription}". `{subscription}` must
  1843  	// start with a letter, and contain only letters (`[A-Za-z]`), numbers
  1844  	// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
  1845  	// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
  1846  	// in length, and it must not start with "goog".
  1847  	Name string `json:"name,omitempty"`
  1848  	// PushConfig: Optional. If push delivery is used with this subscription, this
  1849  	// field is used to configure it.
  1850  	PushConfig *PushConfig `json:"pushConfig,omitempty"`
  1851  	// RetainAckedMessages: Optional. Indicates whether to retain acknowledged
  1852  	// messages. If true, then messages are not expunged from the subscription's
  1853  	// backlog, even if they are acknowledged, until they fall out of the
  1854  	// `message_retention_duration` window. This must be true if you would like to
  1855  	// [`Seek` to a timestamp]
  1856  	// (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in the
  1857  	// past to replay previously-acknowledged messages.
  1858  	RetainAckedMessages bool `json:"retainAckedMessages,omitempty"`
  1859  	// RetryPolicy: Optional. A policy that specifies how Pub/Sub retries message
  1860  	// delivery for this subscription. If not set, the default retry policy is
  1861  	// applied. This generally implies that messages will be retried as soon as
  1862  	// possible for healthy subscribers. RetryPolicy will be triggered on NACKs or
  1863  	// acknowledgement deadline exceeded events for a given message.
  1864  	RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
  1865  	// State: Output only. An output-only field indicating whether or not the
  1866  	// subscription can receive messages.
  1867  	//
  1868  	// Possible values:
  1869  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
  1870  	//   "ACTIVE" - The subscription can actively receive messages
  1871  	//   "RESOURCE_ERROR" - The subscription cannot receive messages because of an
  1872  	// error with the resource to which it pushes messages. See the more detailed
  1873  	// error state in the corresponding configuration.
  1874  	State string `json:"state,omitempty"`
  1875  	// Topic: Required. The name of the topic from which this subscription is
  1876  	// receiving messages. Format is `projects/{project}/topics/{topic}`. The value
  1877  	// of this field will be `_deleted-topic_` if the topic has been deleted.
  1878  	Topic string `json:"topic,omitempty"`
  1879  	// TopicMessageRetentionDuration: Output only. Indicates the minimum duration
  1880  	// for which a message is retained after it is published to the subscription's
  1881  	// topic. If this field is set, messages published to the subscription's topic
  1882  	// in the last `topic_message_retention_duration` are always available to
  1883  	// subscribers. See the `message_retention_duration` field in `Topic`. This
  1884  	// field is set only in responses from the server; it is ignored if it is set
  1885  	// in any requests.
  1886  	TopicMessageRetentionDuration string `json:"topicMessageRetentionDuration,omitempty"`
  1887  
  1888  	// ServerResponse contains the HTTP response code and headers from the server.
  1889  	googleapi.ServerResponse `json:"-"`
  1890  	// ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") to
  1891  	// unconditionally include in API requests. By default, fields with empty or
  1892  	// default values are omitted from API requests. See
  1893  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1894  	// details.
  1895  	ForceSendFields []string `json:"-"`
  1896  	// NullFields is a list of field names (e.g. "AckDeadlineSeconds") to include
  1897  	// in API requests with the JSON null value. By default, fields with empty
  1898  	// values are omitted from API requests. See
  1899  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1900  	NullFields []string `json:"-"`
  1901  }
  1902  
  1903  func (s *Subscription) MarshalJSON() ([]byte, error) {
  1904  	type NoMethod Subscription
  1905  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1906  }
  1907  
  1908  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
  1909  type TestIamPermissionsRequest struct {
  1910  	// Permissions: The set of permissions to check for the `resource`. Permissions
  1911  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
  1912  	// information see IAM Overview
  1913  	// (https://cloud.google.com/iam/docs/overview#permissions).
  1914  	Permissions []string `json:"permissions,omitempty"`
  1915  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1916  	// unconditionally include in API requests. By default, fields with empty or
  1917  	// default values are omitted from API requests. See
  1918  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1919  	// details.
  1920  	ForceSendFields []string `json:"-"`
  1921  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1922  	// requests with the JSON null value. By default, fields with empty values are
  1923  	// omitted from API requests. See
  1924  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1925  	NullFields []string `json:"-"`
  1926  }
  1927  
  1928  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1929  	type NoMethod TestIamPermissionsRequest
  1930  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1931  }
  1932  
  1933  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  1934  // method.
  1935  type TestIamPermissionsResponse struct {
  1936  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
  1937  	// caller is allowed.
  1938  	Permissions []string `json:"permissions,omitempty"`
  1939  
  1940  	// ServerResponse contains the HTTP response code and headers from the server.
  1941  	googleapi.ServerResponse `json:"-"`
  1942  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1943  	// unconditionally include in API requests. By default, fields with empty or
  1944  	// default values are omitted from API requests. See
  1945  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1946  	// details.
  1947  	ForceSendFields []string `json:"-"`
  1948  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1949  	// requests with the JSON null value. By default, fields with empty values are
  1950  	// omitted from API requests. See
  1951  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1952  	NullFields []string `json:"-"`
  1953  }
  1954  
  1955  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1956  	type NoMethod TestIamPermissionsResponse
  1957  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1958  }
  1959  
  1960  // TextConfig: Configuration for writing message data in text format. Message
  1961  // payloads will be written to files as raw text, separated by a newline.
  1962  type TextConfig struct {
  1963  }
  1964  
  1965  // Topic: A topic resource.
  1966  type Topic struct {
  1967  	// IngestionDataSourceSettings: Optional. Settings for ingestion from a data
  1968  	// source into this topic.
  1969  	IngestionDataSourceSettings *IngestionDataSourceSettings `json:"ingestionDataSourceSettings,omitempty"`
  1970  	// KmsKeyName: Optional. The resource name of the Cloud KMS CryptoKey to be
  1971  	// used to protect access to messages published on this topic. The expected
  1972  	// format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
  1973  	KmsKeyName string `json:"kmsKeyName,omitempty"`
  1974  	// Labels: Optional. See [Creating and managing labels]
  1975  	// (https://cloud.google.com/pubsub/docs/labels).
  1976  	Labels map[string]string `json:"labels,omitempty"`
  1977  	// MessageRetentionDuration: Optional. Indicates the minimum duration to retain
  1978  	// a message after it is published to the topic. If this field is set, messages
  1979  	// published to the topic in the last `message_retention_duration` are always
  1980  	// available to subscribers. For instance, it allows any attached subscription
  1981  	// to seek to a timestamp
  1982  	// (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) that
  1983  	// is up to `message_retention_duration` in the past. If this field is not set,
  1984  	// message retention is controlled by settings on individual subscriptions.
  1985  	// Cannot be more than 31 days or less than 10 minutes.
  1986  	MessageRetentionDuration string `json:"messageRetentionDuration,omitempty"`
  1987  	// MessageStoragePolicy: Optional. Policy constraining the set of Google Cloud
  1988  	// Platform regions where messages published to the topic may be stored. If not
  1989  	// present, then no constraints are in effect.
  1990  	MessageStoragePolicy *MessageStoragePolicy `json:"messageStoragePolicy,omitempty"`
  1991  	// Name: Required. The name of the topic. It must have the format
  1992  	// "projects/{project}/topics/{topic}". `{topic}` must start with a letter,
  1993  	// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
  1994  	// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs
  1995  	// (`%`). It must be between 3 and 255 characters in length, and it must not
  1996  	// start with "goog".
  1997  	Name string `json:"name,omitempty"`
  1998  	// SatisfiesPzs: Optional. Reserved for future use. This field is set only in
  1999  	// responses from the server; it is ignored if it is set in any requests.
  2000  	SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
  2001  	// SchemaSettings: Optional. Settings for validating messages published against
  2002  	// a schema.
  2003  	SchemaSettings *SchemaSettings `json:"schemaSettings,omitempty"`
  2004  	// State: Output only. An output-only field indicating the state of the topic.
  2005  	//
  2006  	// Possible values:
  2007  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
  2008  	//   "ACTIVE" - The topic does not have any persistent errors.
  2009  	//   "INGESTION_RESOURCE_ERROR" - Ingestion from the data source has
  2010  	// encountered a permanent error. See the more detailed error state in the
  2011  	// corresponding ingestion source configuration.
  2012  	State string `json:"state,omitempty"`
  2013  
  2014  	// ServerResponse contains the HTTP response code and headers from the server.
  2015  	googleapi.ServerResponse `json:"-"`
  2016  	// ForceSendFields is a list of field names (e.g.
  2017  	// "IngestionDataSourceSettings") to unconditionally include in API requests.
  2018  	// By default, fields with empty or default values are omitted from API
  2019  	// requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
  2020  	// for more details.
  2021  	ForceSendFields []string `json:"-"`
  2022  	// NullFields is a list of field names (e.g. "IngestionDataSourceSettings") to
  2023  	// include in API requests with the JSON null value. By default, fields with
  2024  	// empty values are omitted from API requests. See
  2025  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2026  	NullFields []string `json:"-"`
  2027  }
  2028  
  2029  func (s *Topic) MarshalJSON() ([]byte, error) {
  2030  	type NoMethod Topic
  2031  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2032  }
  2033  
  2034  // UpdateSnapshotRequest: Request for the UpdateSnapshot method.
  2035  type UpdateSnapshotRequest struct {
  2036  	// Snapshot: Required. The updated snapshot object.
  2037  	Snapshot *Snapshot `json:"snapshot,omitempty"`
  2038  	// UpdateMask: Required. Indicates which fields in the provided snapshot to
  2039  	// update. Must be specified and non-empty.
  2040  	UpdateMask string `json:"updateMask,omitempty"`
  2041  	// ForceSendFields is a list of field names (e.g. "Snapshot") to
  2042  	// unconditionally include in API requests. By default, fields with empty or
  2043  	// default values are omitted from API requests. See
  2044  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2045  	// details.
  2046  	ForceSendFields []string `json:"-"`
  2047  	// NullFields is a list of field names (e.g. "Snapshot") to include in API
  2048  	// requests with the JSON null value. By default, fields with empty values are
  2049  	// omitted from API requests. See
  2050  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2051  	NullFields []string `json:"-"`
  2052  }
  2053  
  2054  func (s *UpdateSnapshotRequest) MarshalJSON() ([]byte, error) {
  2055  	type NoMethod UpdateSnapshotRequest
  2056  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2057  }
  2058  
  2059  // UpdateSubscriptionRequest: Request for the UpdateSubscription method.
  2060  type UpdateSubscriptionRequest struct {
  2061  	// Subscription: Required. The updated subscription object.
  2062  	Subscription *Subscription `json:"subscription,omitempty"`
  2063  	// UpdateMask: Required. Indicates which fields in the provided subscription to
  2064  	// update. Must be specified and non-empty.
  2065  	UpdateMask string `json:"updateMask,omitempty"`
  2066  	// ForceSendFields is a list of field names (e.g. "Subscription") to
  2067  	// unconditionally include in API requests. By default, fields with empty or
  2068  	// default values are omitted from API requests. See
  2069  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2070  	// details.
  2071  	ForceSendFields []string `json:"-"`
  2072  	// NullFields is a list of field names (e.g. "Subscription") to include in API
  2073  	// requests with the JSON null value. By default, fields with empty values are
  2074  	// omitted from API requests. See
  2075  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2076  	NullFields []string `json:"-"`
  2077  }
  2078  
  2079  func (s *UpdateSubscriptionRequest) MarshalJSON() ([]byte, error) {
  2080  	type NoMethod UpdateSubscriptionRequest
  2081  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2082  }
  2083  
  2084  // UpdateTopicRequest: Request for the UpdateTopic method.
  2085  type UpdateTopicRequest struct {
  2086  	// Topic: Required. The updated topic object.
  2087  	Topic *Topic `json:"topic,omitempty"`
  2088  	// UpdateMask: Required. Indicates which fields in the provided topic to
  2089  	// update. Must be specified and non-empty. Note that if `update_mask` contains
  2090  	// "message_storage_policy" but the `message_storage_policy` is not set in the
  2091  	// `topic` provided above, then the updated value is determined by the policy
  2092  	// configured at the project or organization level.
  2093  	UpdateMask string `json:"updateMask,omitempty"`
  2094  	// ForceSendFields is a list of field names (e.g. "Topic") to unconditionally
  2095  	// include in API requests. By default, fields with empty or default values are
  2096  	// omitted from API requests. See
  2097  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2098  	// details.
  2099  	ForceSendFields []string `json:"-"`
  2100  	// NullFields is a list of field names (e.g. "Topic") to include in API
  2101  	// requests with the JSON null value. By default, fields with empty values are
  2102  	// omitted from API requests. See
  2103  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2104  	NullFields []string `json:"-"`
  2105  }
  2106  
  2107  func (s *UpdateTopicRequest) MarshalJSON() ([]byte, error) {
  2108  	type NoMethod UpdateTopicRequest
  2109  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2110  }
  2111  
  2112  // ValidateMessageRequest: Request for the `ValidateMessage` method.
  2113  type ValidateMessageRequest struct {
  2114  	// Encoding: The encoding expected for messages
  2115  	//
  2116  	// Possible values:
  2117  	//   "ENCODING_UNSPECIFIED" - Unspecified
  2118  	//   "JSON" - JSON encoding
  2119  	//   "BINARY" - Binary encoding, as defined by the schema type. For some schema
  2120  	// types, binary encoding may not be available.
  2121  	Encoding string `json:"encoding,omitempty"`
  2122  	// Message: Message to validate against the provided `schema_spec`.
  2123  	Message string `json:"message,omitempty"`
  2124  	// Name: Name of the schema against which to validate. Format is
  2125  	// `projects/{project}/schemas/{schema}`.
  2126  	Name string `json:"name,omitempty"`
  2127  	// Schema: Ad-hoc schema against which to validate
  2128  	Schema *Schema `json:"schema,omitempty"`
  2129  	// ForceSendFields is a list of field names (e.g. "Encoding") to
  2130  	// unconditionally include in API requests. By default, fields with empty or
  2131  	// default values are omitted from API requests. See
  2132  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2133  	// details.
  2134  	ForceSendFields []string `json:"-"`
  2135  	// NullFields is a list of field names (e.g. "Encoding") to include in API
  2136  	// requests with the JSON null value. By default, fields with empty values are
  2137  	// omitted from API requests. See
  2138  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2139  	NullFields []string `json:"-"`
  2140  }
  2141  
  2142  func (s *ValidateMessageRequest) MarshalJSON() ([]byte, error) {
  2143  	type NoMethod ValidateMessageRequest
  2144  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2145  }
  2146  
  2147  // ValidateMessageResponse: Response for the `ValidateMessage` method. Empty
  2148  // for now.
  2149  type ValidateMessageResponse struct {
  2150  	// ServerResponse contains the HTTP response code and headers from the server.
  2151  	googleapi.ServerResponse `json:"-"`
  2152  }
  2153  
  2154  // ValidateSchemaRequest: Request for the `ValidateSchema` method.
  2155  type ValidateSchemaRequest struct {
  2156  	// Schema: Required. The schema object to validate.
  2157  	Schema *Schema `json:"schema,omitempty"`
  2158  	// ForceSendFields is a list of field names (e.g. "Schema") to unconditionally
  2159  	// include in API requests. By default, fields with empty or default values are
  2160  	// omitted from API requests. See
  2161  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2162  	// details.
  2163  	ForceSendFields []string `json:"-"`
  2164  	// NullFields is a list of field names (e.g. "Schema") to include in API
  2165  	// requests with the JSON null value. By default, fields with empty values are
  2166  	// omitted from API requests. See
  2167  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2168  	NullFields []string `json:"-"`
  2169  }
  2170  
  2171  func (s *ValidateSchemaRequest) MarshalJSON() ([]byte, error) {
  2172  	type NoMethod ValidateSchemaRequest
  2173  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2174  }
  2175  
  2176  // ValidateSchemaResponse: Response for the `ValidateSchema` method. Empty for
  2177  // now.
  2178  type ValidateSchemaResponse struct {
  2179  	// ServerResponse contains the HTTP response code and headers from the server.
  2180  	googleapi.ServerResponse `json:"-"`
  2181  }
  2182  
  2183  type ProjectsSchemasCommitCall struct {
  2184  	s                   *Service
  2185  	name                string
  2186  	commitschemarequest *CommitSchemaRequest
  2187  	urlParams_          gensupport.URLParams
  2188  	ctx_                context.Context
  2189  	header_             http.Header
  2190  }
  2191  
  2192  // Commit: Commits a new schema revision to an existing schema.
  2193  //
  2194  //   - name: The name of the schema we are revising. Format is
  2195  //     `projects/{project}/schemas/{schema}`.
  2196  func (r *ProjectsSchemasService) Commit(name string, commitschemarequest *CommitSchemaRequest) *ProjectsSchemasCommitCall {
  2197  	c := &ProjectsSchemasCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2198  	c.name = name
  2199  	c.commitschemarequest = commitschemarequest
  2200  	return c
  2201  }
  2202  
  2203  // Fields allows partial responses to be retrieved. See
  2204  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2205  // details.
  2206  func (c *ProjectsSchemasCommitCall) Fields(s ...googleapi.Field) *ProjectsSchemasCommitCall {
  2207  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2208  	return c
  2209  }
  2210  
  2211  // Context sets the context to be used in this call's Do method.
  2212  func (c *ProjectsSchemasCommitCall) Context(ctx context.Context) *ProjectsSchemasCommitCall {
  2213  	c.ctx_ = ctx
  2214  	return c
  2215  }
  2216  
  2217  // Header returns a http.Header that can be modified by the caller to add
  2218  // headers to the request.
  2219  func (c *ProjectsSchemasCommitCall) Header() http.Header {
  2220  	if c.header_ == nil {
  2221  		c.header_ = make(http.Header)
  2222  	}
  2223  	return c.header_
  2224  }
  2225  
  2226  func (c *ProjectsSchemasCommitCall) doRequest(alt string) (*http.Response, error) {
  2227  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2228  	var body io.Reader = nil
  2229  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitschemarequest)
  2230  	if err != nil {
  2231  		return nil, err
  2232  	}
  2233  	c.urlParams_.Set("alt", alt)
  2234  	c.urlParams_.Set("prettyPrint", "false")
  2235  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:commit")
  2236  	urls += "?" + c.urlParams_.Encode()
  2237  	req, err := http.NewRequest("POST", urls, body)
  2238  	if err != nil {
  2239  		return nil, err
  2240  	}
  2241  	req.Header = reqHeaders
  2242  	googleapi.Expand(req.URL, map[string]string{
  2243  		"name": c.name,
  2244  	})
  2245  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2246  }
  2247  
  2248  // Do executes the "pubsub.projects.schemas.commit" call.
  2249  // Any non-2xx status code is an error. Response headers are in either
  2250  // *Schema.ServerResponse.Header or (if a response was returned at all) in
  2251  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2252  // whether the returned error was because http.StatusNotModified was returned.
  2253  func (c *ProjectsSchemasCommitCall) Do(opts ...googleapi.CallOption) (*Schema, error) {
  2254  	gensupport.SetOptions(c.urlParams_, opts...)
  2255  	res, err := c.doRequest("json")
  2256  	if res != nil && res.StatusCode == http.StatusNotModified {
  2257  		if res.Body != nil {
  2258  			res.Body.Close()
  2259  		}
  2260  		return nil, gensupport.WrapError(&googleapi.Error{
  2261  			Code:   res.StatusCode,
  2262  			Header: res.Header,
  2263  		})
  2264  	}
  2265  	if err != nil {
  2266  		return nil, err
  2267  	}
  2268  	defer googleapi.CloseBody(res)
  2269  	if err := googleapi.CheckResponse(res); err != nil {
  2270  		return nil, gensupport.WrapError(err)
  2271  	}
  2272  	ret := &Schema{
  2273  		ServerResponse: googleapi.ServerResponse{
  2274  			Header:         res.Header,
  2275  			HTTPStatusCode: res.StatusCode,
  2276  		},
  2277  	}
  2278  	target := &ret
  2279  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2280  		return nil, err
  2281  	}
  2282  	return ret, nil
  2283  }
  2284  
  2285  type ProjectsSchemasCreateCall struct {
  2286  	s          *Service
  2287  	parent     string
  2288  	schema     *Schema
  2289  	urlParams_ gensupport.URLParams
  2290  	ctx_       context.Context
  2291  	header_    http.Header
  2292  }
  2293  
  2294  // Create: Creates a schema.
  2295  //
  2296  //   - parent: The name of the project in which to create the schema. Format is
  2297  //     `projects/{project-id}`.
  2298  func (r *ProjectsSchemasService) Create(parent string, schema *Schema) *ProjectsSchemasCreateCall {
  2299  	c := &ProjectsSchemasCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2300  	c.parent = parent
  2301  	c.schema = schema
  2302  	return c
  2303  }
  2304  
  2305  // SchemaId sets the optional parameter "schemaId": The ID to use for the
  2306  // schema, which will become the final component of the schema's resource name.
  2307  // See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for
  2308  // resource name constraints.
  2309  func (c *ProjectsSchemasCreateCall) SchemaId(schemaId string) *ProjectsSchemasCreateCall {
  2310  	c.urlParams_.Set("schemaId", schemaId)
  2311  	return c
  2312  }
  2313  
  2314  // Fields allows partial responses to be retrieved. See
  2315  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2316  // details.
  2317  func (c *ProjectsSchemasCreateCall) Fields(s ...googleapi.Field) *ProjectsSchemasCreateCall {
  2318  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2319  	return c
  2320  }
  2321  
  2322  // Context sets the context to be used in this call's Do method.
  2323  func (c *ProjectsSchemasCreateCall) Context(ctx context.Context) *ProjectsSchemasCreateCall {
  2324  	c.ctx_ = ctx
  2325  	return c
  2326  }
  2327  
  2328  // Header returns a http.Header that can be modified by the caller to add
  2329  // headers to the request.
  2330  func (c *ProjectsSchemasCreateCall) Header() http.Header {
  2331  	if c.header_ == nil {
  2332  		c.header_ = make(http.Header)
  2333  	}
  2334  	return c.header_
  2335  }
  2336  
  2337  func (c *ProjectsSchemasCreateCall) doRequest(alt string) (*http.Response, error) {
  2338  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2339  	var body io.Reader = nil
  2340  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema)
  2341  	if err != nil {
  2342  		return nil, err
  2343  	}
  2344  	c.urlParams_.Set("alt", alt)
  2345  	c.urlParams_.Set("prettyPrint", "false")
  2346  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schemas")
  2347  	urls += "?" + c.urlParams_.Encode()
  2348  	req, err := http.NewRequest("POST", urls, body)
  2349  	if err != nil {
  2350  		return nil, err
  2351  	}
  2352  	req.Header = reqHeaders
  2353  	googleapi.Expand(req.URL, map[string]string{
  2354  		"parent": c.parent,
  2355  	})
  2356  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2357  }
  2358  
  2359  // Do executes the "pubsub.projects.schemas.create" call.
  2360  // Any non-2xx status code is an error. Response headers are in either
  2361  // *Schema.ServerResponse.Header or (if a response was returned at all) in
  2362  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2363  // whether the returned error was because http.StatusNotModified was returned.
  2364  func (c *ProjectsSchemasCreateCall) Do(opts ...googleapi.CallOption) (*Schema, error) {
  2365  	gensupport.SetOptions(c.urlParams_, opts...)
  2366  	res, err := c.doRequest("json")
  2367  	if res != nil && res.StatusCode == http.StatusNotModified {
  2368  		if res.Body != nil {
  2369  			res.Body.Close()
  2370  		}
  2371  		return nil, gensupport.WrapError(&googleapi.Error{
  2372  			Code:   res.StatusCode,
  2373  			Header: res.Header,
  2374  		})
  2375  	}
  2376  	if err != nil {
  2377  		return nil, err
  2378  	}
  2379  	defer googleapi.CloseBody(res)
  2380  	if err := googleapi.CheckResponse(res); err != nil {
  2381  		return nil, gensupport.WrapError(err)
  2382  	}
  2383  	ret := &Schema{
  2384  		ServerResponse: googleapi.ServerResponse{
  2385  			Header:         res.Header,
  2386  			HTTPStatusCode: res.StatusCode,
  2387  		},
  2388  	}
  2389  	target := &ret
  2390  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2391  		return nil, err
  2392  	}
  2393  	return ret, nil
  2394  }
  2395  
  2396  type ProjectsSchemasDeleteCall struct {
  2397  	s          *Service
  2398  	name       string
  2399  	urlParams_ gensupport.URLParams
  2400  	ctx_       context.Context
  2401  	header_    http.Header
  2402  }
  2403  
  2404  // Delete: Deletes a schema.
  2405  //
  2406  //   - name: Name of the schema to delete. Format is
  2407  //     `projects/{project}/schemas/{schema}`.
  2408  func (r *ProjectsSchemasService) Delete(name string) *ProjectsSchemasDeleteCall {
  2409  	c := &ProjectsSchemasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2410  	c.name = name
  2411  	return c
  2412  }
  2413  
  2414  // Fields allows partial responses to be retrieved. See
  2415  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2416  // details.
  2417  func (c *ProjectsSchemasDeleteCall) Fields(s ...googleapi.Field) *ProjectsSchemasDeleteCall {
  2418  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2419  	return c
  2420  }
  2421  
  2422  // Context sets the context to be used in this call's Do method.
  2423  func (c *ProjectsSchemasDeleteCall) Context(ctx context.Context) *ProjectsSchemasDeleteCall {
  2424  	c.ctx_ = ctx
  2425  	return c
  2426  }
  2427  
  2428  // Header returns a http.Header that can be modified by the caller to add
  2429  // headers to the request.
  2430  func (c *ProjectsSchemasDeleteCall) Header() http.Header {
  2431  	if c.header_ == nil {
  2432  		c.header_ = make(http.Header)
  2433  	}
  2434  	return c.header_
  2435  }
  2436  
  2437  func (c *ProjectsSchemasDeleteCall) doRequest(alt string) (*http.Response, error) {
  2438  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2439  	var body io.Reader = nil
  2440  	c.urlParams_.Set("alt", alt)
  2441  	c.urlParams_.Set("prettyPrint", "false")
  2442  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2443  	urls += "?" + c.urlParams_.Encode()
  2444  	req, err := http.NewRequest("DELETE", urls, body)
  2445  	if err != nil {
  2446  		return nil, err
  2447  	}
  2448  	req.Header = reqHeaders
  2449  	googleapi.Expand(req.URL, map[string]string{
  2450  		"name": c.name,
  2451  	})
  2452  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2453  }
  2454  
  2455  // Do executes the "pubsub.projects.schemas.delete" call.
  2456  // Any non-2xx status code is an error. Response headers are in either
  2457  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2458  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2459  // whether the returned error was because http.StatusNotModified was returned.
  2460  func (c *ProjectsSchemasDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2461  	gensupport.SetOptions(c.urlParams_, opts...)
  2462  	res, err := c.doRequest("json")
  2463  	if res != nil && res.StatusCode == http.StatusNotModified {
  2464  		if res.Body != nil {
  2465  			res.Body.Close()
  2466  		}
  2467  		return nil, gensupport.WrapError(&googleapi.Error{
  2468  			Code:   res.StatusCode,
  2469  			Header: res.Header,
  2470  		})
  2471  	}
  2472  	if err != nil {
  2473  		return nil, err
  2474  	}
  2475  	defer googleapi.CloseBody(res)
  2476  	if err := googleapi.CheckResponse(res); err != nil {
  2477  		return nil, gensupport.WrapError(err)
  2478  	}
  2479  	ret := &Empty{
  2480  		ServerResponse: googleapi.ServerResponse{
  2481  			Header:         res.Header,
  2482  			HTTPStatusCode: res.StatusCode,
  2483  		},
  2484  	}
  2485  	target := &ret
  2486  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2487  		return nil, err
  2488  	}
  2489  	return ret, nil
  2490  }
  2491  
  2492  type ProjectsSchemasDeleteRevisionCall struct {
  2493  	s          *Service
  2494  	name       string
  2495  	urlParams_ gensupport.URLParams
  2496  	ctx_       context.Context
  2497  	header_    http.Header
  2498  }
  2499  
  2500  // DeleteRevision: Deletes a specific schema revision.
  2501  //
  2502  //   - name: The name of the schema revision to be deleted, with a revision ID
  2503  //     explicitly included. Example: `projects/123/schemas/my-schema@c7cfa2a8`.
  2504  func (r *ProjectsSchemasService) DeleteRevision(name string) *ProjectsSchemasDeleteRevisionCall {
  2505  	c := &ProjectsSchemasDeleteRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2506  	c.name = name
  2507  	return c
  2508  }
  2509  
  2510  // RevisionId sets the optional parameter "revisionId": This field is
  2511  // deprecated and should not be used for specifying the revision ID. The
  2512  // revision ID should be specified via the `name` parameter.
  2513  func (c *ProjectsSchemasDeleteRevisionCall) RevisionId(revisionId string) *ProjectsSchemasDeleteRevisionCall {
  2514  	c.urlParams_.Set("revisionId", revisionId)
  2515  	return c
  2516  }
  2517  
  2518  // Fields allows partial responses to be retrieved. See
  2519  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2520  // details.
  2521  func (c *ProjectsSchemasDeleteRevisionCall) Fields(s ...googleapi.Field) *ProjectsSchemasDeleteRevisionCall {
  2522  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2523  	return c
  2524  }
  2525  
  2526  // Context sets the context to be used in this call's Do method.
  2527  func (c *ProjectsSchemasDeleteRevisionCall) Context(ctx context.Context) *ProjectsSchemasDeleteRevisionCall {
  2528  	c.ctx_ = ctx
  2529  	return c
  2530  }
  2531  
  2532  // Header returns a http.Header that can be modified by the caller to add
  2533  // headers to the request.
  2534  func (c *ProjectsSchemasDeleteRevisionCall) Header() http.Header {
  2535  	if c.header_ == nil {
  2536  		c.header_ = make(http.Header)
  2537  	}
  2538  	return c.header_
  2539  }
  2540  
  2541  func (c *ProjectsSchemasDeleteRevisionCall) doRequest(alt string) (*http.Response, error) {
  2542  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2543  	var body io.Reader = nil
  2544  	c.urlParams_.Set("alt", alt)
  2545  	c.urlParams_.Set("prettyPrint", "false")
  2546  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision")
  2547  	urls += "?" + c.urlParams_.Encode()
  2548  	req, err := http.NewRequest("DELETE", urls, body)
  2549  	if err != nil {
  2550  		return nil, err
  2551  	}
  2552  	req.Header = reqHeaders
  2553  	googleapi.Expand(req.URL, map[string]string{
  2554  		"name": c.name,
  2555  	})
  2556  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2557  }
  2558  
  2559  // Do executes the "pubsub.projects.schemas.deleteRevision" call.
  2560  // Any non-2xx status code is an error. Response headers are in either
  2561  // *Schema.ServerResponse.Header or (if a response was returned at all) in
  2562  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2563  // whether the returned error was because http.StatusNotModified was returned.
  2564  func (c *ProjectsSchemasDeleteRevisionCall) Do(opts ...googleapi.CallOption) (*Schema, error) {
  2565  	gensupport.SetOptions(c.urlParams_, opts...)
  2566  	res, err := c.doRequest("json")
  2567  	if res != nil && res.StatusCode == http.StatusNotModified {
  2568  		if res.Body != nil {
  2569  			res.Body.Close()
  2570  		}
  2571  		return nil, gensupport.WrapError(&googleapi.Error{
  2572  			Code:   res.StatusCode,
  2573  			Header: res.Header,
  2574  		})
  2575  	}
  2576  	if err != nil {
  2577  		return nil, err
  2578  	}
  2579  	defer googleapi.CloseBody(res)
  2580  	if err := googleapi.CheckResponse(res); err != nil {
  2581  		return nil, gensupport.WrapError(err)
  2582  	}
  2583  	ret := &Schema{
  2584  		ServerResponse: googleapi.ServerResponse{
  2585  			Header:         res.Header,
  2586  			HTTPStatusCode: res.StatusCode,
  2587  		},
  2588  	}
  2589  	target := &ret
  2590  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2591  		return nil, err
  2592  	}
  2593  	return ret, nil
  2594  }
  2595  
  2596  type ProjectsSchemasGetCall struct {
  2597  	s            *Service
  2598  	name         string
  2599  	urlParams_   gensupport.URLParams
  2600  	ifNoneMatch_ string
  2601  	ctx_         context.Context
  2602  	header_      http.Header
  2603  }
  2604  
  2605  // Get: Gets a schema.
  2606  //
  2607  //   - name: The name of the schema to get. Format is
  2608  //     `projects/{project}/schemas/{schema}`.
  2609  func (r *ProjectsSchemasService) Get(name string) *ProjectsSchemasGetCall {
  2610  	c := &ProjectsSchemasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2611  	c.name = name
  2612  	return c
  2613  }
  2614  
  2615  // View sets the optional parameter "view": The set of fields to return in the
  2616  // response. If not set, returns a Schema with all fields filled out. Set to
  2617  // `BASIC` to omit the `definition`.
  2618  //
  2619  // Possible values:
  2620  //
  2621  //	"SCHEMA_VIEW_UNSPECIFIED" - The default / unset value. The API will
  2622  //
  2623  // default to the BASIC view.
  2624  //
  2625  //	"BASIC" - Include the name and type of the schema, but not the definition.
  2626  //	"FULL" - Include all Schema object fields.
  2627  func (c *ProjectsSchemasGetCall) View(view string) *ProjectsSchemasGetCall {
  2628  	c.urlParams_.Set("view", view)
  2629  	return c
  2630  }
  2631  
  2632  // Fields allows partial responses to be retrieved. See
  2633  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2634  // details.
  2635  func (c *ProjectsSchemasGetCall) Fields(s ...googleapi.Field) *ProjectsSchemasGetCall {
  2636  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2637  	return c
  2638  }
  2639  
  2640  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2641  // object's ETag matches the given value. This is useful for getting updates
  2642  // only after the object has changed since the last request.
  2643  func (c *ProjectsSchemasGetCall) IfNoneMatch(entityTag string) *ProjectsSchemasGetCall {
  2644  	c.ifNoneMatch_ = entityTag
  2645  	return c
  2646  }
  2647  
  2648  // Context sets the context to be used in this call's Do method.
  2649  func (c *ProjectsSchemasGetCall) Context(ctx context.Context) *ProjectsSchemasGetCall {
  2650  	c.ctx_ = ctx
  2651  	return c
  2652  }
  2653  
  2654  // Header returns a http.Header that can be modified by the caller to add
  2655  // headers to the request.
  2656  func (c *ProjectsSchemasGetCall) Header() http.Header {
  2657  	if c.header_ == nil {
  2658  		c.header_ = make(http.Header)
  2659  	}
  2660  	return c.header_
  2661  }
  2662  
  2663  func (c *ProjectsSchemasGetCall) doRequest(alt string) (*http.Response, error) {
  2664  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2665  	if c.ifNoneMatch_ != "" {
  2666  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2667  	}
  2668  	var body io.Reader = nil
  2669  	c.urlParams_.Set("alt", alt)
  2670  	c.urlParams_.Set("prettyPrint", "false")
  2671  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2672  	urls += "?" + c.urlParams_.Encode()
  2673  	req, err := http.NewRequest("GET", urls, body)
  2674  	if err != nil {
  2675  		return nil, err
  2676  	}
  2677  	req.Header = reqHeaders
  2678  	googleapi.Expand(req.URL, map[string]string{
  2679  		"name": c.name,
  2680  	})
  2681  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2682  }
  2683  
  2684  // Do executes the "pubsub.projects.schemas.get" call.
  2685  // Any non-2xx status code is an error. Response headers are in either
  2686  // *Schema.ServerResponse.Header or (if a response was returned at all) in
  2687  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2688  // whether the returned error was because http.StatusNotModified was returned.
  2689  func (c *ProjectsSchemasGetCall) Do(opts ...googleapi.CallOption) (*Schema, error) {
  2690  	gensupport.SetOptions(c.urlParams_, opts...)
  2691  	res, err := c.doRequest("json")
  2692  	if res != nil && res.StatusCode == http.StatusNotModified {
  2693  		if res.Body != nil {
  2694  			res.Body.Close()
  2695  		}
  2696  		return nil, gensupport.WrapError(&googleapi.Error{
  2697  			Code:   res.StatusCode,
  2698  			Header: res.Header,
  2699  		})
  2700  	}
  2701  	if err != nil {
  2702  		return nil, err
  2703  	}
  2704  	defer googleapi.CloseBody(res)
  2705  	if err := googleapi.CheckResponse(res); err != nil {
  2706  		return nil, gensupport.WrapError(err)
  2707  	}
  2708  	ret := &Schema{
  2709  		ServerResponse: googleapi.ServerResponse{
  2710  			Header:         res.Header,
  2711  			HTTPStatusCode: res.StatusCode,
  2712  		},
  2713  	}
  2714  	target := &ret
  2715  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2716  		return nil, err
  2717  	}
  2718  	return ret, nil
  2719  }
  2720  
  2721  type ProjectsSchemasGetIamPolicyCall struct {
  2722  	s            *Service
  2723  	resource     string
  2724  	urlParams_   gensupport.URLParams
  2725  	ifNoneMatch_ string
  2726  	ctx_         context.Context
  2727  	header_      http.Header
  2728  }
  2729  
  2730  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  2731  // empty policy if the resource exists and does not have a policy set.
  2732  //
  2733  //   - resource: REQUIRED: The resource for which the policy is being requested.
  2734  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2735  //     for the appropriate value for this field.
  2736  func (r *ProjectsSchemasService) GetIamPolicy(resource string) *ProjectsSchemasGetIamPolicyCall {
  2737  	c := &ProjectsSchemasGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2738  	c.resource = resource
  2739  	return c
  2740  }
  2741  
  2742  // OptionsRequestedPolicyVersion sets the optional parameter
  2743  // "options.requestedPolicyVersion": The maximum policy version that will be
  2744  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  2745  // an invalid value will be rejected. Requests for policies with any
  2746  // conditional role bindings must specify version 3. Policies with no
  2747  // conditional role bindings may specify any valid value or leave the field
  2748  // unset. The policy in the response might use the policy version that you
  2749  // specified, or it might use a lower policy version. For example, if you
  2750  // specify version 3, but the policy has no conditional role bindings, the
  2751  // response uses version 1. To learn which resources support conditions in
  2752  // their IAM policies, see the IAM documentation
  2753  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  2754  func (c *ProjectsSchemasGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsSchemasGetIamPolicyCall {
  2755  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  2756  	return c
  2757  }
  2758  
  2759  // Fields allows partial responses to be retrieved. See
  2760  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2761  // details.
  2762  func (c *ProjectsSchemasGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSchemasGetIamPolicyCall {
  2763  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2764  	return c
  2765  }
  2766  
  2767  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2768  // object's ETag matches the given value. This is useful for getting updates
  2769  // only after the object has changed since the last request.
  2770  func (c *ProjectsSchemasGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSchemasGetIamPolicyCall {
  2771  	c.ifNoneMatch_ = entityTag
  2772  	return c
  2773  }
  2774  
  2775  // Context sets the context to be used in this call's Do method.
  2776  func (c *ProjectsSchemasGetIamPolicyCall) Context(ctx context.Context) *ProjectsSchemasGetIamPolicyCall {
  2777  	c.ctx_ = ctx
  2778  	return c
  2779  }
  2780  
  2781  // Header returns a http.Header that can be modified by the caller to add
  2782  // headers to the request.
  2783  func (c *ProjectsSchemasGetIamPolicyCall) Header() http.Header {
  2784  	if c.header_ == nil {
  2785  		c.header_ = make(http.Header)
  2786  	}
  2787  	return c.header_
  2788  }
  2789  
  2790  func (c *ProjectsSchemasGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2791  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2792  	if c.ifNoneMatch_ != "" {
  2793  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2794  	}
  2795  	var body io.Reader = nil
  2796  	c.urlParams_.Set("alt", alt)
  2797  	c.urlParams_.Set("prettyPrint", "false")
  2798  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  2799  	urls += "?" + c.urlParams_.Encode()
  2800  	req, err := http.NewRequest("GET", urls, body)
  2801  	if err != nil {
  2802  		return nil, err
  2803  	}
  2804  	req.Header = reqHeaders
  2805  	googleapi.Expand(req.URL, map[string]string{
  2806  		"resource": c.resource,
  2807  	})
  2808  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2809  }
  2810  
  2811  // Do executes the "pubsub.projects.schemas.getIamPolicy" call.
  2812  // Any non-2xx status code is an error. Response headers are in either
  2813  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2814  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2815  // whether the returned error was because http.StatusNotModified was returned.
  2816  func (c *ProjectsSchemasGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2817  	gensupport.SetOptions(c.urlParams_, opts...)
  2818  	res, err := c.doRequest("json")
  2819  	if res != nil && res.StatusCode == http.StatusNotModified {
  2820  		if res.Body != nil {
  2821  			res.Body.Close()
  2822  		}
  2823  		return nil, gensupport.WrapError(&googleapi.Error{
  2824  			Code:   res.StatusCode,
  2825  			Header: res.Header,
  2826  		})
  2827  	}
  2828  	if err != nil {
  2829  		return nil, err
  2830  	}
  2831  	defer googleapi.CloseBody(res)
  2832  	if err := googleapi.CheckResponse(res); err != nil {
  2833  		return nil, gensupport.WrapError(err)
  2834  	}
  2835  	ret := &Policy{
  2836  		ServerResponse: googleapi.ServerResponse{
  2837  			Header:         res.Header,
  2838  			HTTPStatusCode: res.StatusCode,
  2839  		},
  2840  	}
  2841  	target := &ret
  2842  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2843  		return nil, err
  2844  	}
  2845  	return ret, nil
  2846  }
  2847  
  2848  type ProjectsSchemasListCall struct {
  2849  	s            *Service
  2850  	parent       string
  2851  	urlParams_   gensupport.URLParams
  2852  	ifNoneMatch_ string
  2853  	ctx_         context.Context
  2854  	header_      http.Header
  2855  }
  2856  
  2857  // List: Lists schemas in a project.
  2858  //
  2859  //   - parent: The name of the project in which to list schemas. Format is
  2860  //     `projects/{project-id}`.
  2861  func (r *ProjectsSchemasService) List(parent string) *ProjectsSchemasListCall {
  2862  	c := &ProjectsSchemasListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2863  	c.parent = parent
  2864  	return c
  2865  }
  2866  
  2867  // PageSize sets the optional parameter "pageSize": Maximum number of schemas
  2868  // to return.
  2869  func (c *ProjectsSchemasListCall) PageSize(pageSize int64) *ProjectsSchemasListCall {
  2870  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2871  	return c
  2872  }
  2873  
  2874  // PageToken sets the optional parameter "pageToken": The value returned by the
  2875  // last `ListSchemasResponse`; indicates that this is a continuation of a prior
  2876  // `ListSchemas` call, and that the system should return the next page of data.
  2877  func (c *ProjectsSchemasListCall) PageToken(pageToken string) *ProjectsSchemasListCall {
  2878  	c.urlParams_.Set("pageToken", pageToken)
  2879  	return c
  2880  }
  2881  
  2882  // View sets the optional parameter "view": The set of Schema fields to return
  2883  // in the response. If not set, returns Schemas with `name` and `type`, but not
  2884  // `definition`. Set to `FULL` to retrieve all fields.
  2885  //
  2886  // Possible values:
  2887  //
  2888  //	"SCHEMA_VIEW_UNSPECIFIED" - The default / unset value. The API will
  2889  //
  2890  // default to the BASIC view.
  2891  //
  2892  //	"BASIC" - Include the name and type of the schema, but not the definition.
  2893  //	"FULL" - Include all Schema object fields.
  2894  func (c *ProjectsSchemasListCall) View(view string) *ProjectsSchemasListCall {
  2895  	c.urlParams_.Set("view", view)
  2896  	return c
  2897  }
  2898  
  2899  // Fields allows partial responses to be retrieved. See
  2900  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2901  // details.
  2902  func (c *ProjectsSchemasListCall) Fields(s ...googleapi.Field) *ProjectsSchemasListCall {
  2903  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2904  	return c
  2905  }
  2906  
  2907  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2908  // object's ETag matches the given value. This is useful for getting updates
  2909  // only after the object has changed since the last request.
  2910  func (c *ProjectsSchemasListCall) IfNoneMatch(entityTag string) *ProjectsSchemasListCall {
  2911  	c.ifNoneMatch_ = entityTag
  2912  	return c
  2913  }
  2914  
  2915  // Context sets the context to be used in this call's Do method.
  2916  func (c *ProjectsSchemasListCall) Context(ctx context.Context) *ProjectsSchemasListCall {
  2917  	c.ctx_ = ctx
  2918  	return c
  2919  }
  2920  
  2921  // Header returns a http.Header that can be modified by the caller to add
  2922  // headers to the request.
  2923  func (c *ProjectsSchemasListCall) Header() http.Header {
  2924  	if c.header_ == nil {
  2925  		c.header_ = make(http.Header)
  2926  	}
  2927  	return c.header_
  2928  }
  2929  
  2930  func (c *ProjectsSchemasListCall) doRequest(alt string) (*http.Response, error) {
  2931  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2932  	if c.ifNoneMatch_ != "" {
  2933  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2934  	}
  2935  	var body io.Reader = nil
  2936  	c.urlParams_.Set("alt", alt)
  2937  	c.urlParams_.Set("prettyPrint", "false")
  2938  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schemas")
  2939  	urls += "?" + c.urlParams_.Encode()
  2940  	req, err := http.NewRequest("GET", urls, body)
  2941  	if err != nil {
  2942  		return nil, err
  2943  	}
  2944  	req.Header = reqHeaders
  2945  	googleapi.Expand(req.URL, map[string]string{
  2946  		"parent": c.parent,
  2947  	})
  2948  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2949  }
  2950  
  2951  // Do executes the "pubsub.projects.schemas.list" call.
  2952  // Any non-2xx status code is an error. Response headers are in either
  2953  // *ListSchemasResponse.ServerResponse.Header or (if a response was returned at
  2954  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2955  // check whether the returned error was because http.StatusNotModified was
  2956  // returned.
  2957  func (c *ProjectsSchemasListCall) Do(opts ...googleapi.CallOption) (*ListSchemasResponse, error) {
  2958  	gensupport.SetOptions(c.urlParams_, opts...)
  2959  	res, err := c.doRequest("json")
  2960  	if res != nil && res.StatusCode == http.StatusNotModified {
  2961  		if res.Body != nil {
  2962  			res.Body.Close()
  2963  		}
  2964  		return nil, gensupport.WrapError(&googleapi.Error{
  2965  			Code:   res.StatusCode,
  2966  			Header: res.Header,
  2967  		})
  2968  	}
  2969  	if err != nil {
  2970  		return nil, err
  2971  	}
  2972  	defer googleapi.CloseBody(res)
  2973  	if err := googleapi.CheckResponse(res); err != nil {
  2974  		return nil, gensupport.WrapError(err)
  2975  	}
  2976  	ret := &ListSchemasResponse{
  2977  		ServerResponse: googleapi.ServerResponse{
  2978  			Header:         res.Header,
  2979  			HTTPStatusCode: res.StatusCode,
  2980  		},
  2981  	}
  2982  	target := &ret
  2983  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2984  		return nil, err
  2985  	}
  2986  	return ret, nil
  2987  }
  2988  
  2989  // Pages invokes f for each page of results.
  2990  // A non-nil error returned from f will halt the iteration.
  2991  // The provided context supersedes any context provided to the Context method.
  2992  func (c *ProjectsSchemasListCall) Pages(ctx context.Context, f func(*ListSchemasResponse) error) error {
  2993  	c.ctx_ = ctx
  2994  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2995  	for {
  2996  		x, err := c.Do()
  2997  		if err != nil {
  2998  			return err
  2999  		}
  3000  		if err := f(x); err != nil {
  3001  			return err
  3002  		}
  3003  		if x.NextPageToken == "" {
  3004  			return nil
  3005  		}
  3006  		c.PageToken(x.NextPageToken)
  3007  	}
  3008  }
  3009  
  3010  type ProjectsSchemasListRevisionsCall struct {
  3011  	s            *Service
  3012  	name         string
  3013  	urlParams_   gensupport.URLParams
  3014  	ifNoneMatch_ string
  3015  	ctx_         context.Context
  3016  	header_      http.Header
  3017  }
  3018  
  3019  // ListRevisions: Lists all schema revisions for the named schema.
  3020  //
  3021  // - name: The name of the schema to list revisions for.
  3022  func (r *ProjectsSchemasService) ListRevisions(name string) *ProjectsSchemasListRevisionsCall {
  3023  	c := &ProjectsSchemasListRevisionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3024  	c.name = name
  3025  	return c
  3026  }
  3027  
  3028  // PageSize sets the optional parameter "pageSize": The maximum number of
  3029  // revisions to return per page.
  3030  func (c *ProjectsSchemasListRevisionsCall) PageSize(pageSize int64) *ProjectsSchemasListRevisionsCall {
  3031  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3032  	return c
  3033  }
  3034  
  3035  // PageToken sets the optional parameter "pageToken": The page token, received
  3036  // from a previous ListSchemaRevisions call. Provide this to retrieve the
  3037  // subsequent page.
  3038  func (c *ProjectsSchemasListRevisionsCall) PageToken(pageToken string) *ProjectsSchemasListRevisionsCall {
  3039  	c.urlParams_.Set("pageToken", pageToken)
  3040  	return c
  3041  }
  3042  
  3043  // View sets the optional parameter "view": The set of Schema fields to return
  3044  // in the response. If not set, returns Schemas with `name` and `type`, but not
  3045  // `definition`. Set to `FULL` to retrieve all fields.
  3046  //
  3047  // Possible values:
  3048  //
  3049  //	"SCHEMA_VIEW_UNSPECIFIED" - The default / unset value. The API will
  3050  //
  3051  // default to the BASIC view.
  3052  //
  3053  //	"BASIC" - Include the name and type of the schema, but not the definition.
  3054  //	"FULL" - Include all Schema object fields.
  3055  func (c *ProjectsSchemasListRevisionsCall) View(view string) *ProjectsSchemasListRevisionsCall {
  3056  	c.urlParams_.Set("view", view)
  3057  	return c
  3058  }
  3059  
  3060  // Fields allows partial responses to be retrieved. See
  3061  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3062  // details.
  3063  func (c *ProjectsSchemasListRevisionsCall) Fields(s ...googleapi.Field) *ProjectsSchemasListRevisionsCall {
  3064  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3065  	return c
  3066  }
  3067  
  3068  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3069  // object's ETag matches the given value. This is useful for getting updates
  3070  // only after the object has changed since the last request.
  3071  func (c *ProjectsSchemasListRevisionsCall) IfNoneMatch(entityTag string) *ProjectsSchemasListRevisionsCall {
  3072  	c.ifNoneMatch_ = entityTag
  3073  	return c
  3074  }
  3075  
  3076  // Context sets the context to be used in this call's Do method.
  3077  func (c *ProjectsSchemasListRevisionsCall) Context(ctx context.Context) *ProjectsSchemasListRevisionsCall {
  3078  	c.ctx_ = ctx
  3079  	return c
  3080  }
  3081  
  3082  // Header returns a http.Header that can be modified by the caller to add
  3083  // headers to the request.
  3084  func (c *ProjectsSchemasListRevisionsCall) Header() http.Header {
  3085  	if c.header_ == nil {
  3086  		c.header_ = make(http.Header)
  3087  	}
  3088  	return c.header_
  3089  }
  3090  
  3091  func (c *ProjectsSchemasListRevisionsCall) doRequest(alt string) (*http.Response, error) {
  3092  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3093  	if c.ifNoneMatch_ != "" {
  3094  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3095  	}
  3096  	var body io.Reader = nil
  3097  	c.urlParams_.Set("alt", alt)
  3098  	c.urlParams_.Set("prettyPrint", "false")
  3099  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions")
  3100  	urls += "?" + c.urlParams_.Encode()
  3101  	req, err := http.NewRequest("GET", urls, body)
  3102  	if err != nil {
  3103  		return nil, err
  3104  	}
  3105  	req.Header = reqHeaders
  3106  	googleapi.Expand(req.URL, map[string]string{
  3107  		"name": c.name,
  3108  	})
  3109  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3110  }
  3111  
  3112  // Do executes the "pubsub.projects.schemas.listRevisions" call.
  3113  // Any non-2xx status code is an error. Response headers are in either
  3114  // *ListSchemaRevisionsResponse.ServerResponse.Header or (if a response was
  3115  // returned at all) in error.(*googleapi.Error).Header. Use
  3116  // googleapi.IsNotModified to check whether the returned error was because
  3117  // http.StatusNotModified was returned.
  3118  func (c *ProjectsSchemasListRevisionsCall) Do(opts ...googleapi.CallOption) (*ListSchemaRevisionsResponse, error) {
  3119  	gensupport.SetOptions(c.urlParams_, opts...)
  3120  	res, err := c.doRequest("json")
  3121  	if res != nil && res.StatusCode == http.StatusNotModified {
  3122  		if res.Body != nil {
  3123  			res.Body.Close()
  3124  		}
  3125  		return nil, gensupport.WrapError(&googleapi.Error{
  3126  			Code:   res.StatusCode,
  3127  			Header: res.Header,
  3128  		})
  3129  	}
  3130  	if err != nil {
  3131  		return nil, err
  3132  	}
  3133  	defer googleapi.CloseBody(res)
  3134  	if err := googleapi.CheckResponse(res); err != nil {
  3135  		return nil, gensupport.WrapError(err)
  3136  	}
  3137  	ret := &ListSchemaRevisionsResponse{
  3138  		ServerResponse: googleapi.ServerResponse{
  3139  			Header:         res.Header,
  3140  			HTTPStatusCode: res.StatusCode,
  3141  		},
  3142  	}
  3143  	target := &ret
  3144  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3145  		return nil, err
  3146  	}
  3147  	return ret, nil
  3148  }
  3149  
  3150  // Pages invokes f for each page of results.
  3151  // A non-nil error returned from f will halt the iteration.
  3152  // The provided context supersedes any context provided to the Context method.
  3153  func (c *ProjectsSchemasListRevisionsCall) Pages(ctx context.Context, f func(*ListSchemaRevisionsResponse) error) error {
  3154  	c.ctx_ = ctx
  3155  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3156  	for {
  3157  		x, err := c.Do()
  3158  		if err != nil {
  3159  			return err
  3160  		}
  3161  		if err := f(x); err != nil {
  3162  			return err
  3163  		}
  3164  		if x.NextPageToken == "" {
  3165  			return nil
  3166  		}
  3167  		c.PageToken(x.NextPageToken)
  3168  	}
  3169  }
  3170  
  3171  type ProjectsSchemasRollbackCall struct {
  3172  	s                     *Service
  3173  	name                  string
  3174  	rollbackschemarequest *RollbackSchemaRequest
  3175  	urlParams_            gensupport.URLParams
  3176  	ctx_                  context.Context
  3177  	header_               http.Header
  3178  }
  3179  
  3180  // Rollback: Creates a new schema revision that is a copy of the provided
  3181  // revision_id.
  3182  //
  3183  // - name: The schema being rolled back with revision id.
  3184  func (r *ProjectsSchemasService) Rollback(name string, rollbackschemarequest *RollbackSchemaRequest) *ProjectsSchemasRollbackCall {
  3185  	c := &ProjectsSchemasRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3186  	c.name = name
  3187  	c.rollbackschemarequest = rollbackschemarequest
  3188  	return c
  3189  }
  3190  
  3191  // Fields allows partial responses to be retrieved. See
  3192  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3193  // details.
  3194  func (c *ProjectsSchemasRollbackCall) Fields(s ...googleapi.Field) *ProjectsSchemasRollbackCall {
  3195  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3196  	return c
  3197  }
  3198  
  3199  // Context sets the context to be used in this call's Do method.
  3200  func (c *ProjectsSchemasRollbackCall) Context(ctx context.Context) *ProjectsSchemasRollbackCall {
  3201  	c.ctx_ = ctx
  3202  	return c
  3203  }
  3204  
  3205  // Header returns a http.Header that can be modified by the caller to add
  3206  // headers to the request.
  3207  func (c *ProjectsSchemasRollbackCall) Header() http.Header {
  3208  	if c.header_ == nil {
  3209  		c.header_ = make(http.Header)
  3210  	}
  3211  	return c.header_
  3212  }
  3213  
  3214  func (c *ProjectsSchemasRollbackCall) doRequest(alt string) (*http.Response, error) {
  3215  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3216  	var body io.Reader = nil
  3217  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackschemarequest)
  3218  	if err != nil {
  3219  		return nil, err
  3220  	}
  3221  	c.urlParams_.Set("alt", alt)
  3222  	c.urlParams_.Set("prettyPrint", "false")
  3223  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
  3224  	urls += "?" + c.urlParams_.Encode()
  3225  	req, err := http.NewRequest("POST", urls, body)
  3226  	if err != nil {
  3227  		return nil, err
  3228  	}
  3229  	req.Header = reqHeaders
  3230  	googleapi.Expand(req.URL, map[string]string{
  3231  		"name": c.name,
  3232  	})
  3233  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3234  }
  3235  
  3236  // Do executes the "pubsub.projects.schemas.rollback" call.
  3237  // Any non-2xx status code is an error. Response headers are in either
  3238  // *Schema.ServerResponse.Header or (if a response was returned at all) in
  3239  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3240  // whether the returned error was because http.StatusNotModified was returned.
  3241  func (c *ProjectsSchemasRollbackCall) Do(opts ...googleapi.CallOption) (*Schema, error) {
  3242  	gensupport.SetOptions(c.urlParams_, opts...)
  3243  	res, err := c.doRequest("json")
  3244  	if res != nil && res.StatusCode == http.StatusNotModified {
  3245  		if res.Body != nil {
  3246  			res.Body.Close()
  3247  		}
  3248  		return nil, gensupport.WrapError(&googleapi.Error{
  3249  			Code:   res.StatusCode,
  3250  			Header: res.Header,
  3251  		})
  3252  	}
  3253  	if err != nil {
  3254  		return nil, err
  3255  	}
  3256  	defer googleapi.CloseBody(res)
  3257  	if err := googleapi.CheckResponse(res); err != nil {
  3258  		return nil, gensupport.WrapError(err)
  3259  	}
  3260  	ret := &Schema{
  3261  		ServerResponse: googleapi.ServerResponse{
  3262  			Header:         res.Header,
  3263  			HTTPStatusCode: res.StatusCode,
  3264  		},
  3265  	}
  3266  	target := &ret
  3267  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3268  		return nil, err
  3269  	}
  3270  	return ret, nil
  3271  }
  3272  
  3273  type ProjectsSchemasSetIamPolicyCall struct {
  3274  	s                   *Service
  3275  	resource            string
  3276  	setiampolicyrequest *SetIamPolicyRequest
  3277  	urlParams_          gensupport.URLParams
  3278  	ctx_                context.Context
  3279  	header_             http.Header
  3280  }
  3281  
  3282  // SetIamPolicy: Sets the access control policy on the specified resource.
  3283  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  3284  // and `PERMISSION_DENIED` errors.
  3285  //
  3286  //   - resource: REQUIRED: The resource for which the policy is being specified.
  3287  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3288  //     for the appropriate value for this field.
  3289  func (r *ProjectsSchemasService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSchemasSetIamPolicyCall {
  3290  	c := &ProjectsSchemasSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3291  	c.resource = resource
  3292  	c.setiampolicyrequest = setiampolicyrequest
  3293  	return c
  3294  }
  3295  
  3296  // Fields allows partial responses to be retrieved. See
  3297  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3298  // details.
  3299  func (c *ProjectsSchemasSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSchemasSetIamPolicyCall {
  3300  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3301  	return c
  3302  }
  3303  
  3304  // Context sets the context to be used in this call's Do method.
  3305  func (c *ProjectsSchemasSetIamPolicyCall) Context(ctx context.Context) *ProjectsSchemasSetIamPolicyCall {
  3306  	c.ctx_ = ctx
  3307  	return c
  3308  }
  3309  
  3310  // Header returns a http.Header that can be modified by the caller to add
  3311  // headers to the request.
  3312  func (c *ProjectsSchemasSetIamPolicyCall) Header() http.Header {
  3313  	if c.header_ == nil {
  3314  		c.header_ = make(http.Header)
  3315  	}
  3316  	return c.header_
  3317  }
  3318  
  3319  func (c *ProjectsSchemasSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3320  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3321  	var body io.Reader = nil
  3322  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3323  	if err != nil {
  3324  		return nil, err
  3325  	}
  3326  	c.urlParams_.Set("alt", alt)
  3327  	c.urlParams_.Set("prettyPrint", "false")
  3328  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  3329  	urls += "?" + c.urlParams_.Encode()
  3330  	req, err := http.NewRequest("POST", urls, body)
  3331  	if err != nil {
  3332  		return nil, err
  3333  	}
  3334  	req.Header = reqHeaders
  3335  	googleapi.Expand(req.URL, map[string]string{
  3336  		"resource": c.resource,
  3337  	})
  3338  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3339  }
  3340  
  3341  // Do executes the "pubsub.projects.schemas.setIamPolicy" call.
  3342  // Any non-2xx status code is an error. Response headers are in either
  3343  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3344  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3345  // whether the returned error was because http.StatusNotModified was returned.
  3346  func (c *ProjectsSchemasSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3347  	gensupport.SetOptions(c.urlParams_, opts...)
  3348  	res, err := c.doRequest("json")
  3349  	if res != nil && res.StatusCode == http.StatusNotModified {
  3350  		if res.Body != nil {
  3351  			res.Body.Close()
  3352  		}
  3353  		return nil, gensupport.WrapError(&googleapi.Error{
  3354  			Code:   res.StatusCode,
  3355  			Header: res.Header,
  3356  		})
  3357  	}
  3358  	if err != nil {
  3359  		return nil, err
  3360  	}
  3361  	defer googleapi.CloseBody(res)
  3362  	if err := googleapi.CheckResponse(res); err != nil {
  3363  		return nil, gensupport.WrapError(err)
  3364  	}
  3365  	ret := &Policy{
  3366  		ServerResponse: googleapi.ServerResponse{
  3367  			Header:         res.Header,
  3368  			HTTPStatusCode: res.StatusCode,
  3369  		},
  3370  	}
  3371  	target := &ret
  3372  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3373  		return nil, err
  3374  	}
  3375  	return ret, nil
  3376  }
  3377  
  3378  type ProjectsSchemasTestIamPermissionsCall struct {
  3379  	s                         *Service
  3380  	resource                  string
  3381  	testiampermissionsrequest *TestIamPermissionsRequest
  3382  	urlParams_                gensupport.URLParams
  3383  	ctx_                      context.Context
  3384  	header_                   http.Header
  3385  }
  3386  
  3387  // TestIamPermissions: Returns permissions that a caller has on the specified
  3388  // resource. If the resource does not exist, this will return an empty set of
  3389  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  3390  // used for building permission-aware UIs and command-line tools, not for
  3391  // authorization checking. This operation may "fail open" without warning.
  3392  //
  3393  //   - resource: REQUIRED: The resource for which the policy detail is being
  3394  //     requested. See Resource names
  3395  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  3396  //     value for this field.
  3397  func (r *ProjectsSchemasService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSchemasTestIamPermissionsCall {
  3398  	c := &ProjectsSchemasTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3399  	c.resource = resource
  3400  	c.testiampermissionsrequest = testiampermissionsrequest
  3401  	return c
  3402  }
  3403  
  3404  // Fields allows partial responses to be retrieved. See
  3405  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3406  // details.
  3407  func (c *ProjectsSchemasTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSchemasTestIamPermissionsCall {
  3408  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3409  	return c
  3410  }
  3411  
  3412  // Context sets the context to be used in this call's Do method.
  3413  func (c *ProjectsSchemasTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSchemasTestIamPermissionsCall {
  3414  	c.ctx_ = ctx
  3415  	return c
  3416  }
  3417  
  3418  // Header returns a http.Header that can be modified by the caller to add
  3419  // headers to the request.
  3420  func (c *ProjectsSchemasTestIamPermissionsCall) Header() http.Header {
  3421  	if c.header_ == nil {
  3422  		c.header_ = make(http.Header)
  3423  	}
  3424  	return c.header_
  3425  }
  3426  
  3427  func (c *ProjectsSchemasTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3428  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3429  	var body io.Reader = nil
  3430  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3431  	if err != nil {
  3432  		return nil, err
  3433  	}
  3434  	c.urlParams_.Set("alt", alt)
  3435  	c.urlParams_.Set("prettyPrint", "false")
  3436  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  3437  	urls += "?" + c.urlParams_.Encode()
  3438  	req, err := http.NewRequest("POST", urls, body)
  3439  	if err != nil {
  3440  		return nil, err
  3441  	}
  3442  	req.Header = reqHeaders
  3443  	googleapi.Expand(req.URL, map[string]string{
  3444  		"resource": c.resource,
  3445  	})
  3446  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3447  }
  3448  
  3449  // Do executes the "pubsub.projects.schemas.testIamPermissions" call.
  3450  // Any non-2xx status code is an error. Response headers are in either
  3451  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  3452  // returned at all) in error.(*googleapi.Error).Header. Use
  3453  // googleapi.IsNotModified to check whether the returned error was because
  3454  // http.StatusNotModified was returned.
  3455  func (c *ProjectsSchemasTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3456  	gensupport.SetOptions(c.urlParams_, opts...)
  3457  	res, err := c.doRequest("json")
  3458  	if res != nil && res.StatusCode == http.StatusNotModified {
  3459  		if res.Body != nil {
  3460  			res.Body.Close()
  3461  		}
  3462  		return nil, gensupport.WrapError(&googleapi.Error{
  3463  			Code:   res.StatusCode,
  3464  			Header: res.Header,
  3465  		})
  3466  	}
  3467  	if err != nil {
  3468  		return nil, err
  3469  	}
  3470  	defer googleapi.CloseBody(res)
  3471  	if err := googleapi.CheckResponse(res); err != nil {
  3472  		return nil, gensupport.WrapError(err)
  3473  	}
  3474  	ret := &TestIamPermissionsResponse{
  3475  		ServerResponse: googleapi.ServerResponse{
  3476  			Header:         res.Header,
  3477  			HTTPStatusCode: res.StatusCode,
  3478  		},
  3479  	}
  3480  	target := &ret
  3481  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3482  		return nil, err
  3483  	}
  3484  	return ret, nil
  3485  }
  3486  
  3487  type ProjectsSchemasValidateCall struct {
  3488  	s                     *Service
  3489  	parent                string
  3490  	validateschemarequest *ValidateSchemaRequest
  3491  	urlParams_            gensupport.URLParams
  3492  	ctx_                  context.Context
  3493  	header_               http.Header
  3494  }
  3495  
  3496  // Validate: Validates a schema.
  3497  //
  3498  //   - parent: The name of the project in which to validate schemas. Format is
  3499  //     `projects/{project-id}`.
  3500  func (r *ProjectsSchemasService) Validate(parent string, validateschemarequest *ValidateSchemaRequest) *ProjectsSchemasValidateCall {
  3501  	c := &ProjectsSchemasValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3502  	c.parent = parent
  3503  	c.validateschemarequest = validateschemarequest
  3504  	return c
  3505  }
  3506  
  3507  // Fields allows partial responses to be retrieved. See
  3508  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3509  // details.
  3510  func (c *ProjectsSchemasValidateCall) Fields(s ...googleapi.Field) *ProjectsSchemasValidateCall {
  3511  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3512  	return c
  3513  }
  3514  
  3515  // Context sets the context to be used in this call's Do method.
  3516  func (c *ProjectsSchemasValidateCall) Context(ctx context.Context) *ProjectsSchemasValidateCall {
  3517  	c.ctx_ = ctx
  3518  	return c
  3519  }
  3520  
  3521  // Header returns a http.Header that can be modified by the caller to add
  3522  // headers to the request.
  3523  func (c *ProjectsSchemasValidateCall) Header() http.Header {
  3524  	if c.header_ == nil {
  3525  		c.header_ = make(http.Header)
  3526  	}
  3527  	return c.header_
  3528  }
  3529  
  3530  func (c *ProjectsSchemasValidateCall) doRequest(alt string) (*http.Response, error) {
  3531  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3532  	var body io.Reader = nil
  3533  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateschemarequest)
  3534  	if err != nil {
  3535  		return nil, err
  3536  	}
  3537  	c.urlParams_.Set("alt", alt)
  3538  	c.urlParams_.Set("prettyPrint", "false")
  3539  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schemas:validate")
  3540  	urls += "?" + c.urlParams_.Encode()
  3541  	req, err := http.NewRequest("POST", urls, body)
  3542  	if err != nil {
  3543  		return nil, err
  3544  	}
  3545  	req.Header = reqHeaders
  3546  	googleapi.Expand(req.URL, map[string]string{
  3547  		"parent": c.parent,
  3548  	})
  3549  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3550  }
  3551  
  3552  // Do executes the "pubsub.projects.schemas.validate" call.
  3553  // Any non-2xx status code is an error. Response headers are in either
  3554  // *ValidateSchemaResponse.ServerResponse.Header or (if a response was returned
  3555  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3556  // check whether the returned error was because http.StatusNotModified was
  3557  // returned.
  3558  func (c *ProjectsSchemasValidateCall) Do(opts ...googleapi.CallOption) (*ValidateSchemaResponse, error) {
  3559  	gensupport.SetOptions(c.urlParams_, opts...)
  3560  	res, err := c.doRequest("json")
  3561  	if res != nil && res.StatusCode == http.StatusNotModified {
  3562  		if res.Body != nil {
  3563  			res.Body.Close()
  3564  		}
  3565  		return nil, gensupport.WrapError(&googleapi.Error{
  3566  			Code:   res.StatusCode,
  3567  			Header: res.Header,
  3568  		})
  3569  	}
  3570  	if err != nil {
  3571  		return nil, err
  3572  	}
  3573  	defer googleapi.CloseBody(res)
  3574  	if err := googleapi.CheckResponse(res); err != nil {
  3575  		return nil, gensupport.WrapError(err)
  3576  	}
  3577  	ret := &ValidateSchemaResponse{
  3578  		ServerResponse: googleapi.ServerResponse{
  3579  			Header:         res.Header,
  3580  			HTTPStatusCode: res.StatusCode,
  3581  		},
  3582  	}
  3583  	target := &ret
  3584  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3585  		return nil, err
  3586  	}
  3587  	return ret, nil
  3588  }
  3589  
  3590  type ProjectsSchemasValidateMessageCall struct {
  3591  	s                      *Service
  3592  	parent                 string
  3593  	validatemessagerequest *ValidateMessageRequest
  3594  	urlParams_             gensupport.URLParams
  3595  	ctx_                   context.Context
  3596  	header_                http.Header
  3597  }
  3598  
  3599  // ValidateMessage: Validates a message against a schema.
  3600  //
  3601  //   - parent: The name of the project in which to validate schemas. Format is
  3602  //     `projects/{project-id}`.
  3603  func (r *ProjectsSchemasService) ValidateMessage(parent string, validatemessagerequest *ValidateMessageRequest) *ProjectsSchemasValidateMessageCall {
  3604  	c := &ProjectsSchemasValidateMessageCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3605  	c.parent = parent
  3606  	c.validatemessagerequest = validatemessagerequest
  3607  	return c
  3608  }
  3609  
  3610  // Fields allows partial responses to be retrieved. See
  3611  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3612  // details.
  3613  func (c *ProjectsSchemasValidateMessageCall) Fields(s ...googleapi.Field) *ProjectsSchemasValidateMessageCall {
  3614  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3615  	return c
  3616  }
  3617  
  3618  // Context sets the context to be used in this call's Do method.
  3619  func (c *ProjectsSchemasValidateMessageCall) Context(ctx context.Context) *ProjectsSchemasValidateMessageCall {
  3620  	c.ctx_ = ctx
  3621  	return c
  3622  }
  3623  
  3624  // Header returns a http.Header that can be modified by the caller to add
  3625  // headers to the request.
  3626  func (c *ProjectsSchemasValidateMessageCall) Header() http.Header {
  3627  	if c.header_ == nil {
  3628  		c.header_ = make(http.Header)
  3629  	}
  3630  	return c.header_
  3631  }
  3632  
  3633  func (c *ProjectsSchemasValidateMessageCall) doRequest(alt string) (*http.Response, error) {
  3634  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3635  	var body io.Reader = nil
  3636  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.validatemessagerequest)
  3637  	if err != nil {
  3638  		return nil, err
  3639  	}
  3640  	c.urlParams_.Set("alt", alt)
  3641  	c.urlParams_.Set("prettyPrint", "false")
  3642  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/schemas:validateMessage")
  3643  	urls += "?" + c.urlParams_.Encode()
  3644  	req, err := http.NewRequest("POST", urls, body)
  3645  	if err != nil {
  3646  		return nil, err
  3647  	}
  3648  	req.Header = reqHeaders
  3649  	googleapi.Expand(req.URL, map[string]string{
  3650  		"parent": c.parent,
  3651  	})
  3652  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3653  }
  3654  
  3655  // Do executes the "pubsub.projects.schemas.validateMessage" call.
  3656  // Any non-2xx status code is an error. Response headers are in either
  3657  // *ValidateMessageResponse.ServerResponse.Header or (if a response was
  3658  // returned at all) in error.(*googleapi.Error).Header. Use
  3659  // googleapi.IsNotModified to check whether the returned error was because
  3660  // http.StatusNotModified was returned.
  3661  func (c *ProjectsSchemasValidateMessageCall) Do(opts ...googleapi.CallOption) (*ValidateMessageResponse, error) {
  3662  	gensupport.SetOptions(c.urlParams_, opts...)
  3663  	res, err := c.doRequest("json")
  3664  	if res != nil && res.StatusCode == http.StatusNotModified {
  3665  		if res.Body != nil {
  3666  			res.Body.Close()
  3667  		}
  3668  		return nil, gensupport.WrapError(&googleapi.Error{
  3669  			Code:   res.StatusCode,
  3670  			Header: res.Header,
  3671  		})
  3672  	}
  3673  	if err != nil {
  3674  		return nil, err
  3675  	}
  3676  	defer googleapi.CloseBody(res)
  3677  	if err := googleapi.CheckResponse(res); err != nil {
  3678  		return nil, gensupport.WrapError(err)
  3679  	}
  3680  	ret := &ValidateMessageResponse{
  3681  		ServerResponse: googleapi.ServerResponse{
  3682  			Header:         res.Header,
  3683  			HTTPStatusCode: res.StatusCode,
  3684  		},
  3685  	}
  3686  	target := &ret
  3687  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3688  		return nil, err
  3689  	}
  3690  	return ret, nil
  3691  }
  3692  
  3693  type ProjectsSnapshotsCreateCall struct {
  3694  	s                     *Service
  3695  	name                  string
  3696  	createsnapshotrequest *CreateSnapshotRequest
  3697  	urlParams_            gensupport.URLParams
  3698  	ctx_                  context.Context
  3699  	header_               http.Header
  3700  }
  3701  
  3702  // Create: Creates a snapshot from the requested subscription. Snapshots are
  3703  // used in Seek (https://cloud.google.com/pubsub/docs/replay-overview)
  3704  // operations, which allow you to manage message acknowledgments in bulk. That
  3705  // is, you can set the acknowledgment state of messages in an existing
  3706  // subscription to the state captured by a snapshot. If the snapshot already
  3707  // exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't
  3708  // exist, returns `NOT_FOUND`. If the backlog in the subscription is too old --
  3709  // and the resulting snapshot would expire in less than 1 hour -- then
  3710  // `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time`
  3711  // field. If the name is not provided in the request, the server will assign a
  3712  // random name for this snapshot on the same project as the subscription,
  3713  // conforming to the [resource name format]
  3714  // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
  3715  // generated name is populated in the returned Snapshot object. Note that for
  3716  // REST API requests, you must specify a name in the request.
  3717  //
  3718  //   - name: User-provided name for this snapshot. If the name is not provided in
  3719  //     the request, the server will assign a random name for this snapshot on the
  3720  //     same project as the subscription. Note that for REST API requests, you
  3721  //     must specify a name. See the resource name rules
  3722  //     (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
  3723  //     Format is `projects/{project}/snapshots/{snap}`.
  3724  func (r *ProjectsSnapshotsService) Create(name string, createsnapshotrequest *CreateSnapshotRequest) *ProjectsSnapshotsCreateCall {
  3725  	c := &ProjectsSnapshotsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3726  	c.name = name
  3727  	c.createsnapshotrequest = createsnapshotrequest
  3728  	return c
  3729  }
  3730  
  3731  // Fields allows partial responses to be retrieved. See
  3732  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3733  // details.
  3734  func (c *ProjectsSnapshotsCreateCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsCreateCall {
  3735  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3736  	return c
  3737  }
  3738  
  3739  // Context sets the context to be used in this call's Do method.
  3740  func (c *ProjectsSnapshotsCreateCall) Context(ctx context.Context) *ProjectsSnapshotsCreateCall {
  3741  	c.ctx_ = ctx
  3742  	return c
  3743  }
  3744  
  3745  // Header returns a http.Header that can be modified by the caller to add
  3746  // headers to the request.
  3747  func (c *ProjectsSnapshotsCreateCall) Header() http.Header {
  3748  	if c.header_ == nil {
  3749  		c.header_ = make(http.Header)
  3750  	}
  3751  	return c.header_
  3752  }
  3753  
  3754  func (c *ProjectsSnapshotsCreateCall) doRequest(alt string) (*http.Response, error) {
  3755  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3756  	var body io.Reader = nil
  3757  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.createsnapshotrequest)
  3758  	if err != nil {
  3759  		return nil, err
  3760  	}
  3761  	c.urlParams_.Set("alt", alt)
  3762  	c.urlParams_.Set("prettyPrint", "false")
  3763  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3764  	urls += "?" + c.urlParams_.Encode()
  3765  	req, err := http.NewRequest("PUT", urls, body)
  3766  	if err != nil {
  3767  		return nil, err
  3768  	}
  3769  	req.Header = reqHeaders
  3770  	googleapi.Expand(req.URL, map[string]string{
  3771  		"name": c.name,
  3772  	})
  3773  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3774  }
  3775  
  3776  // Do executes the "pubsub.projects.snapshots.create" call.
  3777  // Any non-2xx status code is an error. Response headers are in either
  3778  // *Snapshot.ServerResponse.Header or (if a response was returned at all) in
  3779  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3780  // whether the returned error was because http.StatusNotModified was returned.
  3781  func (c *ProjectsSnapshotsCreateCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  3782  	gensupport.SetOptions(c.urlParams_, opts...)
  3783  	res, err := c.doRequest("json")
  3784  	if res != nil && res.StatusCode == http.StatusNotModified {
  3785  		if res.Body != nil {
  3786  			res.Body.Close()
  3787  		}
  3788  		return nil, gensupport.WrapError(&googleapi.Error{
  3789  			Code:   res.StatusCode,
  3790  			Header: res.Header,
  3791  		})
  3792  	}
  3793  	if err != nil {
  3794  		return nil, err
  3795  	}
  3796  	defer googleapi.CloseBody(res)
  3797  	if err := googleapi.CheckResponse(res); err != nil {
  3798  		return nil, gensupport.WrapError(err)
  3799  	}
  3800  	ret := &Snapshot{
  3801  		ServerResponse: googleapi.ServerResponse{
  3802  			Header:         res.Header,
  3803  			HTTPStatusCode: res.StatusCode,
  3804  		},
  3805  	}
  3806  	target := &ret
  3807  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3808  		return nil, err
  3809  	}
  3810  	return ret, nil
  3811  }
  3812  
  3813  type ProjectsSnapshotsDeleteCall struct {
  3814  	s          *Service
  3815  	snapshot   string
  3816  	urlParams_ gensupport.URLParams
  3817  	ctx_       context.Context
  3818  	header_    http.Header
  3819  }
  3820  
  3821  // Delete: Removes an existing snapshot. Snapshots are used in [Seek]
  3822  // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
  3823  // allow you to manage message acknowledgments in bulk. That is, you can set
  3824  // the acknowledgment state of messages in an existing subscription to the
  3825  // state captured by a snapshot. When the snapshot is deleted, all messages
  3826  // retained in the snapshot are immediately dropped. After a snapshot is
  3827  // deleted, a new one may be created with the same name, but the new one has no
  3828  // association with the old snapshot or its subscription, unless the same
  3829  // subscription is specified.
  3830  //
  3831  //   - snapshot: The name of the snapshot to delete. Format is
  3832  //     `projects/{project}/snapshots/{snap}`.
  3833  func (r *ProjectsSnapshotsService) Delete(snapshot string) *ProjectsSnapshotsDeleteCall {
  3834  	c := &ProjectsSnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3835  	c.snapshot = snapshot
  3836  	return c
  3837  }
  3838  
  3839  // Fields allows partial responses to be retrieved. See
  3840  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3841  // details.
  3842  func (c *ProjectsSnapshotsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsDeleteCall {
  3843  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3844  	return c
  3845  }
  3846  
  3847  // Context sets the context to be used in this call's Do method.
  3848  func (c *ProjectsSnapshotsDeleteCall) Context(ctx context.Context) *ProjectsSnapshotsDeleteCall {
  3849  	c.ctx_ = ctx
  3850  	return c
  3851  }
  3852  
  3853  // Header returns a http.Header that can be modified by the caller to add
  3854  // headers to the request.
  3855  func (c *ProjectsSnapshotsDeleteCall) Header() http.Header {
  3856  	if c.header_ == nil {
  3857  		c.header_ = make(http.Header)
  3858  	}
  3859  	return c.header_
  3860  }
  3861  
  3862  func (c *ProjectsSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3863  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3864  	var body io.Reader = nil
  3865  	c.urlParams_.Set("alt", alt)
  3866  	c.urlParams_.Set("prettyPrint", "false")
  3867  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+snapshot}")
  3868  	urls += "?" + c.urlParams_.Encode()
  3869  	req, err := http.NewRequest("DELETE", urls, body)
  3870  	if err != nil {
  3871  		return nil, err
  3872  	}
  3873  	req.Header = reqHeaders
  3874  	googleapi.Expand(req.URL, map[string]string{
  3875  		"snapshot": c.snapshot,
  3876  	})
  3877  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3878  }
  3879  
  3880  // Do executes the "pubsub.projects.snapshots.delete" call.
  3881  // Any non-2xx status code is an error. Response headers are in either
  3882  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3883  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3884  // whether the returned error was because http.StatusNotModified was returned.
  3885  func (c *ProjectsSnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3886  	gensupport.SetOptions(c.urlParams_, opts...)
  3887  	res, err := c.doRequest("json")
  3888  	if res != nil && res.StatusCode == http.StatusNotModified {
  3889  		if res.Body != nil {
  3890  			res.Body.Close()
  3891  		}
  3892  		return nil, gensupport.WrapError(&googleapi.Error{
  3893  			Code:   res.StatusCode,
  3894  			Header: res.Header,
  3895  		})
  3896  	}
  3897  	if err != nil {
  3898  		return nil, err
  3899  	}
  3900  	defer googleapi.CloseBody(res)
  3901  	if err := googleapi.CheckResponse(res); err != nil {
  3902  		return nil, gensupport.WrapError(err)
  3903  	}
  3904  	ret := &Empty{
  3905  		ServerResponse: googleapi.ServerResponse{
  3906  			Header:         res.Header,
  3907  			HTTPStatusCode: res.StatusCode,
  3908  		},
  3909  	}
  3910  	target := &ret
  3911  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3912  		return nil, err
  3913  	}
  3914  	return ret, nil
  3915  }
  3916  
  3917  type ProjectsSnapshotsGetCall struct {
  3918  	s            *Service
  3919  	snapshot     string
  3920  	urlParams_   gensupport.URLParams
  3921  	ifNoneMatch_ string
  3922  	ctx_         context.Context
  3923  	header_      http.Header
  3924  }
  3925  
  3926  // Get: Gets the configuration details of a snapshot. Snapshots are used in
  3927  // Seek (https://cloud.google.com/pubsub/docs/replay-overview) operations,
  3928  // which allow you to manage message acknowledgments in bulk. That is, you can
  3929  // set the acknowledgment state of messages in an existing subscription to the
  3930  // state captured by a snapshot.
  3931  //
  3932  //   - snapshot: The name of the snapshot to get. Format is
  3933  //     `projects/{project}/snapshots/{snap}`.
  3934  func (r *ProjectsSnapshotsService) Get(snapshot string) *ProjectsSnapshotsGetCall {
  3935  	c := &ProjectsSnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3936  	c.snapshot = snapshot
  3937  	return c
  3938  }
  3939  
  3940  // Fields allows partial responses to be retrieved. See
  3941  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3942  // details.
  3943  func (c *ProjectsSnapshotsGetCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsGetCall {
  3944  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3945  	return c
  3946  }
  3947  
  3948  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3949  // object's ETag matches the given value. This is useful for getting updates
  3950  // only after the object has changed since the last request.
  3951  func (c *ProjectsSnapshotsGetCall) IfNoneMatch(entityTag string) *ProjectsSnapshotsGetCall {
  3952  	c.ifNoneMatch_ = entityTag
  3953  	return c
  3954  }
  3955  
  3956  // Context sets the context to be used in this call's Do method.
  3957  func (c *ProjectsSnapshotsGetCall) Context(ctx context.Context) *ProjectsSnapshotsGetCall {
  3958  	c.ctx_ = ctx
  3959  	return c
  3960  }
  3961  
  3962  // Header returns a http.Header that can be modified by the caller to add
  3963  // headers to the request.
  3964  func (c *ProjectsSnapshotsGetCall) Header() http.Header {
  3965  	if c.header_ == nil {
  3966  		c.header_ = make(http.Header)
  3967  	}
  3968  	return c.header_
  3969  }
  3970  
  3971  func (c *ProjectsSnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  3972  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3973  	if c.ifNoneMatch_ != "" {
  3974  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3975  	}
  3976  	var body io.Reader = nil
  3977  	c.urlParams_.Set("alt", alt)
  3978  	c.urlParams_.Set("prettyPrint", "false")
  3979  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+snapshot}")
  3980  	urls += "?" + c.urlParams_.Encode()
  3981  	req, err := http.NewRequest("GET", urls, body)
  3982  	if err != nil {
  3983  		return nil, err
  3984  	}
  3985  	req.Header = reqHeaders
  3986  	googleapi.Expand(req.URL, map[string]string{
  3987  		"snapshot": c.snapshot,
  3988  	})
  3989  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3990  }
  3991  
  3992  // Do executes the "pubsub.projects.snapshots.get" call.
  3993  // Any non-2xx status code is an error. Response headers are in either
  3994  // *Snapshot.ServerResponse.Header or (if a response was returned at all) in
  3995  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3996  // whether the returned error was because http.StatusNotModified was returned.
  3997  func (c *ProjectsSnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  3998  	gensupport.SetOptions(c.urlParams_, opts...)
  3999  	res, err := c.doRequest("json")
  4000  	if res != nil && res.StatusCode == http.StatusNotModified {
  4001  		if res.Body != nil {
  4002  			res.Body.Close()
  4003  		}
  4004  		return nil, gensupport.WrapError(&googleapi.Error{
  4005  			Code:   res.StatusCode,
  4006  			Header: res.Header,
  4007  		})
  4008  	}
  4009  	if err != nil {
  4010  		return nil, err
  4011  	}
  4012  	defer googleapi.CloseBody(res)
  4013  	if err := googleapi.CheckResponse(res); err != nil {
  4014  		return nil, gensupport.WrapError(err)
  4015  	}
  4016  	ret := &Snapshot{
  4017  		ServerResponse: googleapi.ServerResponse{
  4018  			Header:         res.Header,
  4019  			HTTPStatusCode: res.StatusCode,
  4020  		},
  4021  	}
  4022  	target := &ret
  4023  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4024  		return nil, err
  4025  	}
  4026  	return ret, nil
  4027  }
  4028  
  4029  type ProjectsSnapshotsGetIamPolicyCall struct {
  4030  	s            *Service
  4031  	resource     string
  4032  	urlParams_   gensupport.URLParams
  4033  	ifNoneMatch_ string
  4034  	ctx_         context.Context
  4035  	header_      http.Header
  4036  }
  4037  
  4038  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  4039  // empty policy if the resource exists and does not have a policy set.
  4040  //
  4041  //   - resource: REQUIRED: The resource for which the policy is being requested.
  4042  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  4043  //     for the appropriate value for this field.
  4044  func (r *ProjectsSnapshotsService) GetIamPolicy(resource string) *ProjectsSnapshotsGetIamPolicyCall {
  4045  	c := &ProjectsSnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4046  	c.resource = resource
  4047  	return c
  4048  }
  4049  
  4050  // OptionsRequestedPolicyVersion sets the optional parameter
  4051  // "options.requestedPolicyVersion": The maximum policy version that will be
  4052  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  4053  // an invalid value will be rejected. Requests for policies with any
  4054  // conditional role bindings must specify version 3. Policies with no
  4055  // conditional role bindings may specify any valid value or leave the field
  4056  // unset. The policy in the response might use the policy version that you
  4057  // specified, or it might use a lower policy version. For example, if you
  4058  // specify version 3, but the policy has no conditional role bindings, the
  4059  // response uses version 1. To learn which resources support conditions in
  4060  // their IAM policies, see the IAM documentation
  4061  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  4062  func (c *ProjectsSnapshotsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsSnapshotsGetIamPolicyCall {
  4063  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  4064  	return c
  4065  }
  4066  
  4067  // Fields allows partial responses to be retrieved. See
  4068  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4069  // details.
  4070  func (c *ProjectsSnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsGetIamPolicyCall {
  4071  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4072  	return c
  4073  }
  4074  
  4075  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4076  // object's ETag matches the given value. This is useful for getting updates
  4077  // only after the object has changed since the last request.
  4078  func (c *ProjectsSnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSnapshotsGetIamPolicyCall {
  4079  	c.ifNoneMatch_ = entityTag
  4080  	return c
  4081  }
  4082  
  4083  // Context sets the context to be used in this call's Do method.
  4084  func (c *ProjectsSnapshotsGetIamPolicyCall) Context(ctx context.Context) *ProjectsSnapshotsGetIamPolicyCall {
  4085  	c.ctx_ = ctx
  4086  	return c
  4087  }
  4088  
  4089  // Header returns a http.Header that can be modified by the caller to add
  4090  // headers to the request.
  4091  func (c *ProjectsSnapshotsGetIamPolicyCall) Header() http.Header {
  4092  	if c.header_ == nil {
  4093  		c.header_ = make(http.Header)
  4094  	}
  4095  	return c.header_
  4096  }
  4097  
  4098  func (c *ProjectsSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4099  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4100  	if c.ifNoneMatch_ != "" {
  4101  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4102  	}
  4103  	var body io.Reader = nil
  4104  	c.urlParams_.Set("alt", alt)
  4105  	c.urlParams_.Set("prettyPrint", "false")
  4106  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  4107  	urls += "?" + c.urlParams_.Encode()
  4108  	req, err := http.NewRequest("GET", urls, body)
  4109  	if err != nil {
  4110  		return nil, err
  4111  	}
  4112  	req.Header = reqHeaders
  4113  	googleapi.Expand(req.URL, map[string]string{
  4114  		"resource": c.resource,
  4115  	})
  4116  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4117  }
  4118  
  4119  // Do executes the "pubsub.projects.snapshots.getIamPolicy" call.
  4120  // Any non-2xx status code is an error. Response headers are in either
  4121  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  4122  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4123  // whether the returned error was because http.StatusNotModified was returned.
  4124  func (c *ProjectsSnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4125  	gensupport.SetOptions(c.urlParams_, opts...)
  4126  	res, err := c.doRequest("json")
  4127  	if res != nil && res.StatusCode == http.StatusNotModified {
  4128  		if res.Body != nil {
  4129  			res.Body.Close()
  4130  		}
  4131  		return nil, gensupport.WrapError(&googleapi.Error{
  4132  			Code:   res.StatusCode,
  4133  			Header: res.Header,
  4134  		})
  4135  	}
  4136  	if err != nil {
  4137  		return nil, err
  4138  	}
  4139  	defer googleapi.CloseBody(res)
  4140  	if err := googleapi.CheckResponse(res); err != nil {
  4141  		return nil, gensupport.WrapError(err)
  4142  	}
  4143  	ret := &Policy{
  4144  		ServerResponse: googleapi.ServerResponse{
  4145  			Header:         res.Header,
  4146  			HTTPStatusCode: res.StatusCode,
  4147  		},
  4148  	}
  4149  	target := &ret
  4150  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4151  		return nil, err
  4152  	}
  4153  	return ret, nil
  4154  }
  4155  
  4156  type ProjectsSnapshotsListCall struct {
  4157  	s            *Service
  4158  	project      string
  4159  	urlParams_   gensupport.URLParams
  4160  	ifNoneMatch_ string
  4161  	ctx_         context.Context
  4162  	header_      http.Header
  4163  }
  4164  
  4165  // List: Lists the existing snapshots. Snapshots are used in Seek (
  4166  // https://cloud.google.com/pubsub/docs/replay-overview) operations, which
  4167  // allow you to manage message acknowledgments in bulk. That is, you can set
  4168  // the acknowledgment state of messages in an existing subscription to the
  4169  // state captured by a snapshot.
  4170  //
  4171  //   - project: The name of the project in which to list snapshots. Format is
  4172  //     `projects/{project-id}`.
  4173  func (r *ProjectsSnapshotsService) List(project string) *ProjectsSnapshotsListCall {
  4174  	c := &ProjectsSnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4175  	c.project = project
  4176  	return c
  4177  }
  4178  
  4179  // PageSize sets the optional parameter "pageSize": Maximum number of snapshots
  4180  // to return.
  4181  func (c *ProjectsSnapshotsListCall) PageSize(pageSize int64) *ProjectsSnapshotsListCall {
  4182  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4183  	return c
  4184  }
  4185  
  4186  // PageToken sets the optional parameter "pageToken": The value returned by the
  4187  // last `ListSnapshotsResponse`; indicates that this is a continuation of a
  4188  // prior `ListSnapshots` call, and that the system should return the next page
  4189  // of data.
  4190  func (c *ProjectsSnapshotsListCall) PageToken(pageToken string) *ProjectsSnapshotsListCall {
  4191  	c.urlParams_.Set("pageToken", pageToken)
  4192  	return c
  4193  }
  4194  
  4195  // Fields allows partial responses to be retrieved. See
  4196  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4197  // details.
  4198  func (c *ProjectsSnapshotsListCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsListCall {
  4199  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4200  	return c
  4201  }
  4202  
  4203  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4204  // object's ETag matches the given value. This is useful for getting updates
  4205  // only after the object has changed since the last request.
  4206  func (c *ProjectsSnapshotsListCall) IfNoneMatch(entityTag string) *ProjectsSnapshotsListCall {
  4207  	c.ifNoneMatch_ = entityTag
  4208  	return c
  4209  }
  4210  
  4211  // Context sets the context to be used in this call's Do method.
  4212  func (c *ProjectsSnapshotsListCall) Context(ctx context.Context) *ProjectsSnapshotsListCall {
  4213  	c.ctx_ = ctx
  4214  	return c
  4215  }
  4216  
  4217  // Header returns a http.Header that can be modified by the caller to add
  4218  // headers to the request.
  4219  func (c *ProjectsSnapshotsListCall) Header() http.Header {
  4220  	if c.header_ == nil {
  4221  		c.header_ = make(http.Header)
  4222  	}
  4223  	return c.header_
  4224  }
  4225  
  4226  func (c *ProjectsSnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  4227  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4228  	if c.ifNoneMatch_ != "" {
  4229  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4230  	}
  4231  	var body io.Reader = nil
  4232  	c.urlParams_.Set("alt", alt)
  4233  	c.urlParams_.Set("prettyPrint", "false")
  4234  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/snapshots")
  4235  	urls += "?" + c.urlParams_.Encode()
  4236  	req, err := http.NewRequest("GET", urls, body)
  4237  	if err != nil {
  4238  		return nil, err
  4239  	}
  4240  	req.Header = reqHeaders
  4241  	googleapi.Expand(req.URL, map[string]string{
  4242  		"project": c.project,
  4243  	})
  4244  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4245  }
  4246  
  4247  // Do executes the "pubsub.projects.snapshots.list" call.
  4248  // Any non-2xx status code is an error. Response headers are in either
  4249  // *ListSnapshotsResponse.ServerResponse.Header or (if a response was returned
  4250  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4251  // check whether the returned error was because http.StatusNotModified was
  4252  // returned.
  4253  func (c *ProjectsSnapshotsListCall) Do(opts ...googleapi.CallOption) (*ListSnapshotsResponse, error) {
  4254  	gensupport.SetOptions(c.urlParams_, opts...)
  4255  	res, err := c.doRequest("json")
  4256  	if res != nil && res.StatusCode == http.StatusNotModified {
  4257  		if res.Body != nil {
  4258  			res.Body.Close()
  4259  		}
  4260  		return nil, gensupport.WrapError(&googleapi.Error{
  4261  			Code:   res.StatusCode,
  4262  			Header: res.Header,
  4263  		})
  4264  	}
  4265  	if err != nil {
  4266  		return nil, err
  4267  	}
  4268  	defer googleapi.CloseBody(res)
  4269  	if err := googleapi.CheckResponse(res); err != nil {
  4270  		return nil, gensupport.WrapError(err)
  4271  	}
  4272  	ret := &ListSnapshotsResponse{
  4273  		ServerResponse: googleapi.ServerResponse{
  4274  			Header:         res.Header,
  4275  			HTTPStatusCode: res.StatusCode,
  4276  		},
  4277  	}
  4278  	target := &ret
  4279  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4280  		return nil, err
  4281  	}
  4282  	return ret, nil
  4283  }
  4284  
  4285  // Pages invokes f for each page of results.
  4286  // A non-nil error returned from f will halt the iteration.
  4287  // The provided context supersedes any context provided to the Context method.
  4288  func (c *ProjectsSnapshotsListCall) Pages(ctx context.Context, f func(*ListSnapshotsResponse) error) error {
  4289  	c.ctx_ = ctx
  4290  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4291  	for {
  4292  		x, err := c.Do()
  4293  		if err != nil {
  4294  			return err
  4295  		}
  4296  		if err := f(x); err != nil {
  4297  			return err
  4298  		}
  4299  		if x.NextPageToken == "" {
  4300  			return nil
  4301  		}
  4302  		c.PageToken(x.NextPageToken)
  4303  	}
  4304  }
  4305  
  4306  type ProjectsSnapshotsPatchCall struct {
  4307  	s                     *Service
  4308  	name                  string
  4309  	updatesnapshotrequest *UpdateSnapshotRequest
  4310  	urlParams_            gensupport.URLParams
  4311  	ctx_                  context.Context
  4312  	header_               http.Header
  4313  }
  4314  
  4315  // Patch: Updates an existing snapshot by updating the fields specified in the
  4316  // update mask. Snapshots are used in Seek
  4317  // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
  4318  // allow you to manage message acknowledgments in bulk. That is, you can set
  4319  // the acknowledgment state of messages in an existing subscription to the
  4320  // state captured by a snapshot.
  4321  //
  4322  // - name: Optional. The name of the snapshot.
  4323  func (r *ProjectsSnapshotsService) Patch(name string, updatesnapshotrequest *UpdateSnapshotRequest) *ProjectsSnapshotsPatchCall {
  4324  	c := &ProjectsSnapshotsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4325  	c.name = name
  4326  	c.updatesnapshotrequest = updatesnapshotrequest
  4327  	return c
  4328  }
  4329  
  4330  // Fields allows partial responses to be retrieved. See
  4331  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4332  // details.
  4333  func (c *ProjectsSnapshotsPatchCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsPatchCall {
  4334  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4335  	return c
  4336  }
  4337  
  4338  // Context sets the context to be used in this call's Do method.
  4339  func (c *ProjectsSnapshotsPatchCall) Context(ctx context.Context) *ProjectsSnapshotsPatchCall {
  4340  	c.ctx_ = ctx
  4341  	return c
  4342  }
  4343  
  4344  // Header returns a http.Header that can be modified by the caller to add
  4345  // headers to the request.
  4346  func (c *ProjectsSnapshotsPatchCall) Header() http.Header {
  4347  	if c.header_ == nil {
  4348  		c.header_ = make(http.Header)
  4349  	}
  4350  	return c.header_
  4351  }
  4352  
  4353  func (c *ProjectsSnapshotsPatchCall) doRequest(alt string) (*http.Response, error) {
  4354  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4355  	var body io.Reader = nil
  4356  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatesnapshotrequest)
  4357  	if err != nil {
  4358  		return nil, err
  4359  	}
  4360  	c.urlParams_.Set("alt", alt)
  4361  	c.urlParams_.Set("prettyPrint", "false")
  4362  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4363  	urls += "?" + c.urlParams_.Encode()
  4364  	req, err := http.NewRequest("PATCH", urls, body)
  4365  	if err != nil {
  4366  		return nil, err
  4367  	}
  4368  	req.Header = reqHeaders
  4369  	googleapi.Expand(req.URL, map[string]string{
  4370  		"name": c.name,
  4371  	})
  4372  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4373  }
  4374  
  4375  // Do executes the "pubsub.projects.snapshots.patch" call.
  4376  // Any non-2xx status code is an error. Response headers are in either
  4377  // *Snapshot.ServerResponse.Header or (if a response was returned at all) in
  4378  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4379  // whether the returned error was because http.StatusNotModified was returned.
  4380  func (c *ProjectsSnapshotsPatchCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  4381  	gensupport.SetOptions(c.urlParams_, opts...)
  4382  	res, err := c.doRequest("json")
  4383  	if res != nil && res.StatusCode == http.StatusNotModified {
  4384  		if res.Body != nil {
  4385  			res.Body.Close()
  4386  		}
  4387  		return nil, gensupport.WrapError(&googleapi.Error{
  4388  			Code:   res.StatusCode,
  4389  			Header: res.Header,
  4390  		})
  4391  	}
  4392  	if err != nil {
  4393  		return nil, err
  4394  	}
  4395  	defer googleapi.CloseBody(res)
  4396  	if err := googleapi.CheckResponse(res); err != nil {
  4397  		return nil, gensupport.WrapError(err)
  4398  	}
  4399  	ret := &Snapshot{
  4400  		ServerResponse: googleapi.ServerResponse{
  4401  			Header:         res.Header,
  4402  			HTTPStatusCode: res.StatusCode,
  4403  		},
  4404  	}
  4405  	target := &ret
  4406  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4407  		return nil, err
  4408  	}
  4409  	return ret, nil
  4410  }
  4411  
  4412  type ProjectsSnapshotsSetIamPolicyCall struct {
  4413  	s                   *Service
  4414  	resource            string
  4415  	setiampolicyrequest *SetIamPolicyRequest
  4416  	urlParams_          gensupport.URLParams
  4417  	ctx_                context.Context
  4418  	header_             http.Header
  4419  }
  4420  
  4421  // SetIamPolicy: Sets the access control policy on the specified resource.
  4422  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  4423  // and `PERMISSION_DENIED` errors.
  4424  //
  4425  //   - resource: REQUIRED: The resource for which the policy is being specified.
  4426  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  4427  //     for the appropriate value for this field.
  4428  func (r *ProjectsSnapshotsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSnapshotsSetIamPolicyCall {
  4429  	c := &ProjectsSnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4430  	c.resource = resource
  4431  	c.setiampolicyrequest = setiampolicyrequest
  4432  	return c
  4433  }
  4434  
  4435  // Fields allows partial responses to be retrieved. See
  4436  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4437  // details.
  4438  func (c *ProjectsSnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsSetIamPolicyCall {
  4439  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4440  	return c
  4441  }
  4442  
  4443  // Context sets the context to be used in this call's Do method.
  4444  func (c *ProjectsSnapshotsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSnapshotsSetIamPolicyCall {
  4445  	c.ctx_ = ctx
  4446  	return c
  4447  }
  4448  
  4449  // Header returns a http.Header that can be modified by the caller to add
  4450  // headers to the request.
  4451  func (c *ProjectsSnapshotsSetIamPolicyCall) Header() http.Header {
  4452  	if c.header_ == nil {
  4453  		c.header_ = make(http.Header)
  4454  	}
  4455  	return c.header_
  4456  }
  4457  
  4458  func (c *ProjectsSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4459  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4460  	var body io.Reader = nil
  4461  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  4462  	if err != nil {
  4463  		return nil, err
  4464  	}
  4465  	c.urlParams_.Set("alt", alt)
  4466  	c.urlParams_.Set("prettyPrint", "false")
  4467  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  4468  	urls += "?" + c.urlParams_.Encode()
  4469  	req, err := http.NewRequest("POST", urls, body)
  4470  	if err != nil {
  4471  		return nil, err
  4472  	}
  4473  	req.Header = reqHeaders
  4474  	googleapi.Expand(req.URL, map[string]string{
  4475  		"resource": c.resource,
  4476  	})
  4477  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4478  }
  4479  
  4480  // Do executes the "pubsub.projects.snapshots.setIamPolicy" call.
  4481  // Any non-2xx status code is an error. Response headers are in either
  4482  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  4483  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4484  // whether the returned error was because http.StatusNotModified was returned.
  4485  func (c *ProjectsSnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4486  	gensupport.SetOptions(c.urlParams_, opts...)
  4487  	res, err := c.doRequest("json")
  4488  	if res != nil && res.StatusCode == http.StatusNotModified {
  4489  		if res.Body != nil {
  4490  			res.Body.Close()
  4491  		}
  4492  		return nil, gensupport.WrapError(&googleapi.Error{
  4493  			Code:   res.StatusCode,
  4494  			Header: res.Header,
  4495  		})
  4496  	}
  4497  	if err != nil {
  4498  		return nil, err
  4499  	}
  4500  	defer googleapi.CloseBody(res)
  4501  	if err := googleapi.CheckResponse(res); err != nil {
  4502  		return nil, gensupport.WrapError(err)
  4503  	}
  4504  	ret := &Policy{
  4505  		ServerResponse: googleapi.ServerResponse{
  4506  			Header:         res.Header,
  4507  			HTTPStatusCode: res.StatusCode,
  4508  		},
  4509  	}
  4510  	target := &ret
  4511  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4512  		return nil, err
  4513  	}
  4514  	return ret, nil
  4515  }
  4516  
  4517  type ProjectsSnapshotsTestIamPermissionsCall struct {
  4518  	s                         *Service
  4519  	resource                  string
  4520  	testiampermissionsrequest *TestIamPermissionsRequest
  4521  	urlParams_                gensupport.URLParams
  4522  	ctx_                      context.Context
  4523  	header_                   http.Header
  4524  }
  4525  
  4526  // TestIamPermissions: Returns permissions that a caller has on the specified
  4527  // resource. If the resource does not exist, this will return an empty set of
  4528  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  4529  // used for building permission-aware UIs and command-line tools, not for
  4530  // authorization checking. This operation may "fail open" without warning.
  4531  //
  4532  //   - resource: REQUIRED: The resource for which the policy detail is being
  4533  //     requested. See Resource names
  4534  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  4535  //     value for this field.
  4536  func (r *ProjectsSnapshotsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSnapshotsTestIamPermissionsCall {
  4537  	c := &ProjectsSnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4538  	c.resource = resource
  4539  	c.testiampermissionsrequest = testiampermissionsrequest
  4540  	return c
  4541  }
  4542  
  4543  // Fields allows partial responses to be retrieved. See
  4544  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4545  // details.
  4546  func (c *ProjectsSnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSnapshotsTestIamPermissionsCall {
  4547  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4548  	return c
  4549  }
  4550  
  4551  // Context sets the context to be used in this call's Do method.
  4552  func (c *ProjectsSnapshotsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSnapshotsTestIamPermissionsCall {
  4553  	c.ctx_ = ctx
  4554  	return c
  4555  }
  4556  
  4557  // Header returns a http.Header that can be modified by the caller to add
  4558  // headers to the request.
  4559  func (c *ProjectsSnapshotsTestIamPermissionsCall) Header() http.Header {
  4560  	if c.header_ == nil {
  4561  		c.header_ = make(http.Header)
  4562  	}
  4563  	return c.header_
  4564  }
  4565  
  4566  func (c *ProjectsSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4567  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4568  	var body io.Reader = nil
  4569  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  4570  	if err != nil {
  4571  		return nil, err
  4572  	}
  4573  	c.urlParams_.Set("alt", alt)
  4574  	c.urlParams_.Set("prettyPrint", "false")
  4575  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  4576  	urls += "?" + c.urlParams_.Encode()
  4577  	req, err := http.NewRequest("POST", urls, body)
  4578  	if err != nil {
  4579  		return nil, err
  4580  	}
  4581  	req.Header = reqHeaders
  4582  	googleapi.Expand(req.URL, map[string]string{
  4583  		"resource": c.resource,
  4584  	})
  4585  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4586  }
  4587  
  4588  // Do executes the "pubsub.projects.snapshots.testIamPermissions" call.
  4589  // Any non-2xx status code is an error. Response headers are in either
  4590  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  4591  // returned at all) in error.(*googleapi.Error).Header. Use
  4592  // googleapi.IsNotModified to check whether the returned error was because
  4593  // http.StatusNotModified was returned.
  4594  func (c *ProjectsSnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  4595  	gensupport.SetOptions(c.urlParams_, opts...)
  4596  	res, err := c.doRequest("json")
  4597  	if res != nil && res.StatusCode == http.StatusNotModified {
  4598  		if res.Body != nil {
  4599  			res.Body.Close()
  4600  		}
  4601  		return nil, gensupport.WrapError(&googleapi.Error{
  4602  			Code:   res.StatusCode,
  4603  			Header: res.Header,
  4604  		})
  4605  	}
  4606  	if err != nil {
  4607  		return nil, err
  4608  	}
  4609  	defer googleapi.CloseBody(res)
  4610  	if err := googleapi.CheckResponse(res); err != nil {
  4611  		return nil, gensupport.WrapError(err)
  4612  	}
  4613  	ret := &TestIamPermissionsResponse{
  4614  		ServerResponse: googleapi.ServerResponse{
  4615  			Header:         res.Header,
  4616  			HTTPStatusCode: res.StatusCode,
  4617  		},
  4618  	}
  4619  	target := &ret
  4620  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4621  		return nil, err
  4622  	}
  4623  	return ret, nil
  4624  }
  4625  
  4626  type ProjectsSubscriptionsAcknowledgeCall struct {
  4627  	s                  *Service
  4628  	subscription       string
  4629  	acknowledgerequest *AcknowledgeRequest
  4630  	urlParams_         gensupport.URLParams
  4631  	ctx_               context.Context
  4632  	header_            http.Header
  4633  }
  4634  
  4635  // Acknowledge: Acknowledges the messages associated with the `ack_ids` in the
  4636  // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
  4637  // from the subscription. Acknowledging a message whose ack deadline has
  4638  // expired may succeed, but such a message may be redelivered later.
  4639  // Acknowledging a message more than once will not result in an error.
  4640  //
  4641  //   - subscription: The subscription whose message is being acknowledged. Format
  4642  //     is `projects/{project}/subscriptions/{sub}`.
  4643  func (r *ProjectsSubscriptionsService) Acknowledge(subscription string, acknowledgerequest *AcknowledgeRequest) *ProjectsSubscriptionsAcknowledgeCall {
  4644  	c := &ProjectsSubscriptionsAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4645  	c.subscription = subscription
  4646  	c.acknowledgerequest = acknowledgerequest
  4647  	return c
  4648  }
  4649  
  4650  // Fields allows partial responses to be retrieved. See
  4651  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4652  // details.
  4653  func (c *ProjectsSubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsAcknowledgeCall {
  4654  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4655  	return c
  4656  }
  4657  
  4658  // Context sets the context to be used in this call's Do method.
  4659  func (c *ProjectsSubscriptionsAcknowledgeCall) Context(ctx context.Context) *ProjectsSubscriptionsAcknowledgeCall {
  4660  	c.ctx_ = ctx
  4661  	return c
  4662  }
  4663  
  4664  // Header returns a http.Header that can be modified by the caller to add
  4665  // headers to the request.
  4666  func (c *ProjectsSubscriptionsAcknowledgeCall) Header() http.Header {
  4667  	if c.header_ == nil {
  4668  		c.header_ = make(http.Header)
  4669  	}
  4670  	return c.header_
  4671  }
  4672  
  4673  func (c *ProjectsSubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) {
  4674  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4675  	var body io.Reader = nil
  4676  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest)
  4677  	if err != nil {
  4678  		return nil, err
  4679  	}
  4680  	c.urlParams_.Set("alt", alt)
  4681  	c.urlParams_.Set("prettyPrint", "false")
  4682  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:acknowledge")
  4683  	urls += "?" + c.urlParams_.Encode()
  4684  	req, err := http.NewRequest("POST", urls, body)
  4685  	if err != nil {
  4686  		return nil, err
  4687  	}
  4688  	req.Header = reqHeaders
  4689  	googleapi.Expand(req.URL, map[string]string{
  4690  		"subscription": c.subscription,
  4691  	})
  4692  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4693  }
  4694  
  4695  // Do executes the "pubsub.projects.subscriptions.acknowledge" call.
  4696  // Any non-2xx status code is an error. Response headers are in either
  4697  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4698  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4699  // whether the returned error was because http.StatusNotModified was returned.
  4700  func (c *ProjectsSubscriptionsAcknowledgeCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4701  	gensupport.SetOptions(c.urlParams_, opts...)
  4702  	res, err := c.doRequest("json")
  4703  	if res != nil && res.StatusCode == http.StatusNotModified {
  4704  		if res.Body != nil {
  4705  			res.Body.Close()
  4706  		}
  4707  		return nil, gensupport.WrapError(&googleapi.Error{
  4708  			Code:   res.StatusCode,
  4709  			Header: res.Header,
  4710  		})
  4711  	}
  4712  	if err != nil {
  4713  		return nil, err
  4714  	}
  4715  	defer googleapi.CloseBody(res)
  4716  	if err := googleapi.CheckResponse(res); err != nil {
  4717  		return nil, gensupport.WrapError(err)
  4718  	}
  4719  	ret := &Empty{
  4720  		ServerResponse: googleapi.ServerResponse{
  4721  			Header:         res.Header,
  4722  			HTTPStatusCode: res.StatusCode,
  4723  		},
  4724  	}
  4725  	target := &ret
  4726  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4727  		return nil, err
  4728  	}
  4729  	return ret, nil
  4730  }
  4731  
  4732  type ProjectsSubscriptionsCreateCall struct {
  4733  	s            *Service
  4734  	name         string
  4735  	subscription *Subscription
  4736  	urlParams_   gensupport.URLParams
  4737  	ctx_         context.Context
  4738  	header_      http.Header
  4739  }
  4740  
  4741  // Create: Creates a subscription to a given topic. See the [resource name
  4742  // rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
  4743  // If the subscription already exists, returns `ALREADY_EXISTS`. If the
  4744  // corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not
  4745  // provided in the request, the server will assign a random name for this
  4746  // subscription on the same project as the topic, conforming to the [resource
  4747  // name format]
  4748  // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
  4749  // generated name is populated in the returned Subscription object. Note that
  4750  // for REST API requests, you must specify a name in the request.
  4751  //
  4752  //   - name: The name of the subscription. It must have the format
  4753  //     "projects/{project}/subscriptions/{subscription}". `{subscription}` must
  4754  //     start with a letter, and contain only letters (`[A-Za-z]`), numbers
  4755  //     (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
  4756  //     plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
  4757  //     in length, and it must not start with "goog".
  4758  func (r *ProjectsSubscriptionsService) Create(name string, subscription *Subscription) *ProjectsSubscriptionsCreateCall {
  4759  	c := &ProjectsSubscriptionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4760  	c.name = name
  4761  	c.subscription = subscription
  4762  	return c
  4763  }
  4764  
  4765  // Fields allows partial responses to be retrieved. See
  4766  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4767  // details.
  4768  func (c *ProjectsSubscriptionsCreateCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsCreateCall {
  4769  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4770  	return c
  4771  }
  4772  
  4773  // Context sets the context to be used in this call's Do method.
  4774  func (c *ProjectsSubscriptionsCreateCall) Context(ctx context.Context) *ProjectsSubscriptionsCreateCall {
  4775  	c.ctx_ = ctx
  4776  	return c
  4777  }
  4778  
  4779  // Header returns a http.Header that can be modified by the caller to add
  4780  // headers to the request.
  4781  func (c *ProjectsSubscriptionsCreateCall) Header() http.Header {
  4782  	if c.header_ == nil {
  4783  		c.header_ = make(http.Header)
  4784  	}
  4785  	return c.header_
  4786  }
  4787  
  4788  func (c *ProjectsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) {
  4789  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4790  	var body io.Reader = nil
  4791  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  4792  	if err != nil {
  4793  		return nil, err
  4794  	}
  4795  	c.urlParams_.Set("alt", alt)
  4796  	c.urlParams_.Set("prettyPrint", "false")
  4797  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4798  	urls += "?" + c.urlParams_.Encode()
  4799  	req, err := http.NewRequest("PUT", urls, body)
  4800  	if err != nil {
  4801  		return nil, err
  4802  	}
  4803  	req.Header = reqHeaders
  4804  	googleapi.Expand(req.URL, map[string]string{
  4805  		"name": c.name,
  4806  	})
  4807  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4808  }
  4809  
  4810  // Do executes the "pubsub.projects.subscriptions.create" call.
  4811  // Any non-2xx status code is an error. Response headers are in either
  4812  // *Subscription.ServerResponse.Header or (if a response was returned at all)
  4813  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4814  // whether the returned error was because http.StatusNotModified was returned.
  4815  func (c *ProjectsSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  4816  	gensupport.SetOptions(c.urlParams_, opts...)
  4817  	res, err := c.doRequest("json")
  4818  	if res != nil && res.StatusCode == http.StatusNotModified {
  4819  		if res.Body != nil {
  4820  			res.Body.Close()
  4821  		}
  4822  		return nil, gensupport.WrapError(&googleapi.Error{
  4823  			Code:   res.StatusCode,
  4824  			Header: res.Header,
  4825  		})
  4826  	}
  4827  	if err != nil {
  4828  		return nil, err
  4829  	}
  4830  	defer googleapi.CloseBody(res)
  4831  	if err := googleapi.CheckResponse(res); err != nil {
  4832  		return nil, gensupport.WrapError(err)
  4833  	}
  4834  	ret := &Subscription{
  4835  		ServerResponse: googleapi.ServerResponse{
  4836  			Header:         res.Header,
  4837  			HTTPStatusCode: res.StatusCode,
  4838  		},
  4839  	}
  4840  	target := &ret
  4841  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4842  		return nil, err
  4843  	}
  4844  	return ret, nil
  4845  }
  4846  
  4847  type ProjectsSubscriptionsDeleteCall struct {
  4848  	s            *Service
  4849  	subscription string
  4850  	urlParams_   gensupport.URLParams
  4851  	ctx_         context.Context
  4852  	header_      http.Header
  4853  }
  4854  
  4855  // Delete: Deletes an existing subscription. All messages retained in the
  4856  // subscription are immediately dropped. Calls to `Pull` after deletion will
  4857  // return `NOT_FOUND`. After a subscription is deleted, a new one may be
  4858  // created with the same name, but the new one has no association with the old
  4859  // subscription or its topic unless the same topic is specified.
  4860  //
  4861  //   - subscription: The subscription to delete. Format is
  4862  //     `projects/{project}/subscriptions/{sub}`.
  4863  func (r *ProjectsSubscriptionsService) Delete(subscription string) *ProjectsSubscriptionsDeleteCall {
  4864  	c := &ProjectsSubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4865  	c.subscription = subscription
  4866  	return c
  4867  }
  4868  
  4869  // Fields allows partial responses to be retrieved. See
  4870  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4871  // details.
  4872  func (c *ProjectsSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsDeleteCall {
  4873  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4874  	return c
  4875  }
  4876  
  4877  // Context sets the context to be used in this call's Do method.
  4878  func (c *ProjectsSubscriptionsDeleteCall) Context(ctx context.Context) *ProjectsSubscriptionsDeleteCall {
  4879  	c.ctx_ = ctx
  4880  	return c
  4881  }
  4882  
  4883  // Header returns a http.Header that can be modified by the caller to add
  4884  // headers to the request.
  4885  func (c *ProjectsSubscriptionsDeleteCall) Header() http.Header {
  4886  	if c.header_ == nil {
  4887  		c.header_ = make(http.Header)
  4888  	}
  4889  	return c.header_
  4890  }
  4891  
  4892  func (c *ProjectsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4893  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4894  	var body io.Reader = nil
  4895  	c.urlParams_.Set("alt", alt)
  4896  	c.urlParams_.Set("prettyPrint", "false")
  4897  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}")
  4898  	urls += "?" + c.urlParams_.Encode()
  4899  	req, err := http.NewRequest("DELETE", urls, body)
  4900  	if err != nil {
  4901  		return nil, err
  4902  	}
  4903  	req.Header = reqHeaders
  4904  	googleapi.Expand(req.URL, map[string]string{
  4905  		"subscription": c.subscription,
  4906  	})
  4907  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4908  }
  4909  
  4910  // Do executes the "pubsub.projects.subscriptions.delete" call.
  4911  // Any non-2xx status code is an error. Response headers are in either
  4912  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4913  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4914  // whether the returned error was because http.StatusNotModified was returned.
  4915  func (c *ProjectsSubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4916  	gensupport.SetOptions(c.urlParams_, opts...)
  4917  	res, err := c.doRequest("json")
  4918  	if res != nil && res.StatusCode == http.StatusNotModified {
  4919  		if res.Body != nil {
  4920  			res.Body.Close()
  4921  		}
  4922  		return nil, gensupport.WrapError(&googleapi.Error{
  4923  			Code:   res.StatusCode,
  4924  			Header: res.Header,
  4925  		})
  4926  	}
  4927  	if err != nil {
  4928  		return nil, err
  4929  	}
  4930  	defer googleapi.CloseBody(res)
  4931  	if err := googleapi.CheckResponse(res); err != nil {
  4932  		return nil, gensupport.WrapError(err)
  4933  	}
  4934  	ret := &Empty{
  4935  		ServerResponse: googleapi.ServerResponse{
  4936  			Header:         res.Header,
  4937  			HTTPStatusCode: res.StatusCode,
  4938  		},
  4939  	}
  4940  	target := &ret
  4941  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4942  		return nil, err
  4943  	}
  4944  	return ret, nil
  4945  }
  4946  
  4947  type ProjectsSubscriptionsDetachCall struct {
  4948  	s            *Service
  4949  	subscription string
  4950  	urlParams_   gensupport.URLParams
  4951  	ctx_         context.Context
  4952  	header_      http.Header
  4953  }
  4954  
  4955  // Detach: Detaches a subscription from this topic. All messages retained in
  4956  // the subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
  4957  // will return FAILED_PRECONDITION. If the subscription is a push subscription,
  4958  // pushes to the endpoint will stop.
  4959  //
  4960  //   - subscription: The subscription to detach. Format is
  4961  //     `projects/{project}/subscriptions/{subscription}`.
  4962  func (r *ProjectsSubscriptionsService) Detach(subscription string) *ProjectsSubscriptionsDetachCall {
  4963  	c := &ProjectsSubscriptionsDetachCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4964  	c.subscription = subscription
  4965  	return c
  4966  }
  4967  
  4968  // Fields allows partial responses to be retrieved. See
  4969  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4970  // details.
  4971  func (c *ProjectsSubscriptionsDetachCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsDetachCall {
  4972  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4973  	return c
  4974  }
  4975  
  4976  // Context sets the context to be used in this call's Do method.
  4977  func (c *ProjectsSubscriptionsDetachCall) Context(ctx context.Context) *ProjectsSubscriptionsDetachCall {
  4978  	c.ctx_ = ctx
  4979  	return c
  4980  }
  4981  
  4982  // Header returns a http.Header that can be modified by the caller to add
  4983  // headers to the request.
  4984  func (c *ProjectsSubscriptionsDetachCall) Header() http.Header {
  4985  	if c.header_ == nil {
  4986  		c.header_ = make(http.Header)
  4987  	}
  4988  	return c.header_
  4989  }
  4990  
  4991  func (c *ProjectsSubscriptionsDetachCall) doRequest(alt string) (*http.Response, error) {
  4992  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4993  	var body io.Reader = nil
  4994  	c.urlParams_.Set("alt", alt)
  4995  	c.urlParams_.Set("prettyPrint", "false")
  4996  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:detach")
  4997  	urls += "?" + c.urlParams_.Encode()
  4998  	req, err := http.NewRequest("POST", urls, body)
  4999  	if err != nil {
  5000  		return nil, err
  5001  	}
  5002  	req.Header = reqHeaders
  5003  	googleapi.Expand(req.URL, map[string]string{
  5004  		"subscription": c.subscription,
  5005  	})
  5006  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5007  }
  5008  
  5009  // Do executes the "pubsub.projects.subscriptions.detach" call.
  5010  // Any non-2xx status code is an error. Response headers are in either
  5011  // *DetachSubscriptionResponse.ServerResponse.Header or (if a response was
  5012  // returned at all) in error.(*googleapi.Error).Header. Use
  5013  // googleapi.IsNotModified to check whether the returned error was because
  5014  // http.StatusNotModified was returned.
  5015  func (c *ProjectsSubscriptionsDetachCall) Do(opts ...googleapi.CallOption) (*DetachSubscriptionResponse, error) {
  5016  	gensupport.SetOptions(c.urlParams_, opts...)
  5017  	res, err := c.doRequest("json")
  5018  	if res != nil && res.StatusCode == http.StatusNotModified {
  5019  		if res.Body != nil {
  5020  			res.Body.Close()
  5021  		}
  5022  		return nil, gensupport.WrapError(&googleapi.Error{
  5023  			Code:   res.StatusCode,
  5024  			Header: res.Header,
  5025  		})
  5026  	}
  5027  	if err != nil {
  5028  		return nil, err
  5029  	}
  5030  	defer googleapi.CloseBody(res)
  5031  	if err := googleapi.CheckResponse(res); err != nil {
  5032  		return nil, gensupport.WrapError(err)
  5033  	}
  5034  	ret := &DetachSubscriptionResponse{
  5035  		ServerResponse: googleapi.ServerResponse{
  5036  			Header:         res.Header,
  5037  			HTTPStatusCode: res.StatusCode,
  5038  		},
  5039  	}
  5040  	target := &ret
  5041  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5042  		return nil, err
  5043  	}
  5044  	return ret, nil
  5045  }
  5046  
  5047  type ProjectsSubscriptionsGetCall struct {
  5048  	s            *Service
  5049  	subscription string
  5050  	urlParams_   gensupport.URLParams
  5051  	ifNoneMatch_ string
  5052  	ctx_         context.Context
  5053  	header_      http.Header
  5054  }
  5055  
  5056  // Get: Gets the configuration details of a subscription.
  5057  //
  5058  //   - subscription: The name of the subscription to get. Format is
  5059  //     `projects/{project}/subscriptions/{sub}`.
  5060  func (r *ProjectsSubscriptionsService) Get(subscription string) *ProjectsSubscriptionsGetCall {
  5061  	c := &ProjectsSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5062  	c.subscription = subscription
  5063  	return c
  5064  }
  5065  
  5066  // Fields allows partial responses to be retrieved. See
  5067  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5068  // details.
  5069  func (c *ProjectsSubscriptionsGetCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsGetCall {
  5070  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5071  	return c
  5072  }
  5073  
  5074  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5075  // object's ETag matches the given value. This is useful for getting updates
  5076  // only after the object has changed since the last request.
  5077  func (c *ProjectsSubscriptionsGetCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsGetCall {
  5078  	c.ifNoneMatch_ = entityTag
  5079  	return c
  5080  }
  5081  
  5082  // Context sets the context to be used in this call's Do method.
  5083  func (c *ProjectsSubscriptionsGetCall) Context(ctx context.Context) *ProjectsSubscriptionsGetCall {
  5084  	c.ctx_ = ctx
  5085  	return c
  5086  }
  5087  
  5088  // Header returns a http.Header that can be modified by the caller to add
  5089  // headers to the request.
  5090  func (c *ProjectsSubscriptionsGetCall) Header() http.Header {
  5091  	if c.header_ == nil {
  5092  		c.header_ = make(http.Header)
  5093  	}
  5094  	return c.header_
  5095  }
  5096  
  5097  func (c *ProjectsSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  5098  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5099  	if c.ifNoneMatch_ != "" {
  5100  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5101  	}
  5102  	var body io.Reader = nil
  5103  	c.urlParams_.Set("alt", alt)
  5104  	c.urlParams_.Set("prettyPrint", "false")
  5105  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}")
  5106  	urls += "?" + c.urlParams_.Encode()
  5107  	req, err := http.NewRequest("GET", urls, body)
  5108  	if err != nil {
  5109  		return nil, err
  5110  	}
  5111  	req.Header = reqHeaders
  5112  	googleapi.Expand(req.URL, map[string]string{
  5113  		"subscription": c.subscription,
  5114  	})
  5115  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5116  }
  5117  
  5118  // Do executes the "pubsub.projects.subscriptions.get" call.
  5119  // Any non-2xx status code is an error. Response headers are in either
  5120  // *Subscription.ServerResponse.Header or (if a response was returned at all)
  5121  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5122  // whether the returned error was because http.StatusNotModified was returned.
  5123  func (c *ProjectsSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  5124  	gensupport.SetOptions(c.urlParams_, opts...)
  5125  	res, err := c.doRequest("json")
  5126  	if res != nil && res.StatusCode == http.StatusNotModified {
  5127  		if res.Body != nil {
  5128  			res.Body.Close()
  5129  		}
  5130  		return nil, gensupport.WrapError(&googleapi.Error{
  5131  			Code:   res.StatusCode,
  5132  			Header: res.Header,
  5133  		})
  5134  	}
  5135  	if err != nil {
  5136  		return nil, err
  5137  	}
  5138  	defer googleapi.CloseBody(res)
  5139  	if err := googleapi.CheckResponse(res); err != nil {
  5140  		return nil, gensupport.WrapError(err)
  5141  	}
  5142  	ret := &Subscription{
  5143  		ServerResponse: googleapi.ServerResponse{
  5144  			Header:         res.Header,
  5145  			HTTPStatusCode: res.StatusCode,
  5146  		},
  5147  	}
  5148  	target := &ret
  5149  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5150  		return nil, err
  5151  	}
  5152  	return ret, nil
  5153  }
  5154  
  5155  type ProjectsSubscriptionsGetIamPolicyCall struct {
  5156  	s            *Service
  5157  	resource     string
  5158  	urlParams_   gensupport.URLParams
  5159  	ifNoneMatch_ string
  5160  	ctx_         context.Context
  5161  	header_      http.Header
  5162  }
  5163  
  5164  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  5165  // empty policy if the resource exists and does not have a policy set.
  5166  //
  5167  //   - resource: REQUIRED: The resource for which the policy is being requested.
  5168  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  5169  //     for the appropriate value for this field.
  5170  func (r *ProjectsSubscriptionsService) GetIamPolicy(resource string) *ProjectsSubscriptionsGetIamPolicyCall {
  5171  	c := &ProjectsSubscriptionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5172  	c.resource = resource
  5173  	return c
  5174  }
  5175  
  5176  // OptionsRequestedPolicyVersion sets the optional parameter
  5177  // "options.requestedPolicyVersion": The maximum policy version that will be
  5178  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  5179  // an invalid value will be rejected. Requests for policies with any
  5180  // conditional role bindings must specify version 3. Policies with no
  5181  // conditional role bindings may specify any valid value or leave the field
  5182  // unset. The policy in the response might use the policy version that you
  5183  // specified, or it might use a lower policy version. For example, if you
  5184  // specify version 3, but the policy has no conditional role bindings, the
  5185  // response uses version 1. To learn which resources support conditions in
  5186  // their IAM policies, see the IAM documentation
  5187  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  5188  func (c *ProjectsSubscriptionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsSubscriptionsGetIamPolicyCall {
  5189  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  5190  	return c
  5191  }
  5192  
  5193  // Fields allows partial responses to be retrieved. See
  5194  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5195  // details.
  5196  func (c *ProjectsSubscriptionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsGetIamPolicyCall {
  5197  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5198  	return c
  5199  }
  5200  
  5201  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5202  // object's ETag matches the given value. This is useful for getting updates
  5203  // only after the object has changed since the last request.
  5204  func (c *ProjectsSubscriptionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsGetIamPolicyCall {
  5205  	c.ifNoneMatch_ = entityTag
  5206  	return c
  5207  }
  5208  
  5209  // Context sets the context to be used in this call's Do method.
  5210  func (c *ProjectsSubscriptionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsSubscriptionsGetIamPolicyCall {
  5211  	c.ctx_ = ctx
  5212  	return c
  5213  }
  5214  
  5215  // Header returns a http.Header that can be modified by the caller to add
  5216  // headers to the request.
  5217  func (c *ProjectsSubscriptionsGetIamPolicyCall) Header() http.Header {
  5218  	if c.header_ == nil {
  5219  		c.header_ = make(http.Header)
  5220  	}
  5221  	return c.header_
  5222  }
  5223  
  5224  func (c *ProjectsSubscriptionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5225  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5226  	if c.ifNoneMatch_ != "" {
  5227  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5228  	}
  5229  	var body io.Reader = nil
  5230  	c.urlParams_.Set("alt", alt)
  5231  	c.urlParams_.Set("prettyPrint", "false")
  5232  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  5233  	urls += "?" + c.urlParams_.Encode()
  5234  	req, err := http.NewRequest("GET", urls, body)
  5235  	if err != nil {
  5236  		return nil, err
  5237  	}
  5238  	req.Header = reqHeaders
  5239  	googleapi.Expand(req.URL, map[string]string{
  5240  		"resource": c.resource,
  5241  	})
  5242  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5243  }
  5244  
  5245  // Do executes the "pubsub.projects.subscriptions.getIamPolicy" call.
  5246  // Any non-2xx status code is an error. Response headers are in either
  5247  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  5248  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5249  // whether the returned error was because http.StatusNotModified was returned.
  5250  func (c *ProjectsSubscriptionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5251  	gensupport.SetOptions(c.urlParams_, opts...)
  5252  	res, err := c.doRequest("json")
  5253  	if res != nil && res.StatusCode == http.StatusNotModified {
  5254  		if res.Body != nil {
  5255  			res.Body.Close()
  5256  		}
  5257  		return nil, gensupport.WrapError(&googleapi.Error{
  5258  			Code:   res.StatusCode,
  5259  			Header: res.Header,
  5260  		})
  5261  	}
  5262  	if err != nil {
  5263  		return nil, err
  5264  	}
  5265  	defer googleapi.CloseBody(res)
  5266  	if err := googleapi.CheckResponse(res); err != nil {
  5267  		return nil, gensupport.WrapError(err)
  5268  	}
  5269  	ret := &Policy{
  5270  		ServerResponse: googleapi.ServerResponse{
  5271  			Header:         res.Header,
  5272  			HTTPStatusCode: res.StatusCode,
  5273  		},
  5274  	}
  5275  	target := &ret
  5276  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5277  		return nil, err
  5278  	}
  5279  	return ret, nil
  5280  }
  5281  
  5282  type ProjectsSubscriptionsListCall struct {
  5283  	s            *Service
  5284  	project      string
  5285  	urlParams_   gensupport.URLParams
  5286  	ifNoneMatch_ string
  5287  	ctx_         context.Context
  5288  	header_      http.Header
  5289  }
  5290  
  5291  // List: Lists matching subscriptions.
  5292  //
  5293  //   - project: The name of the project in which to list subscriptions. Format is
  5294  //     `projects/{project-id}`.
  5295  func (r *ProjectsSubscriptionsService) List(project string) *ProjectsSubscriptionsListCall {
  5296  	c := &ProjectsSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5297  	c.project = project
  5298  	return c
  5299  }
  5300  
  5301  // PageSize sets the optional parameter "pageSize": Maximum number of
  5302  // subscriptions to return.
  5303  func (c *ProjectsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsSubscriptionsListCall {
  5304  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5305  	return c
  5306  }
  5307  
  5308  // PageToken sets the optional parameter "pageToken": The value returned by the
  5309  // last `ListSubscriptionsResponse`; indicates that this is a continuation of a
  5310  // prior `ListSubscriptions` call, and that the system should return the next
  5311  // page of data.
  5312  func (c *ProjectsSubscriptionsListCall) PageToken(pageToken string) *ProjectsSubscriptionsListCall {
  5313  	c.urlParams_.Set("pageToken", pageToken)
  5314  	return c
  5315  }
  5316  
  5317  // Fields allows partial responses to be retrieved. See
  5318  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5319  // details.
  5320  func (c *ProjectsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsListCall {
  5321  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5322  	return c
  5323  }
  5324  
  5325  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5326  // object's ETag matches the given value. This is useful for getting updates
  5327  // only after the object has changed since the last request.
  5328  func (c *ProjectsSubscriptionsListCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsListCall {
  5329  	c.ifNoneMatch_ = entityTag
  5330  	return c
  5331  }
  5332  
  5333  // Context sets the context to be used in this call's Do method.
  5334  func (c *ProjectsSubscriptionsListCall) Context(ctx context.Context) *ProjectsSubscriptionsListCall {
  5335  	c.ctx_ = ctx
  5336  	return c
  5337  }
  5338  
  5339  // Header returns a http.Header that can be modified by the caller to add
  5340  // headers to the request.
  5341  func (c *ProjectsSubscriptionsListCall) Header() http.Header {
  5342  	if c.header_ == nil {
  5343  		c.header_ = make(http.Header)
  5344  	}
  5345  	return c.header_
  5346  }
  5347  
  5348  func (c *ProjectsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  5349  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5350  	if c.ifNoneMatch_ != "" {
  5351  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5352  	}
  5353  	var body io.Reader = nil
  5354  	c.urlParams_.Set("alt", alt)
  5355  	c.urlParams_.Set("prettyPrint", "false")
  5356  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/subscriptions")
  5357  	urls += "?" + c.urlParams_.Encode()
  5358  	req, err := http.NewRequest("GET", urls, body)
  5359  	if err != nil {
  5360  		return nil, err
  5361  	}
  5362  	req.Header = reqHeaders
  5363  	googleapi.Expand(req.URL, map[string]string{
  5364  		"project": c.project,
  5365  	})
  5366  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5367  }
  5368  
  5369  // Do executes the "pubsub.projects.subscriptions.list" call.
  5370  // Any non-2xx status code is an error. Response headers are in either
  5371  // *ListSubscriptionsResponse.ServerResponse.Header or (if a response was
  5372  // returned at all) in error.(*googleapi.Error).Header. Use
  5373  // googleapi.IsNotModified to check whether the returned error was because
  5374  // http.StatusNotModified was returned.
  5375  func (c *ProjectsSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error) {
  5376  	gensupport.SetOptions(c.urlParams_, opts...)
  5377  	res, err := c.doRequest("json")
  5378  	if res != nil && res.StatusCode == http.StatusNotModified {
  5379  		if res.Body != nil {
  5380  			res.Body.Close()
  5381  		}
  5382  		return nil, gensupport.WrapError(&googleapi.Error{
  5383  			Code:   res.StatusCode,
  5384  			Header: res.Header,
  5385  		})
  5386  	}
  5387  	if err != nil {
  5388  		return nil, err
  5389  	}
  5390  	defer googleapi.CloseBody(res)
  5391  	if err := googleapi.CheckResponse(res); err != nil {
  5392  		return nil, gensupport.WrapError(err)
  5393  	}
  5394  	ret := &ListSubscriptionsResponse{
  5395  		ServerResponse: googleapi.ServerResponse{
  5396  			Header:         res.Header,
  5397  			HTTPStatusCode: res.StatusCode,
  5398  		},
  5399  	}
  5400  	target := &ret
  5401  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5402  		return nil, err
  5403  	}
  5404  	return ret, nil
  5405  }
  5406  
  5407  // Pages invokes f for each page of results.
  5408  // A non-nil error returned from f will halt the iteration.
  5409  // The provided context supersedes any context provided to the Context method.
  5410  func (c *ProjectsSubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error {
  5411  	c.ctx_ = ctx
  5412  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5413  	for {
  5414  		x, err := c.Do()
  5415  		if err != nil {
  5416  			return err
  5417  		}
  5418  		if err := f(x); err != nil {
  5419  			return err
  5420  		}
  5421  		if x.NextPageToken == "" {
  5422  			return nil
  5423  		}
  5424  		c.PageToken(x.NextPageToken)
  5425  	}
  5426  }
  5427  
  5428  type ProjectsSubscriptionsModifyAckDeadlineCall struct {
  5429  	s                        *Service
  5430  	subscription             string
  5431  	modifyackdeadlinerequest *ModifyAckDeadlineRequest
  5432  	urlParams_               gensupport.URLParams
  5433  	ctx_                     context.Context
  5434  	header_                  http.Header
  5435  }
  5436  
  5437  // ModifyAckDeadline: Modifies the ack deadline for a specific message. This
  5438  // method is useful to indicate that more time is needed to process a message
  5439  // by the subscriber, or to make the message available for redelivery if the
  5440  // processing was interrupted. Note that this does not modify the
  5441  // subscription-level `ackDeadlineSeconds` used for subsequent messages.
  5442  //
  5443  //   - subscription: The name of the subscription. Format is
  5444  //     `projects/{project}/subscriptions/{sub}`.
  5445  func (r *ProjectsSubscriptionsService) ModifyAckDeadline(subscription string, modifyackdeadlinerequest *ModifyAckDeadlineRequest) *ProjectsSubscriptionsModifyAckDeadlineCall {
  5446  	c := &ProjectsSubscriptionsModifyAckDeadlineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5447  	c.subscription = subscription
  5448  	c.modifyackdeadlinerequest = modifyackdeadlinerequest
  5449  	return c
  5450  }
  5451  
  5452  // Fields allows partial responses to be retrieved. See
  5453  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5454  // details.
  5455  func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyAckDeadlineCall {
  5456  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5457  	return c
  5458  }
  5459  
  5460  // Context sets the context to be used in this call's Do method.
  5461  func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Context(ctx context.Context) *ProjectsSubscriptionsModifyAckDeadlineCall {
  5462  	c.ctx_ = ctx
  5463  	return c
  5464  }
  5465  
  5466  // Header returns a http.Header that can be modified by the caller to add
  5467  // headers to the request.
  5468  func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Header() http.Header {
  5469  	if c.header_ == nil {
  5470  		c.header_ = make(http.Header)
  5471  	}
  5472  	return c.header_
  5473  }
  5474  
  5475  func (c *ProjectsSubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) {
  5476  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5477  	var body io.Reader = nil
  5478  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest)
  5479  	if err != nil {
  5480  		return nil, err
  5481  	}
  5482  	c.urlParams_.Set("alt", alt)
  5483  	c.urlParams_.Set("prettyPrint", "false")
  5484  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:modifyAckDeadline")
  5485  	urls += "?" + c.urlParams_.Encode()
  5486  	req, err := http.NewRequest("POST", urls, body)
  5487  	if err != nil {
  5488  		return nil, err
  5489  	}
  5490  	req.Header = reqHeaders
  5491  	googleapi.Expand(req.URL, map[string]string{
  5492  		"subscription": c.subscription,
  5493  	})
  5494  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5495  }
  5496  
  5497  // Do executes the "pubsub.projects.subscriptions.modifyAckDeadline" call.
  5498  // Any non-2xx status code is an error. Response headers are in either
  5499  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  5500  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5501  // whether the returned error was because http.StatusNotModified was returned.
  5502  func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5503  	gensupport.SetOptions(c.urlParams_, opts...)
  5504  	res, err := c.doRequest("json")
  5505  	if res != nil && res.StatusCode == http.StatusNotModified {
  5506  		if res.Body != nil {
  5507  			res.Body.Close()
  5508  		}
  5509  		return nil, gensupport.WrapError(&googleapi.Error{
  5510  			Code:   res.StatusCode,
  5511  			Header: res.Header,
  5512  		})
  5513  	}
  5514  	if err != nil {
  5515  		return nil, err
  5516  	}
  5517  	defer googleapi.CloseBody(res)
  5518  	if err := googleapi.CheckResponse(res); err != nil {
  5519  		return nil, gensupport.WrapError(err)
  5520  	}
  5521  	ret := &Empty{
  5522  		ServerResponse: googleapi.ServerResponse{
  5523  			Header:         res.Header,
  5524  			HTTPStatusCode: res.StatusCode,
  5525  		},
  5526  	}
  5527  	target := &ret
  5528  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5529  		return nil, err
  5530  	}
  5531  	return ret, nil
  5532  }
  5533  
  5534  type ProjectsSubscriptionsModifyPushConfigCall struct {
  5535  	s                       *Service
  5536  	subscription            string
  5537  	modifypushconfigrequest *ModifyPushConfigRequest
  5538  	urlParams_              gensupport.URLParams
  5539  	ctx_                    context.Context
  5540  	header_                 http.Header
  5541  }
  5542  
  5543  // ModifyPushConfig: Modifies the `PushConfig` for a specified subscription.
  5544  // This may be used to change a push subscription to a pull one (signified by
  5545  // an empty `PushConfig`) or vice versa, or change the endpoint URL and other
  5546  // attributes of a push subscription. Messages will accumulate for delivery
  5547  // continuously through the call regardless of changes to the `PushConfig`.
  5548  //
  5549  //   - subscription: The name of the subscription. Format is
  5550  //     `projects/{project}/subscriptions/{sub}`.
  5551  func (r *ProjectsSubscriptionsService) ModifyPushConfig(subscription string, modifypushconfigrequest *ModifyPushConfigRequest) *ProjectsSubscriptionsModifyPushConfigCall {
  5552  	c := &ProjectsSubscriptionsModifyPushConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5553  	c.subscription = subscription
  5554  	c.modifypushconfigrequest = modifypushconfigrequest
  5555  	return c
  5556  }
  5557  
  5558  // Fields allows partial responses to be retrieved. See
  5559  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5560  // details.
  5561  func (c *ProjectsSubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyPushConfigCall {
  5562  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5563  	return c
  5564  }
  5565  
  5566  // Context sets the context to be used in this call's Do method.
  5567  func (c *ProjectsSubscriptionsModifyPushConfigCall) Context(ctx context.Context) *ProjectsSubscriptionsModifyPushConfigCall {
  5568  	c.ctx_ = ctx
  5569  	return c
  5570  }
  5571  
  5572  // Header returns a http.Header that can be modified by the caller to add
  5573  // headers to the request.
  5574  func (c *ProjectsSubscriptionsModifyPushConfigCall) Header() http.Header {
  5575  	if c.header_ == nil {
  5576  		c.header_ = make(http.Header)
  5577  	}
  5578  	return c.header_
  5579  }
  5580  
  5581  func (c *ProjectsSubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) {
  5582  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5583  	var body io.Reader = nil
  5584  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest)
  5585  	if err != nil {
  5586  		return nil, err
  5587  	}
  5588  	c.urlParams_.Set("alt", alt)
  5589  	c.urlParams_.Set("prettyPrint", "false")
  5590  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:modifyPushConfig")
  5591  	urls += "?" + c.urlParams_.Encode()
  5592  	req, err := http.NewRequest("POST", urls, body)
  5593  	if err != nil {
  5594  		return nil, err
  5595  	}
  5596  	req.Header = reqHeaders
  5597  	googleapi.Expand(req.URL, map[string]string{
  5598  		"subscription": c.subscription,
  5599  	})
  5600  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5601  }
  5602  
  5603  // Do executes the "pubsub.projects.subscriptions.modifyPushConfig" call.
  5604  // Any non-2xx status code is an error. Response headers are in either
  5605  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  5606  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5607  // whether the returned error was because http.StatusNotModified was returned.
  5608  func (c *ProjectsSubscriptionsModifyPushConfigCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5609  	gensupport.SetOptions(c.urlParams_, opts...)
  5610  	res, err := c.doRequest("json")
  5611  	if res != nil && res.StatusCode == http.StatusNotModified {
  5612  		if res.Body != nil {
  5613  			res.Body.Close()
  5614  		}
  5615  		return nil, gensupport.WrapError(&googleapi.Error{
  5616  			Code:   res.StatusCode,
  5617  			Header: res.Header,
  5618  		})
  5619  	}
  5620  	if err != nil {
  5621  		return nil, err
  5622  	}
  5623  	defer googleapi.CloseBody(res)
  5624  	if err := googleapi.CheckResponse(res); err != nil {
  5625  		return nil, gensupport.WrapError(err)
  5626  	}
  5627  	ret := &Empty{
  5628  		ServerResponse: googleapi.ServerResponse{
  5629  			Header:         res.Header,
  5630  			HTTPStatusCode: res.StatusCode,
  5631  		},
  5632  	}
  5633  	target := &ret
  5634  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5635  		return nil, err
  5636  	}
  5637  	return ret, nil
  5638  }
  5639  
  5640  type ProjectsSubscriptionsPatchCall struct {
  5641  	s                         *Service
  5642  	name                      string
  5643  	updatesubscriptionrequest *UpdateSubscriptionRequest
  5644  	urlParams_                gensupport.URLParams
  5645  	ctx_                      context.Context
  5646  	header_                   http.Header
  5647  }
  5648  
  5649  // Patch: Updates an existing subscription by updating the fields specified in
  5650  // the update mask. Note that certain properties of a subscription, such as its
  5651  // topic, are not modifiable.
  5652  //
  5653  //   - name: The name of the subscription. It must have the format
  5654  //     "projects/{project}/subscriptions/{subscription}". `{subscription}` must
  5655  //     start with a letter, and contain only letters (`[A-Za-z]`), numbers
  5656  //     (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
  5657  //     plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
  5658  //     in length, and it must not start with "goog".
  5659  func (r *ProjectsSubscriptionsService) Patch(name string, updatesubscriptionrequest *UpdateSubscriptionRequest) *ProjectsSubscriptionsPatchCall {
  5660  	c := &ProjectsSubscriptionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5661  	c.name = name
  5662  	c.updatesubscriptionrequest = updatesubscriptionrequest
  5663  	return c
  5664  }
  5665  
  5666  // Fields allows partial responses to be retrieved. See
  5667  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5668  // details.
  5669  func (c *ProjectsSubscriptionsPatchCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsPatchCall {
  5670  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5671  	return c
  5672  }
  5673  
  5674  // Context sets the context to be used in this call's Do method.
  5675  func (c *ProjectsSubscriptionsPatchCall) Context(ctx context.Context) *ProjectsSubscriptionsPatchCall {
  5676  	c.ctx_ = ctx
  5677  	return c
  5678  }
  5679  
  5680  // Header returns a http.Header that can be modified by the caller to add
  5681  // headers to the request.
  5682  func (c *ProjectsSubscriptionsPatchCall) Header() http.Header {
  5683  	if c.header_ == nil {
  5684  		c.header_ = make(http.Header)
  5685  	}
  5686  	return c.header_
  5687  }
  5688  
  5689  func (c *ProjectsSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) {
  5690  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5691  	var body io.Reader = nil
  5692  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatesubscriptionrequest)
  5693  	if err != nil {
  5694  		return nil, err
  5695  	}
  5696  	c.urlParams_.Set("alt", alt)
  5697  	c.urlParams_.Set("prettyPrint", "false")
  5698  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5699  	urls += "?" + c.urlParams_.Encode()
  5700  	req, err := http.NewRequest("PATCH", urls, body)
  5701  	if err != nil {
  5702  		return nil, err
  5703  	}
  5704  	req.Header = reqHeaders
  5705  	googleapi.Expand(req.URL, map[string]string{
  5706  		"name": c.name,
  5707  	})
  5708  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5709  }
  5710  
  5711  // Do executes the "pubsub.projects.subscriptions.patch" call.
  5712  // Any non-2xx status code is an error. Response headers are in either
  5713  // *Subscription.ServerResponse.Header or (if a response was returned at all)
  5714  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5715  // whether the returned error was because http.StatusNotModified was returned.
  5716  func (c *ProjectsSubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  5717  	gensupport.SetOptions(c.urlParams_, opts...)
  5718  	res, err := c.doRequest("json")
  5719  	if res != nil && res.StatusCode == http.StatusNotModified {
  5720  		if res.Body != nil {
  5721  			res.Body.Close()
  5722  		}
  5723  		return nil, gensupport.WrapError(&googleapi.Error{
  5724  			Code:   res.StatusCode,
  5725  			Header: res.Header,
  5726  		})
  5727  	}
  5728  	if err != nil {
  5729  		return nil, err
  5730  	}
  5731  	defer googleapi.CloseBody(res)
  5732  	if err := googleapi.CheckResponse(res); err != nil {
  5733  		return nil, gensupport.WrapError(err)
  5734  	}
  5735  	ret := &Subscription{
  5736  		ServerResponse: googleapi.ServerResponse{
  5737  			Header:         res.Header,
  5738  			HTTPStatusCode: res.StatusCode,
  5739  		},
  5740  	}
  5741  	target := &ret
  5742  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5743  		return nil, err
  5744  	}
  5745  	return ret, nil
  5746  }
  5747  
  5748  type ProjectsSubscriptionsPullCall struct {
  5749  	s            *Service
  5750  	subscription string
  5751  	pullrequest  *PullRequest
  5752  	urlParams_   gensupport.URLParams
  5753  	ctx_         context.Context
  5754  	header_      http.Header
  5755  }
  5756  
  5757  // Pull: Pulls messages from the server.
  5758  //
  5759  //   - subscription: The subscription from which messages should be pulled.
  5760  //     Format is `projects/{project}/subscriptions/{sub}`.
  5761  func (r *ProjectsSubscriptionsService) Pull(subscription string, pullrequest *PullRequest) *ProjectsSubscriptionsPullCall {
  5762  	c := &ProjectsSubscriptionsPullCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5763  	c.subscription = subscription
  5764  	c.pullrequest = pullrequest
  5765  	return c
  5766  }
  5767  
  5768  // Fields allows partial responses to be retrieved. See
  5769  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5770  // details.
  5771  func (c *ProjectsSubscriptionsPullCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsPullCall {
  5772  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5773  	return c
  5774  }
  5775  
  5776  // Context sets the context to be used in this call's Do method.
  5777  func (c *ProjectsSubscriptionsPullCall) Context(ctx context.Context) *ProjectsSubscriptionsPullCall {
  5778  	c.ctx_ = ctx
  5779  	return c
  5780  }
  5781  
  5782  // Header returns a http.Header that can be modified by the caller to add
  5783  // headers to the request.
  5784  func (c *ProjectsSubscriptionsPullCall) Header() http.Header {
  5785  	if c.header_ == nil {
  5786  		c.header_ = make(http.Header)
  5787  	}
  5788  	return c.header_
  5789  }
  5790  
  5791  func (c *ProjectsSubscriptionsPullCall) doRequest(alt string) (*http.Response, error) {
  5792  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5793  	var body io.Reader = nil
  5794  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest)
  5795  	if err != nil {
  5796  		return nil, err
  5797  	}
  5798  	c.urlParams_.Set("alt", alt)
  5799  	c.urlParams_.Set("prettyPrint", "false")
  5800  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:pull")
  5801  	urls += "?" + c.urlParams_.Encode()
  5802  	req, err := http.NewRequest("POST", urls, body)
  5803  	if err != nil {
  5804  		return nil, err
  5805  	}
  5806  	req.Header = reqHeaders
  5807  	googleapi.Expand(req.URL, map[string]string{
  5808  		"subscription": c.subscription,
  5809  	})
  5810  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5811  }
  5812  
  5813  // Do executes the "pubsub.projects.subscriptions.pull" call.
  5814  // Any non-2xx status code is an error. Response headers are in either
  5815  // *PullResponse.ServerResponse.Header or (if a response was returned at all)
  5816  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5817  // whether the returned error was because http.StatusNotModified was returned.
  5818  func (c *ProjectsSubscriptionsPullCall) Do(opts ...googleapi.CallOption) (*PullResponse, error) {
  5819  	gensupport.SetOptions(c.urlParams_, opts...)
  5820  	res, err := c.doRequest("json")
  5821  	if res != nil && res.StatusCode == http.StatusNotModified {
  5822  		if res.Body != nil {
  5823  			res.Body.Close()
  5824  		}
  5825  		return nil, gensupport.WrapError(&googleapi.Error{
  5826  			Code:   res.StatusCode,
  5827  			Header: res.Header,
  5828  		})
  5829  	}
  5830  	if err != nil {
  5831  		return nil, err
  5832  	}
  5833  	defer googleapi.CloseBody(res)
  5834  	if err := googleapi.CheckResponse(res); err != nil {
  5835  		return nil, gensupport.WrapError(err)
  5836  	}
  5837  	ret := &PullResponse{
  5838  		ServerResponse: googleapi.ServerResponse{
  5839  			Header:         res.Header,
  5840  			HTTPStatusCode: res.StatusCode,
  5841  		},
  5842  	}
  5843  	target := &ret
  5844  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5845  		return nil, err
  5846  	}
  5847  	return ret, nil
  5848  }
  5849  
  5850  type ProjectsSubscriptionsSeekCall struct {
  5851  	s            *Service
  5852  	subscription string
  5853  	seekrequest  *SeekRequest
  5854  	urlParams_   gensupport.URLParams
  5855  	ctx_         context.Context
  5856  	header_      http.Header
  5857  }
  5858  
  5859  // Seek: Seeks an existing subscription to a point in time or to a given
  5860  // snapshot, whichever is provided in the request. Snapshots are used in [Seek]
  5861  // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
  5862  // allow you to manage message acknowledgments in bulk. That is, you can set
  5863  // the acknowledgment state of messages in an existing subscription to the
  5864  // state captured by a snapshot. Note that both the subscription and the
  5865  // snapshot must be on the same topic.
  5866  //
  5867  // - subscription: The subscription to affect.
  5868  func (r *ProjectsSubscriptionsService) Seek(subscription string, seekrequest *SeekRequest) *ProjectsSubscriptionsSeekCall {
  5869  	c := &ProjectsSubscriptionsSeekCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5870  	c.subscription = subscription
  5871  	c.seekrequest = seekrequest
  5872  	return c
  5873  }
  5874  
  5875  // Fields allows partial responses to be retrieved. See
  5876  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5877  // details.
  5878  func (c *ProjectsSubscriptionsSeekCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsSeekCall {
  5879  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5880  	return c
  5881  }
  5882  
  5883  // Context sets the context to be used in this call's Do method.
  5884  func (c *ProjectsSubscriptionsSeekCall) Context(ctx context.Context) *ProjectsSubscriptionsSeekCall {
  5885  	c.ctx_ = ctx
  5886  	return c
  5887  }
  5888  
  5889  // Header returns a http.Header that can be modified by the caller to add
  5890  // headers to the request.
  5891  func (c *ProjectsSubscriptionsSeekCall) Header() http.Header {
  5892  	if c.header_ == nil {
  5893  		c.header_ = make(http.Header)
  5894  	}
  5895  	return c.header_
  5896  }
  5897  
  5898  func (c *ProjectsSubscriptionsSeekCall) doRequest(alt string) (*http.Response, error) {
  5899  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5900  	var body io.Reader = nil
  5901  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.seekrequest)
  5902  	if err != nil {
  5903  		return nil, err
  5904  	}
  5905  	c.urlParams_.Set("alt", alt)
  5906  	c.urlParams_.Set("prettyPrint", "false")
  5907  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:seek")
  5908  	urls += "?" + c.urlParams_.Encode()
  5909  	req, err := http.NewRequest("POST", urls, body)
  5910  	if err != nil {
  5911  		return nil, err
  5912  	}
  5913  	req.Header = reqHeaders
  5914  	googleapi.Expand(req.URL, map[string]string{
  5915  		"subscription": c.subscription,
  5916  	})
  5917  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5918  }
  5919  
  5920  // Do executes the "pubsub.projects.subscriptions.seek" call.
  5921  // Any non-2xx status code is an error. Response headers are in either
  5922  // *SeekResponse.ServerResponse.Header or (if a response was returned at all)
  5923  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5924  // whether the returned error was because http.StatusNotModified was returned.
  5925  func (c *ProjectsSubscriptionsSeekCall) Do(opts ...googleapi.CallOption) (*SeekResponse, error) {
  5926  	gensupport.SetOptions(c.urlParams_, opts...)
  5927  	res, err := c.doRequest("json")
  5928  	if res != nil && res.StatusCode == http.StatusNotModified {
  5929  		if res.Body != nil {
  5930  			res.Body.Close()
  5931  		}
  5932  		return nil, gensupport.WrapError(&googleapi.Error{
  5933  			Code:   res.StatusCode,
  5934  			Header: res.Header,
  5935  		})
  5936  	}
  5937  	if err != nil {
  5938  		return nil, err
  5939  	}
  5940  	defer googleapi.CloseBody(res)
  5941  	if err := googleapi.CheckResponse(res); err != nil {
  5942  		return nil, gensupport.WrapError(err)
  5943  	}
  5944  	ret := &SeekResponse{
  5945  		ServerResponse: googleapi.ServerResponse{
  5946  			Header:         res.Header,
  5947  			HTTPStatusCode: res.StatusCode,
  5948  		},
  5949  	}
  5950  	target := &ret
  5951  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5952  		return nil, err
  5953  	}
  5954  	return ret, nil
  5955  }
  5956  
  5957  type ProjectsSubscriptionsSetIamPolicyCall struct {
  5958  	s                   *Service
  5959  	resource            string
  5960  	setiampolicyrequest *SetIamPolicyRequest
  5961  	urlParams_          gensupport.URLParams
  5962  	ctx_                context.Context
  5963  	header_             http.Header
  5964  }
  5965  
  5966  // SetIamPolicy: Sets the access control policy on the specified resource.
  5967  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  5968  // and `PERMISSION_DENIED` errors.
  5969  //
  5970  //   - resource: REQUIRED: The resource for which the policy is being specified.
  5971  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  5972  //     for the appropriate value for this field.
  5973  func (r *ProjectsSubscriptionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSubscriptionsSetIamPolicyCall {
  5974  	c := &ProjectsSubscriptionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5975  	c.resource = resource
  5976  	c.setiampolicyrequest = setiampolicyrequest
  5977  	return c
  5978  }
  5979  
  5980  // Fields allows partial responses to be retrieved. See
  5981  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5982  // details.
  5983  func (c *ProjectsSubscriptionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsSetIamPolicyCall {
  5984  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5985  	return c
  5986  }
  5987  
  5988  // Context sets the context to be used in this call's Do method.
  5989  func (c *ProjectsSubscriptionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSubscriptionsSetIamPolicyCall {
  5990  	c.ctx_ = ctx
  5991  	return c
  5992  }
  5993  
  5994  // Header returns a http.Header that can be modified by the caller to add
  5995  // headers to the request.
  5996  func (c *ProjectsSubscriptionsSetIamPolicyCall) Header() http.Header {
  5997  	if c.header_ == nil {
  5998  		c.header_ = make(http.Header)
  5999  	}
  6000  	return c.header_
  6001  }
  6002  
  6003  func (c *ProjectsSubscriptionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6004  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6005  	var body io.Reader = nil
  6006  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  6007  	if err != nil {
  6008  		return nil, err
  6009  	}
  6010  	c.urlParams_.Set("alt", alt)
  6011  	c.urlParams_.Set("prettyPrint", "false")
  6012  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  6013  	urls += "?" + c.urlParams_.Encode()
  6014  	req, err := http.NewRequest("POST", urls, body)
  6015  	if err != nil {
  6016  		return nil, err
  6017  	}
  6018  	req.Header = reqHeaders
  6019  	googleapi.Expand(req.URL, map[string]string{
  6020  		"resource": c.resource,
  6021  	})
  6022  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6023  }
  6024  
  6025  // Do executes the "pubsub.projects.subscriptions.setIamPolicy" call.
  6026  // Any non-2xx status code is an error. Response headers are in either
  6027  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  6028  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6029  // whether the returned error was because http.StatusNotModified was returned.
  6030  func (c *ProjectsSubscriptionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6031  	gensupport.SetOptions(c.urlParams_, opts...)
  6032  	res, err := c.doRequest("json")
  6033  	if res != nil && res.StatusCode == http.StatusNotModified {
  6034  		if res.Body != nil {
  6035  			res.Body.Close()
  6036  		}
  6037  		return nil, gensupport.WrapError(&googleapi.Error{
  6038  			Code:   res.StatusCode,
  6039  			Header: res.Header,
  6040  		})
  6041  	}
  6042  	if err != nil {
  6043  		return nil, err
  6044  	}
  6045  	defer googleapi.CloseBody(res)
  6046  	if err := googleapi.CheckResponse(res); err != nil {
  6047  		return nil, gensupport.WrapError(err)
  6048  	}
  6049  	ret := &Policy{
  6050  		ServerResponse: googleapi.ServerResponse{
  6051  			Header:         res.Header,
  6052  			HTTPStatusCode: res.StatusCode,
  6053  		},
  6054  	}
  6055  	target := &ret
  6056  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6057  		return nil, err
  6058  	}
  6059  	return ret, nil
  6060  }
  6061  
  6062  type ProjectsSubscriptionsTestIamPermissionsCall struct {
  6063  	s                         *Service
  6064  	resource                  string
  6065  	testiampermissionsrequest *TestIamPermissionsRequest
  6066  	urlParams_                gensupport.URLParams
  6067  	ctx_                      context.Context
  6068  	header_                   http.Header
  6069  }
  6070  
  6071  // TestIamPermissions: Returns permissions that a caller has on the specified
  6072  // resource. If the resource does not exist, this will return an empty set of
  6073  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  6074  // used for building permission-aware UIs and command-line tools, not for
  6075  // authorization checking. This operation may "fail open" without warning.
  6076  //
  6077  //   - resource: REQUIRED: The resource for which the policy detail is being
  6078  //     requested. See Resource names
  6079  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  6080  //     value for this field.
  6081  func (r *ProjectsSubscriptionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSubscriptionsTestIamPermissionsCall {
  6082  	c := &ProjectsSubscriptionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6083  	c.resource = resource
  6084  	c.testiampermissionsrequest = testiampermissionsrequest
  6085  	return c
  6086  }
  6087  
  6088  // Fields allows partial responses to be retrieved. See
  6089  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6090  // details.
  6091  func (c *ProjectsSubscriptionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsTestIamPermissionsCall {
  6092  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6093  	return c
  6094  }
  6095  
  6096  // Context sets the context to be used in this call's Do method.
  6097  func (c *ProjectsSubscriptionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSubscriptionsTestIamPermissionsCall {
  6098  	c.ctx_ = ctx
  6099  	return c
  6100  }
  6101  
  6102  // Header returns a http.Header that can be modified by the caller to add
  6103  // headers to the request.
  6104  func (c *ProjectsSubscriptionsTestIamPermissionsCall) Header() http.Header {
  6105  	if c.header_ == nil {
  6106  		c.header_ = make(http.Header)
  6107  	}
  6108  	return c.header_
  6109  }
  6110  
  6111  func (c *ProjectsSubscriptionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  6112  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6113  	var body io.Reader = nil
  6114  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  6115  	if err != nil {
  6116  		return nil, err
  6117  	}
  6118  	c.urlParams_.Set("alt", alt)
  6119  	c.urlParams_.Set("prettyPrint", "false")
  6120  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  6121  	urls += "?" + c.urlParams_.Encode()
  6122  	req, err := http.NewRequest("POST", urls, body)
  6123  	if err != nil {
  6124  		return nil, err
  6125  	}
  6126  	req.Header = reqHeaders
  6127  	googleapi.Expand(req.URL, map[string]string{
  6128  		"resource": c.resource,
  6129  	})
  6130  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6131  }
  6132  
  6133  // Do executes the "pubsub.projects.subscriptions.testIamPermissions" call.
  6134  // Any non-2xx status code is an error. Response headers are in either
  6135  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  6136  // returned at all) in error.(*googleapi.Error).Header. Use
  6137  // googleapi.IsNotModified to check whether the returned error was because
  6138  // http.StatusNotModified was returned.
  6139  func (c *ProjectsSubscriptionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  6140  	gensupport.SetOptions(c.urlParams_, opts...)
  6141  	res, err := c.doRequest("json")
  6142  	if res != nil && res.StatusCode == http.StatusNotModified {
  6143  		if res.Body != nil {
  6144  			res.Body.Close()
  6145  		}
  6146  		return nil, gensupport.WrapError(&googleapi.Error{
  6147  			Code:   res.StatusCode,
  6148  			Header: res.Header,
  6149  		})
  6150  	}
  6151  	if err != nil {
  6152  		return nil, err
  6153  	}
  6154  	defer googleapi.CloseBody(res)
  6155  	if err := googleapi.CheckResponse(res); err != nil {
  6156  		return nil, gensupport.WrapError(err)
  6157  	}
  6158  	ret := &TestIamPermissionsResponse{
  6159  		ServerResponse: googleapi.ServerResponse{
  6160  			Header:         res.Header,
  6161  			HTTPStatusCode: res.StatusCode,
  6162  		},
  6163  	}
  6164  	target := &ret
  6165  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6166  		return nil, err
  6167  	}
  6168  	return ret, nil
  6169  }
  6170  
  6171  type ProjectsTopicsCreateCall struct {
  6172  	s          *Service
  6173  	name       string
  6174  	topic      *Topic
  6175  	urlParams_ gensupport.URLParams
  6176  	ctx_       context.Context
  6177  	header_    http.Header
  6178  }
  6179  
  6180  // Create: Creates the given topic with the given name. See the [resource name
  6181  // rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
  6182  //
  6183  //   - name: The name of the topic. It must have the format
  6184  //     "projects/{project}/topics/{topic}". `{topic}` must start with a letter,
  6185  //     and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
  6186  //     underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
  6187  //     signs (`%`). It must be between 3 and 255 characters in length, and it
  6188  //     must not start with "goog".
  6189  func (r *ProjectsTopicsService) Create(name string, topic *Topic) *ProjectsTopicsCreateCall {
  6190  	c := &ProjectsTopicsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6191  	c.name = name
  6192  	c.topic = topic
  6193  	return c
  6194  }
  6195  
  6196  // Fields allows partial responses to be retrieved. See
  6197  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6198  // details.
  6199  func (c *ProjectsTopicsCreateCall) Fields(s ...googleapi.Field) *ProjectsTopicsCreateCall {
  6200  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6201  	return c
  6202  }
  6203  
  6204  // Context sets the context to be used in this call's Do method.
  6205  func (c *ProjectsTopicsCreateCall) Context(ctx context.Context) *ProjectsTopicsCreateCall {
  6206  	c.ctx_ = ctx
  6207  	return c
  6208  }
  6209  
  6210  // Header returns a http.Header that can be modified by the caller to add
  6211  // headers to the request.
  6212  func (c *ProjectsTopicsCreateCall) Header() http.Header {
  6213  	if c.header_ == nil {
  6214  		c.header_ = make(http.Header)
  6215  	}
  6216  	return c.header_
  6217  }
  6218  
  6219  func (c *ProjectsTopicsCreateCall) doRequest(alt string) (*http.Response, error) {
  6220  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6221  	var body io.Reader = nil
  6222  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic)
  6223  	if err != nil {
  6224  		return nil, err
  6225  	}
  6226  	c.urlParams_.Set("alt", alt)
  6227  	c.urlParams_.Set("prettyPrint", "false")
  6228  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6229  	urls += "?" + c.urlParams_.Encode()
  6230  	req, err := http.NewRequest("PUT", urls, body)
  6231  	if err != nil {
  6232  		return nil, err
  6233  	}
  6234  	req.Header = reqHeaders
  6235  	googleapi.Expand(req.URL, map[string]string{
  6236  		"name": c.name,
  6237  	})
  6238  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6239  }
  6240  
  6241  // Do executes the "pubsub.projects.topics.create" call.
  6242  // Any non-2xx status code is an error. Response headers are in either
  6243  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  6244  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6245  // whether the returned error was because http.StatusNotModified was returned.
  6246  func (c *ProjectsTopicsCreateCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  6247  	gensupport.SetOptions(c.urlParams_, opts...)
  6248  	res, err := c.doRequest("json")
  6249  	if res != nil && res.StatusCode == http.StatusNotModified {
  6250  		if res.Body != nil {
  6251  			res.Body.Close()
  6252  		}
  6253  		return nil, gensupport.WrapError(&googleapi.Error{
  6254  			Code:   res.StatusCode,
  6255  			Header: res.Header,
  6256  		})
  6257  	}
  6258  	if err != nil {
  6259  		return nil, err
  6260  	}
  6261  	defer googleapi.CloseBody(res)
  6262  	if err := googleapi.CheckResponse(res); err != nil {
  6263  		return nil, gensupport.WrapError(err)
  6264  	}
  6265  	ret := &Topic{
  6266  		ServerResponse: googleapi.ServerResponse{
  6267  			Header:         res.Header,
  6268  			HTTPStatusCode: res.StatusCode,
  6269  		},
  6270  	}
  6271  	target := &ret
  6272  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6273  		return nil, err
  6274  	}
  6275  	return ret, nil
  6276  }
  6277  
  6278  type ProjectsTopicsDeleteCall struct {
  6279  	s          *Service
  6280  	topic      string
  6281  	urlParams_ gensupport.URLParams
  6282  	ctx_       context.Context
  6283  	header_    http.Header
  6284  }
  6285  
  6286  // Delete: Deletes the topic with the given name. Returns `NOT_FOUND` if the
  6287  // topic does not exist. After a topic is deleted, a new topic may be created
  6288  // with the same name; this is an entirely new topic with none of the old
  6289  // configuration or subscriptions. Existing subscriptions to this topic are not
  6290  // deleted, but their `topic` field is set to `_deleted-topic_`.
  6291  //
  6292  //   - topic: Name of the topic to delete. Format is
  6293  //     `projects/{project}/topics/{topic}`.
  6294  func (r *ProjectsTopicsService) Delete(topic string) *ProjectsTopicsDeleteCall {
  6295  	c := &ProjectsTopicsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6296  	c.topic = topic
  6297  	return c
  6298  }
  6299  
  6300  // Fields allows partial responses to be retrieved. See
  6301  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6302  // details.
  6303  func (c *ProjectsTopicsDeleteCall) Fields(s ...googleapi.Field) *ProjectsTopicsDeleteCall {
  6304  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6305  	return c
  6306  }
  6307  
  6308  // Context sets the context to be used in this call's Do method.
  6309  func (c *ProjectsTopicsDeleteCall) Context(ctx context.Context) *ProjectsTopicsDeleteCall {
  6310  	c.ctx_ = ctx
  6311  	return c
  6312  }
  6313  
  6314  // Header returns a http.Header that can be modified by the caller to add
  6315  // headers to the request.
  6316  func (c *ProjectsTopicsDeleteCall) Header() http.Header {
  6317  	if c.header_ == nil {
  6318  		c.header_ = make(http.Header)
  6319  	}
  6320  	return c.header_
  6321  }
  6322  
  6323  func (c *ProjectsTopicsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6324  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6325  	var body io.Reader = nil
  6326  	c.urlParams_.Set("alt", alt)
  6327  	c.urlParams_.Set("prettyPrint", "false")
  6328  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}")
  6329  	urls += "?" + c.urlParams_.Encode()
  6330  	req, err := http.NewRequest("DELETE", urls, body)
  6331  	if err != nil {
  6332  		return nil, err
  6333  	}
  6334  	req.Header = reqHeaders
  6335  	googleapi.Expand(req.URL, map[string]string{
  6336  		"topic": c.topic,
  6337  	})
  6338  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6339  }
  6340  
  6341  // Do executes the "pubsub.projects.topics.delete" call.
  6342  // Any non-2xx status code is an error. Response headers are in either
  6343  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  6344  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6345  // whether the returned error was because http.StatusNotModified was returned.
  6346  func (c *ProjectsTopicsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6347  	gensupport.SetOptions(c.urlParams_, opts...)
  6348  	res, err := c.doRequest("json")
  6349  	if res != nil && res.StatusCode == http.StatusNotModified {
  6350  		if res.Body != nil {
  6351  			res.Body.Close()
  6352  		}
  6353  		return nil, gensupport.WrapError(&googleapi.Error{
  6354  			Code:   res.StatusCode,
  6355  			Header: res.Header,
  6356  		})
  6357  	}
  6358  	if err != nil {
  6359  		return nil, err
  6360  	}
  6361  	defer googleapi.CloseBody(res)
  6362  	if err := googleapi.CheckResponse(res); err != nil {
  6363  		return nil, gensupport.WrapError(err)
  6364  	}
  6365  	ret := &Empty{
  6366  		ServerResponse: googleapi.ServerResponse{
  6367  			Header:         res.Header,
  6368  			HTTPStatusCode: res.StatusCode,
  6369  		},
  6370  	}
  6371  	target := &ret
  6372  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6373  		return nil, err
  6374  	}
  6375  	return ret, nil
  6376  }
  6377  
  6378  type ProjectsTopicsGetCall struct {
  6379  	s            *Service
  6380  	topic        string
  6381  	urlParams_   gensupport.URLParams
  6382  	ifNoneMatch_ string
  6383  	ctx_         context.Context
  6384  	header_      http.Header
  6385  }
  6386  
  6387  // Get: Gets the configuration of a topic.
  6388  //
  6389  //   - topic: The name of the topic to get. Format is
  6390  //     `projects/{project}/topics/{topic}`.
  6391  func (r *ProjectsTopicsService) Get(topic string) *ProjectsTopicsGetCall {
  6392  	c := &ProjectsTopicsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6393  	c.topic = topic
  6394  	return c
  6395  }
  6396  
  6397  // Fields allows partial responses to be retrieved. See
  6398  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6399  // details.
  6400  func (c *ProjectsTopicsGetCall) Fields(s ...googleapi.Field) *ProjectsTopicsGetCall {
  6401  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6402  	return c
  6403  }
  6404  
  6405  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6406  // object's ETag matches the given value. This is useful for getting updates
  6407  // only after the object has changed since the last request.
  6408  func (c *ProjectsTopicsGetCall) IfNoneMatch(entityTag string) *ProjectsTopicsGetCall {
  6409  	c.ifNoneMatch_ = entityTag
  6410  	return c
  6411  }
  6412  
  6413  // Context sets the context to be used in this call's Do method.
  6414  func (c *ProjectsTopicsGetCall) Context(ctx context.Context) *ProjectsTopicsGetCall {
  6415  	c.ctx_ = ctx
  6416  	return c
  6417  }
  6418  
  6419  // Header returns a http.Header that can be modified by the caller to add
  6420  // headers to the request.
  6421  func (c *ProjectsTopicsGetCall) Header() http.Header {
  6422  	if c.header_ == nil {
  6423  		c.header_ = make(http.Header)
  6424  	}
  6425  	return c.header_
  6426  }
  6427  
  6428  func (c *ProjectsTopicsGetCall) doRequest(alt string) (*http.Response, error) {
  6429  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6430  	if c.ifNoneMatch_ != "" {
  6431  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6432  	}
  6433  	var body io.Reader = nil
  6434  	c.urlParams_.Set("alt", alt)
  6435  	c.urlParams_.Set("prettyPrint", "false")
  6436  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}")
  6437  	urls += "?" + c.urlParams_.Encode()
  6438  	req, err := http.NewRequest("GET", urls, body)
  6439  	if err != nil {
  6440  		return nil, err
  6441  	}
  6442  	req.Header = reqHeaders
  6443  	googleapi.Expand(req.URL, map[string]string{
  6444  		"topic": c.topic,
  6445  	})
  6446  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6447  }
  6448  
  6449  // Do executes the "pubsub.projects.topics.get" call.
  6450  // Any non-2xx status code is an error. Response headers are in either
  6451  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  6452  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6453  // whether the returned error was because http.StatusNotModified was returned.
  6454  func (c *ProjectsTopicsGetCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  6455  	gensupport.SetOptions(c.urlParams_, opts...)
  6456  	res, err := c.doRequest("json")
  6457  	if res != nil && res.StatusCode == http.StatusNotModified {
  6458  		if res.Body != nil {
  6459  			res.Body.Close()
  6460  		}
  6461  		return nil, gensupport.WrapError(&googleapi.Error{
  6462  			Code:   res.StatusCode,
  6463  			Header: res.Header,
  6464  		})
  6465  	}
  6466  	if err != nil {
  6467  		return nil, err
  6468  	}
  6469  	defer googleapi.CloseBody(res)
  6470  	if err := googleapi.CheckResponse(res); err != nil {
  6471  		return nil, gensupport.WrapError(err)
  6472  	}
  6473  	ret := &Topic{
  6474  		ServerResponse: googleapi.ServerResponse{
  6475  			Header:         res.Header,
  6476  			HTTPStatusCode: res.StatusCode,
  6477  		},
  6478  	}
  6479  	target := &ret
  6480  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6481  		return nil, err
  6482  	}
  6483  	return ret, nil
  6484  }
  6485  
  6486  type ProjectsTopicsGetIamPolicyCall struct {
  6487  	s            *Service
  6488  	resource     string
  6489  	urlParams_   gensupport.URLParams
  6490  	ifNoneMatch_ string
  6491  	ctx_         context.Context
  6492  	header_      http.Header
  6493  }
  6494  
  6495  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  6496  // empty policy if the resource exists and does not have a policy set.
  6497  //
  6498  //   - resource: REQUIRED: The resource for which the policy is being requested.
  6499  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  6500  //     for the appropriate value for this field.
  6501  func (r *ProjectsTopicsService) GetIamPolicy(resource string) *ProjectsTopicsGetIamPolicyCall {
  6502  	c := &ProjectsTopicsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6503  	c.resource = resource
  6504  	return c
  6505  }
  6506  
  6507  // OptionsRequestedPolicyVersion sets the optional parameter
  6508  // "options.requestedPolicyVersion": The maximum policy version that will be
  6509  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  6510  // an invalid value will be rejected. Requests for policies with any
  6511  // conditional role bindings must specify version 3. Policies with no
  6512  // conditional role bindings may specify any valid value or leave the field
  6513  // unset. The policy in the response might use the policy version that you
  6514  // specified, or it might use a lower policy version. For example, if you
  6515  // specify version 3, but the policy has no conditional role bindings, the
  6516  // response uses version 1. To learn which resources support conditions in
  6517  // their IAM policies, see the IAM documentation
  6518  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  6519  func (c *ProjectsTopicsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsTopicsGetIamPolicyCall {
  6520  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  6521  	return c
  6522  }
  6523  
  6524  // Fields allows partial responses to be retrieved. See
  6525  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6526  // details.
  6527  func (c *ProjectsTopicsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsTopicsGetIamPolicyCall {
  6528  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6529  	return c
  6530  }
  6531  
  6532  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6533  // object's ETag matches the given value. This is useful for getting updates
  6534  // only after the object has changed since the last request.
  6535  func (c *ProjectsTopicsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsTopicsGetIamPolicyCall {
  6536  	c.ifNoneMatch_ = entityTag
  6537  	return c
  6538  }
  6539  
  6540  // Context sets the context to be used in this call's Do method.
  6541  func (c *ProjectsTopicsGetIamPolicyCall) Context(ctx context.Context) *ProjectsTopicsGetIamPolicyCall {
  6542  	c.ctx_ = ctx
  6543  	return c
  6544  }
  6545  
  6546  // Header returns a http.Header that can be modified by the caller to add
  6547  // headers to the request.
  6548  func (c *ProjectsTopicsGetIamPolicyCall) Header() http.Header {
  6549  	if c.header_ == nil {
  6550  		c.header_ = make(http.Header)
  6551  	}
  6552  	return c.header_
  6553  }
  6554  
  6555  func (c *ProjectsTopicsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6556  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6557  	if c.ifNoneMatch_ != "" {
  6558  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6559  	}
  6560  	var body io.Reader = nil
  6561  	c.urlParams_.Set("alt", alt)
  6562  	c.urlParams_.Set("prettyPrint", "false")
  6563  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  6564  	urls += "?" + c.urlParams_.Encode()
  6565  	req, err := http.NewRequest("GET", urls, body)
  6566  	if err != nil {
  6567  		return nil, err
  6568  	}
  6569  	req.Header = reqHeaders
  6570  	googleapi.Expand(req.URL, map[string]string{
  6571  		"resource": c.resource,
  6572  	})
  6573  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6574  }
  6575  
  6576  // Do executes the "pubsub.projects.topics.getIamPolicy" call.
  6577  // Any non-2xx status code is an error. Response headers are in either
  6578  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  6579  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6580  // whether the returned error was because http.StatusNotModified was returned.
  6581  func (c *ProjectsTopicsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6582  	gensupport.SetOptions(c.urlParams_, opts...)
  6583  	res, err := c.doRequest("json")
  6584  	if res != nil && res.StatusCode == http.StatusNotModified {
  6585  		if res.Body != nil {
  6586  			res.Body.Close()
  6587  		}
  6588  		return nil, gensupport.WrapError(&googleapi.Error{
  6589  			Code:   res.StatusCode,
  6590  			Header: res.Header,
  6591  		})
  6592  	}
  6593  	if err != nil {
  6594  		return nil, err
  6595  	}
  6596  	defer googleapi.CloseBody(res)
  6597  	if err := googleapi.CheckResponse(res); err != nil {
  6598  		return nil, gensupport.WrapError(err)
  6599  	}
  6600  	ret := &Policy{
  6601  		ServerResponse: googleapi.ServerResponse{
  6602  			Header:         res.Header,
  6603  			HTTPStatusCode: res.StatusCode,
  6604  		},
  6605  	}
  6606  	target := &ret
  6607  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6608  		return nil, err
  6609  	}
  6610  	return ret, nil
  6611  }
  6612  
  6613  type ProjectsTopicsListCall struct {
  6614  	s            *Service
  6615  	project      string
  6616  	urlParams_   gensupport.URLParams
  6617  	ifNoneMatch_ string
  6618  	ctx_         context.Context
  6619  	header_      http.Header
  6620  }
  6621  
  6622  // List: Lists matching topics.
  6623  //
  6624  //   - project: The name of the project in which to list topics. Format is
  6625  //     `projects/{project-id}`.
  6626  func (r *ProjectsTopicsService) List(project string) *ProjectsTopicsListCall {
  6627  	c := &ProjectsTopicsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6628  	c.project = project
  6629  	return c
  6630  }
  6631  
  6632  // PageSize sets the optional parameter "pageSize": Maximum number of topics to
  6633  // return.
  6634  func (c *ProjectsTopicsListCall) PageSize(pageSize int64) *ProjectsTopicsListCall {
  6635  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6636  	return c
  6637  }
  6638  
  6639  // PageToken sets the optional parameter "pageToken": The value returned by the
  6640  // last `ListTopicsResponse`; indicates that this is a continuation of a prior
  6641  // `ListTopics` call, and that the system should return the next page of data.
  6642  func (c *ProjectsTopicsListCall) PageToken(pageToken string) *ProjectsTopicsListCall {
  6643  	c.urlParams_.Set("pageToken", pageToken)
  6644  	return c
  6645  }
  6646  
  6647  // Fields allows partial responses to be retrieved. See
  6648  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6649  // details.
  6650  func (c *ProjectsTopicsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsListCall {
  6651  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6652  	return c
  6653  }
  6654  
  6655  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6656  // object's ETag matches the given value. This is useful for getting updates
  6657  // only after the object has changed since the last request.
  6658  func (c *ProjectsTopicsListCall) IfNoneMatch(entityTag string) *ProjectsTopicsListCall {
  6659  	c.ifNoneMatch_ = entityTag
  6660  	return c
  6661  }
  6662  
  6663  // Context sets the context to be used in this call's Do method.
  6664  func (c *ProjectsTopicsListCall) Context(ctx context.Context) *ProjectsTopicsListCall {
  6665  	c.ctx_ = ctx
  6666  	return c
  6667  }
  6668  
  6669  // Header returns a http.Header that can be modified by the caller to add
  6670  // headers to the request.
  6671  func (c *ProjectsTopicsListCall) Header() http.Header {
  6672  	if c.header_ == nil {
  6673  		c.header_ = make(http.Header)
  6674  	}
  6675  	return c.header_
  6676  }
  6677  
  6678  func (c *ProjectsTopicsListCall) doRequest(alt string) (*http.Response, error) {
  6679  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6680  	if c.ifNoneMatch_ != "" {
  6681  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6682  	}
  6683  	var body io.Reader = nil
  6684  	c.urlParams_.Set("alt", alt)
  6685  	c.urlParams_.Set("prettyPrint", "false")
  6686  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/topics")
  6687  	urls += "?" + c.urlParams_.Encode()
  6688  	req, err := http.NewRequest("GET", urls, body)
  6689  	if err != nil {
  6690  		return nil, err
  6691  	}
  6692  	req.Header = reqHeaders
  6693  	googleapi.Expand(req.URL, map[string]string{
  6694  		"project": c.project,
  6695  	})
  6696  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6697  }
  6698  
  6699  // Do executes the "pubsub.projects.topics.list" call.
  6700  // Any non-2xx status code is an error. Response headers are in either
  6701  // *ListTopicsResponse.ServerResponse.Header or (if a response was returned at
  6702  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6703  // check whether the returned error was because http.StatusNotModified was
  6704  // returned.
  6705  func (c *ProjectsTopicsListCall) Do(opts ...googleapi.CallOption) (*ListTopicsResponse, error) {
  6706  	gensupport.SetOptions(c.urlParams_, opts...)
  6707  	res, err := c.doRequest("json")
  6708  	if res != nil && res.StatusCode == http.StatusNotModified {
  6709  		if res.Body != nil {
  6710  			res.Body.Close()
  6711  		}
  6712  		return nil, gensupport.WrapError(&googleapi.Error{
  6713  			Code:   res.StatusCode,
  6714  			Header: res.Header,
  6715  		})
  6716  	}
  6717  	if err != nil {
  6718  		return nil, err
  6719  	}
  6720  	defer googleapi.CloseBody(res)
  6721  	if err := googleapi.CheckResponse(res); err != nil {
  6722  		return nil, gensupport.WrapError(err)
  6723  	}
  6724  	ret := &ListTopicsResponse{
  6725  		ServerResponse: googleapi.ServerResponse{
  6726  			Header:         res.Header,
  6727  			HTTPStatusCode: res.StatusCode,
  6728  		},
  6729  	}
  6730  	target := &ret
  6731  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6732  		return nil, err
  6733  	}
  6734  	return ret, nil
  6735  }
  6736  
  6737  // Pages invokes f for each page of results.
  6738  // A non-nil error returned from f will halt the iteration.
  6739  // The provided context supersedes any context provided to the Context method.
  6740  func (c *ProjectsTopicsListCall) Pages(ctx context.Context, f func(*ListTopicsResponse) error) error {
  6741  	c.ctx_ = ctx
  6742  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6743  	for {
  6744  		x, err := c.Do()
  6745  		if err != nil {
  6746  			return err
  6747  		}
  6748  		if err := f(x); err != nil {
  6749  			return err
  6750  		}
  6751  		if x.NextPageToken == "" {
  6752  			return nil
  6753  		}
  6754  		c.PageToken(x.NextPageToken)
  6755  	}
  6756  }
  6757  
  6758  type ProjectsTopicsPatchCall struct {
  6759  	s                  *Service
  6760  	name               string
  6761  	updatetopicrequest *UpdateTopicRequest
  6762  	urlParams_         gensupport.URLParams
  6763  	ctx_               context.Context
  6764  	header_            http.Header
  6765  }
  6766  
  6767  // Patch: Updates an existing topic by updating the fields specified in the
  6768  // update mask. Note that certain properties of a topic are not modifiable.
  6769  //
  6770  //   - name: The name of the topic. It must have the format
  6771  //     "projects/{project}/topics/{topic}". `{topic}` must start with a letter,
  6772  //     and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
  6773  //     underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
  6774  //     signs (`%`). It must be between 3 and 255 characters in length, and it
  6775  //     must not start with "goog".
  6776  func (r *ProjectsTopicsService) Patch(name string, updatetopicrequest *UpdateTopicRequest) *ProjectsTopicsPatchCall {
  6777  	c := &ProjectsTopicsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6778  	c.name = name
  6779  	c.updatetopicrequest = updatetopicrequest
  6780  	return c
  6781  }
  6782  
  6783  // Fields allows partial responses to be retrieved. See
  6784  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6785  // details.
  6786  func (c *ProjectsTopicsPatchCall) Fields(s ...googleapi.Field) *ProjectsTopicsPatchCall {
  6787  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6788  	return c
  6789  }
  6790  
  6791  // Context sets the context to be used in this call's Do method.
  6792  func (c *ProjectsTopicsPatchCall) Context(ctx context.Context) *ProjectsTopicsPatchCall {
  6793  	c.ctx_ = ctx
  6794  	return c
  6795  }
  6796  
  6797  // Header returns a http.Header that can be modified by the caller to add
  6798  // headers to the request.
  6799  func (c *ProjectsTopicsPatchCall) Header() http.Header {
  6800  	if c.header_ == nil {
  6801  		c.header_ = make(http.Header)
  6802  	}
  6803  	return c.header_
  6804  }
  6805  
  6806  func (c *ProjectsTopicsPatchCall) doRequest(alt string) (*http.Response, error) {
  6807  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6808  	var body io.Reader = nil
  6809  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatetopicrequest)
  6810  	if err != nil {
  6811  		return nil, err
  6812  	}
  6813  	c.urlParams_.Set("alt", alt)
  6814  	c.urlParams_.Set("prettyPrint", "false")
  6815  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6816  	urls += "?" + c.urlParams_.Encode()
  6817  	req, err := http.NewRequest("PATCH", urls, body)
  6818  	if err != nil {
  6819  		return nil, err
  6820  	}
  6821  	req.Header = reqHeaders
  6822  	googleapi.Expand(req.URL, map[string]string{
  6823  		"name": c.name,
  6824  	})
  6825  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6826  }
  6827  
  6828  // Do executes the "pubsub.projects.topics.patch" call.
  6829  // Any non-2xx status code is an error. Response headers are in either
  6830  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  6831  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6832  // whether the returned error was because http.StatusNotModified was returned.
  6833  func (c *ProjectsTopicsPatchCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  6834  	gensupport.SetOptions(c.urlParams_, opts...)
  6835  	res, err := c.doRequest("json")
  6836  	if res != nil && res.StatusCode == http.StatusNotModified {
  6837  		if res.Body != nil {
  6838  			res.Body.Close()
  6839  		}
  6840  		return nil, gensupport.WrapError(&googleapi.Error{
  6841  			Code:   res.StatusCode,
  6842  			Header: res.Header,
  6843  		})
  6844  	}
  6845  	if err != nil {
  6846  		return nil, err
  6847  	}
  6848  	defer googleapi.CloseBody(res)
  6849  	if err := googleapi.CheckResponse(res); err != nil {
  6850  		return nil, gensupport.WrapError(err)
  6851  	}
  6852  	ret := &Topic{
  6853  		ServerResponse: googleapi.ServerResponse{
  6854  			Header:         res.Header,
  6855  			HTTPStatusCode: res.StatusCode,
  6856  		},
  6857  	}
  6858  	target := &ret
  6859  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6860  		return nil, err
  6861  	}
  6862  	return ret, nil
  6863  }
  6864  
  6865  type ProjectsTopicsPublishCall struct {
  6866  	s              *Service
  6867  	topic          string
  6868  	publishrequest *PublishRequest
  6869  	urlParams_     gensupport.URLParams
  6870  	ctx_           context.Context
  6871  	header_        http.Header
  6872  }
  6873  
  6874  // Publish: Adds one or more messages to the topic. Returns `NOT_FOUND` if the
  6875  // topic does not exist.
  6876  //
  6877  //   - topic: The messages in the request will be published on this topic. Format
  6878  //     is `projects/{project}/topics/{topic}`.
  6879  func (r *ProjectsTopicsService) Publish(topic string, publishrequest *PublishRequest) *ProjectsTopicsPublishCall {
  6880  	c := &ProjectsTopicsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6881  	c.topic = topic
  6882  	c.publishrequest = publishrequest
  6883  	return c
  6884  }
  6885  
  6886  // Fields allows partial responses to be retrieved. See
  6887  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6888  // details.
  6889  func (c *ProjectsTopicsPublishCall) Fields(s ...googleapi.Field) *ProjectsTopicsPublishCall {
  6890  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6891  	return c
  6892  }
  6893  
  6894  // Context sets the context to be used in this call's Do method.
  6895  func (c *ProjectsTopicsPublishCall) Context(ctx context.Context) *ProjectsTopicsPublishCall {
  6896  	c.ctx_ = ctx
  6897  	return c
  6898  }
  6899  
  6900  // Header returns a http.Header that can be modified by the caller to add
  6901  // headers to the request.
  6902  func (c *ProjectsTopicsPublishCall) Header() http.Header {
  6903  	if c.header_ == nil {
  6904  		c.header_ = make(http.Header)
  6905  	}
  6906  	return c.header_
  6907  }
  6908  
  6909  func (c *ProjectsTopicsPublishCall) doRequest(alt string) (*http.Response, error) {
  6910  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6911  	var body io.Reader = nil
  6912  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest)
  6913  	if err != nil {
  6914  		return nil, err
  6915  	}
  6916  	c.urlParams_.Set("alt", alt)
  6917  	c.urlParams_.Set("prettyPrint", "false")
  6918  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}:publish")
  6919  	urls += "?" + c.urlParams_.Encode()
  6920  	req, err := http.NewRequest("POST", urls, body)
  6921  	if err != nil {
  6922  		return nil, err
  6923  	}
  6924  	req.Header = reqHeaders
  6925  	googleapi.Expand(req.URL, map[string]string{
  6926  		"topic": c.topic,
  6927  	})
  6928  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6929  }
  6930  
  6931  // Do executes the "pubsub.projects.topics.publish" call.
  6932  // Any non-2xx status code is an error. Response headers are in either
  6933  // *PublishResponse.ServerResponse.Header or (if a response was returned at
  6934  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6935  // check whether the returned error was because http.StatusNotModified was
  6936  // returned.
  6937  func (c *ProjectsTopicsPublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  6938  	gensupport.SetOptions(c.urlParams_, opts...)
  6939  	res, err := c.doRequest("json")
  6940  	if res != nil && res.StatusCode == http.StatusNotModified {
  6941  		if res.Body != nil {
  6942  			res.Body.Close()
  6943  		}
  6944  		return nil, gensupport.WrapError(&googleapi.Error{
  6945  			Code:   res.StatusCode,
  6946  			Header: res.Header,
  6947  		})
  6948  	}
  6949  	if err != nil {
  6950  		return nil, err
  6951  	}
  6952  	defer googleapi.CloseBody(res)
  6953  	if err := googleapi.CheckResponse(res); err != nil {
  6954  		return nil, gensupport.WrapError(err)
  6955  	}
  6956  	ret := &PublishResponse{
  6957  		ServerResponse: googleapi.ServerResponse{
  6958  			Header:         res.Header,
  6959  			HTTPStatusCode: res.StatusCode,
  6960  		},
  6961  	}
  6962  	target := &ret
  6963  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6964  		return nil, err
  6965  	}
  6966  	return ret, nil
  6967  }
  6968  
  6969  type ProjectsTopicsSetIamPolicyCall struct {
  6970  	s                   *Service
  6971  	resource            string
  6972  	setiampolicyrequest *SetIamPolicyRequest
  6973  	urlParams_          gensupport.URLParams
  6974  	ctx_                context.Context
  6975  	header_             http.Header
  6976  }
  6977  
  6978  // SetIamPolicy: Sets the access control policy on the specified resource.
  6979  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  6980  // and `PERMISSION_DENIED` errors.
  6981  //
  6982  //   - resource: REQUIRED: The resource for which the policy is being specified.
  6983  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  6984  //     for the appropriate value for this field.
  6985  func (r *ProjectsTopicsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsTopicsSetIamPolicyCall {
  6986  	c := &ProjectsTopicsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6987  	c.resource = resource
  6988  	c.setiampolicyrequest = setiampolicyrequest
  6989  	return c
  6990  }
  6991  
  6992  // Fields allows partial responses to be retrieved. See
  6993  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6994  // details.
  6995  func (c *ProjectsTopicsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsTopicsSetIamPolicyCall {
  6996  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6997  	return c
  6998  }
  6999  
  7000  // Context sets the context to be used in this call's Do method.
  7001  func (c *ProjectsTopicsSetIamPolicyCall) Context(ctx context.Context) *ProjectsTopicsSetIamPolicyCall {
  7002  	c.ctx_ = ctx
  7003  	return c
  7004  }
  7005  
  7006  // Header returns a http.Header that can be modified by the caller to add
  7007  // headers to the request.
  7008  func (c *ProjectsTopicsSetIamPolicyCall) Header() http.Header {
  7009  	if c.header_ == nil {
  7010  		c.header_ = make(http.Header)
  7011  	}
  7012  	return c.header_
  7013  }
  7014  
  7015  func (c *ProjectsTopicsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7016  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7017  	var body io.Reader = nil
  7018  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  7019  	if err != nil {
  7020  		return nil, err
  7021  	}
  7022  	c.urlParams_.Set("alt", alt)
  7023  	c.urlParams_.Set("prettyPrint", "false")
  7024  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  7025  	urls += "?" + c.urlParams_.Encode()
  7026  	req, err := http.NewRequest("POST", urls, body)
  7027  	if err != nil {
  7028  		return nil, err
  7029  	}
  7030  	req.Header = reqHeaders
  7031  	googleapi.Expand(req.URL, map[string]string{
  7032  		"resource": c.resource,
  7033  	})
  7034  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7035  }
  7036  
  7037  // Do executes the "pubsub.projects.topics.setIamPolicy" call.
  7038  // Any non-2xx status code is an error. Response headers are in either
  7039  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  7040  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7041  // whether the returned error was because http.StatusNotModified was returned.
  7042  func (c *ProjectsTopicsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7043  	gensupport.SetOptions(c.urlParams_, opts...)
  7044  	res, err := c.doRequest("json")
  7045  	if res != nil && res.StatusCode == http.StatusNotModified {
  7046  		if res.Body != nil {
  7047  			res.Body.Close()
  7048  		}
  7049  		return nil, gensupport.WrapError(&googleapi.Error{
  7050  			Code:   res.StatusCode,
  7051  			Header: res.Header,
  7052  		})
  7053  	}
  7054  	if err != nil {
  7055  		return nil, err
  7056  	}
  7057  	defer googleapi.CloseBody(res)
  7058  	if err := googleapi.CheckResponse(res); err != nil {
  7059  		return nil, gensupport.WrapError(err)
  7060  	}
  7061  	ret := &Policy{
  7062  		ServerResponse: googleapi.ServerResponse{
  7063  			Header:         res.Header,
  7064  			HTTPStatusCode: res.StatusCode,
  7065  		},
  7066  	}
  7067  	target := &ret
  7068  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7069  		return nil, err
  7070  	}
  7071  	return ret, nil
  7072  }
  7073  
  7074  type ProjectsTopicsTestIamPermissionsCall struct {
  7075  	s                         *Service
  7076  	resource                  string
  7077  	testiampermissionsrequest *TestIamPermissionsRequest
  7078  	urlParams_                gensupport.URLParams
  7079  	ctx_                      context.Context
  7080  	header_                   http.Header
  7081  }
  7082  
  7083  // TestIamPermissions: Returns permissions that a caller has on the specified
  7084  // resource. If the resource does not exist, this will return an empty set of
  7085  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  7086  // used for building permission-aware UIs and command-line tools, not for
  7087  // authorization checking. This operation may "fail open" without warning.
  7088  //
  7089  //   - resource: REQUIRED: The resource for which the policy detail is being
  7090  //     requested. See Resource names
  7091  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  7092  //     value for this field.
  7093  func (r *ProjectsTopicsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTopicsTestIamPermissionsCall {
  7094  	c := &ProjectsTopicsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7095  	c.resource = resource
  7096  	c.testiampermissionsrequest = testiampermissionsrequest
  7097  	return c
  7098  }
  7099  
  7100  // Fields allows partial responses to be retrieved. See
  7101  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7102  // details.
  7103  func (c *ProjectsTopicsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTopicsTestIamPermissionsCall {
  7104  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7105  	return c
  7106  }
  7107  
  7108  // Context sets the context to be used in this call's Do method.
  7109  func (c *ProjectsTopicsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTopicsTestIamPermissionsCall {
  7110  	c.ctx_ = ctx
  7111  	return c
  7112  }
  7113  
  7114  // Header returns a http.Header that can be modified by the caller to add
  7115  // headers to the request.
  7116  func (c *ProjectsTopicsTestIamPermissionsCall) Header() http.Header {
  7117  	if c.header_ == nil {
  7118  		c.header_ = make(http.Header)
  7119  	}
  7120  	return c.header_
  7121  }
  7122  
  7123  func (c *ProjectsTopicsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  7124  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7125  	var body io.Reader = nil
  7126  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  7127  	if err != nil {
  7128  		return nil, err
  7129  	}
  7130  	c.urlParams_.Set("alt", alt)
  7131  	c.urlParams_.Set("prettyPrint", "false")
  7132  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  7133  	urls += "?" + c.urlParams_.Encode()
  7134  	req, err := http.NewRequest("POST", urls, body)
  7135  	if err != nil {
  7136  		return nil, err
  7137  	}
  7138  	req.Header = reqHeaders
  7139  	googleapi.Expand(req.URL, map[string]string{
  7140  		"resource": c.resource,
  7141  	})
  7142  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7143  }
  7144  
  7145  // Do executes the "pubsub.projects.topics.testIamPermissions" call.
  7146  // Any non-2xx status code is an error. Response headers are in either
  7147  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  7148  // returned at all) in error.(*googleapi.Error).Header. Use
  7149  // googleapi.IsNotModified to check whether the returned error was because
  7150  // http.StatusNotModified was returned.
  7151  func (c *ProjectsTopicsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  7152  	gensupport.SetOptions(c.urlParams_, opts...)
  7153  	res, err := c.doRequest("json")
  7154  	if res != nil && res.StatusCode == http.StatusNotModified {
  7155  		if res.Body != nil {
  7156  			res.Body.Close()
  7157  		}
  7158  		return nil, gensupport.WrapError(&googleapi.Error{
  7159  			Code:   res.StatusCode,
  7160  			Header: res.Header,
  7161  		})
  7162  	}
  7163  	if err != nil {
  7164  		return nil, err
  7165  	}
  7166  	defer googleapi.CloseBody(res)
  7167  	if err := googleapi.CheckResponse(res); err != nil {
  7168  		return nil, gensupport.WrapError(err)
  7169  	}
  7170  	ret := &TestIamPermissionsResponse{
  7171  		ServerResponse: googleapi.ServerResponse{
  7172  			Header:         res.Header,
  7173  			HTTPStatusCode: res.StatusCode,
  7174  		},
  7175  	}
  7176  	target := &ret
  7177  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7178  		return nil, err
  7179  	}
  7180  	return ret, nil
  7181  }
  7182  
  7183  type ProjectsTopicsSnapshotsListCall struct {
  7184  	s            *Service
  7185  	topic        string
  7186  	urlParams_   gensupport.URLParams
  7187  	ifNoneMatch_ string
  7188  	ctx_         context.Context
  7189  	header_      http.Header
  7190  }
  7191  
  7192  // List: Lists the names of the snapshots on this topic. Snapshots are used in
  7193  // Seek (https://cloud.google.com/pubsub/docs/replay-overview) operations,
  7194  // which allow you to manage message acknowledgments in bulk. That is, you can
  7195  // set the acknowledgment state of messages in an existing subscription to the
  7196  // state captured by a snapshot.
  7197  //
  7198  //   - topic: The name of the topic that snapshots are attached to. Format is
  7199  //     `projects/{project}/topics/{topic}`.
  7200  func (r *ProjectsTopicsSnapshotsService) List(topic string) *ProjectsTopicsSnapshotsListCall {
  7201  	c := &ProjectsTopicsSnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7202  	c.topic = topic
  7203  	return c
  7204  }
  7205  
  7206  // PageSize sets the optional parameter "pageSize": Maximum number of snapshot
  7207  // names to return.
  7208  func (c *ProjectsTopicsSnapshotsListCall) PageSize(pageSize int64) *ProjectsTopicsSnapshotsListCall {
  7209  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7210  	return c
  7211  }
  7212  
  7213  // PageToken sets the optional parameter "pageToken": The value returned by the
  7214  // last `ListTopicSnapshotsResponse`; indicates that this is a continuation of
  7215  // a prior `ListTopicSnapshots` call, and that the system should return the
  7216  // next page of data.
  7217  func (c *ProjectsTopicsSnapshotsListCall) PageToken(pageToken string) *ProjectsTopicsSnapshotsListCall {
  7218  	c.urlParams_.Set("pageToken", pageToken)
  7219  	return c
  7220  }
  7221  
  7222  // Fields allows partial responses to be retrieved. See
  7223  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7224  // details.
  7225  func (c *ProjectsTopicsSnapshotsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsSnapshotsListCall {
  7226  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7227  	return c
  7228  }
  7229  
  7230  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7231  // object's ETag matches the given value. This is useful for getting updates
  7232  // only after the object has changed since the last request.
  7233  func (c *ProjectsTopicsSnapshotsListCall) IfNoneMatch(entityTag string) *ProjectsTopicsSnapshotsListCall {
  7234  	c.ifNoneMatch_ = entityTag
  7235  	return c
  7236  }
  7237  
  7238  // Context sets the context to be used in this call's Do method.
  7239  func (c *ProjectsTopicsSnapshotsListCall) Context(ctx context.Context) *ProjectsTopicsSnapshotsListCall {
  7240  	c.ctx_ = ctx
  7241  	return c
  7242  }
  7243  
  7244  // Header returns a http.Header that can be modified by the caller to add
  7245  // headers to the request.
  7246  func (c *ProjectsTopicsSnapshotsListCall) Header() http.Header {
  7247  	if c.header_ == nil {
  7248  		c.header_ = make(http.Header)
  7249  	}
  7250  	return c.header_
  7251  }
  7252  
  7253  func (c *ProjectsTopicsSnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  7254  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7255  	if c.ifNoneMatch_ != "" {
  7256  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7257  	}
  7258  	var body io.Reader = nil
  7259  	c.urlParams_.Set("alt", alt)
  7260  	c.urlParams_.Set("prettyPrint", "false")
  7261  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}/snapshots")
  7262  	urls += "?" + c.urlParams_.Encode()
  7263  	req, err := http.NewRequest("GET", urls, body)
  7264  	if err != nil {
  7265  		return nil, err
  7266  	}
  7267  	req.Header = reqHeaders
  7268  	googleapi.Expand(req.URL, map[string]string{
  7269  		"topic": c.topic,
  7270  	})
  7271  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7272  }
  7273  
  7274  // Do executes the "pubsub.projects.topics.snapshots.list" call.
  7275  // Any non-2xx status code is an error. Response headers are in either
  7276  // *ListTopicSnapshotsResponse.ServerResponse.Header or (if a response was
  7277  // returned at all) in error.(*googleapi.Error).Header. Use
  7278  // googleapi.IsNotModified to check whether the returned error was because
  7279  // http.StatusNotModified was returned.
  7280  func (c *ProjectsTopicsSnapshotsListCall) Do(opts ...googleapi.CallOption) (*ListTopicSnapshotsResponse, error) {
  7281  	gensupport.SetOptions(c.urlParams_, opts...)
  7282  	res, err := c.doRequest("json")
  7283  	if res != nil && res.StatusCode == http.StatusNotModified {
  7284  		if res.Body != nil {
  7285  			res.Body.Close()
  7286  		}
  7287  		return nil, gensupport.WrapError(&googleapi.Error{
  7288  			Code:   res.StatusCode,
  7289  			Header: res.Header,
  7290  		})
  7291  	}
  7292  	if err != nil {
  7293  		return nil, err
  7294  	}
  7295  	defer googleapi.CloseBody(res)
  7296  	if err := googleapi.CheckResponse(res); err != nil {
  7297  		return nil, gensupport.WrapError(err)
  7298  	}
  7299  	ret := &ListTopicSnapshotsResponse{
  7300  		ServerResponse: googleapi.ServerResponse{
  7301  			Header:         res.Header,
  7302  			HTTPStatusCode: res.StatusCode,
  7303  		},
  7304  	}
  7305  	target := &ret
  7306  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7307  		return nil, err
  7308  	}
  7309  	return ret, nil
  7310  }
  7311  
  7312  // Pages invokes f for each page of results.
  7313  // A non-nil error returned from f will halt the iteration.
  7314  // The provided context supersedes any context provided to the Context method.
  7315  func (c *ProjectsTopicsSnapshotsListCall) Pages(ctx context.Context, f func(*ListTopicSnapshotsResponse) error) error {
  7316  	c.ctx_ = ctx
  7317  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7318  	for {
  7319  		x, err := c.Do()
  7320  		if err != nil {
  7321  			return err
  7322  		}
  7323  		if err := f(x); err != nil {
  7324  			return err
  7325  		}
  7326  		if x.NextPageToken == "" {
  7327  			return nil
  7328  		}
  7329  		c.PageToken(x.NextPageToken)
  7330  	}
  7331  }
  7332  
  7333  type ProjectsTopicsSubscriptionsListCall struct {
  7334  	s            *Service
  7335  	topic        string
  7336  	urlParams_   gensupport.URLParams
  7337  	ifNoneMatch_ string
  7338  	ctx_         context.Context
  7339  	header_      http.Header
  7340  }
  7341  
  7342  // List: Lists the names of the attached subscriptions on this topic.
  7343  //
  7344  //   - topic: The name of the topic that subscriptions are attached to. Format is
  7345  //     `projects/{project}/topics/{topic}`.
  7346  func (r *ProjectsTopicsSubscriptionsService) List(topic string) *ProjectsTopicsSubscriptionsListCall {
  7347  	c := &ProjectsTopicsSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7348  	c.topic = topic
  7349  	return c
  7350  }
  7351  
  7352  // PageSize sets the optional parameter "pageSize": Maximum number of
  7353  // subscription names to return.
  7354  func (c *ProjectsTopicsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsTopicsSubscriptionsListCall {
  7355  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7356  	return c
  7357  }
  7358  
  7359  // PageToken sets the optional parameter "pageToken": The value returned by the
  7360  // last `ListTopicSubscriptionsResponse`; indicates that this is a continuation
  7361  // of a prior `ListTopicSubscriptions` call, and that the system should return
  7362  // the next page of data.
  7363  func (c *ProjectsTopicsSubscriptionsListCall) PageToken(pageToken string) *ProjectsTopicsSubscriptionsListCall {
  7364  	c.urlParams_.Set("pageToken", pageToken)
  7365  	return c
  7366  }
  7367  
  7368  // Fields allows partial responses to be retrieved. See
  7369  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7370  // details.
  7371  func (c *ProjectsTopicsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsSubscriptionsListCall {
  7372  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7373  	return c
  7374  }
  7375  
  7376  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7377  // object's ETag matches the given value. This is useful for getting updates
  7378  // only after the object has changed since the last request.
  7379  func (c *ProjectsTopicsSubscriptionsListCall) IfNoneMatch(entityTag string) *ProjectsTopicsSubscriptionsListCall {
  7380  	c.ifNoneMatch_ = entityTag
  7381  	return c
  7382  }
  7383  
  7384  // Context sets the context to be used in this call's Do method.
  7385  func (c *ProjectsTopicsSubscriptionsListCall) Context(ctx context.Context) *ProjectsTopicsSubscriptionsListCall {
  7386  	c.ctx_ = ctx
  7387  	return c
  7388  }
  7389  
  7390  // Header returns a http.Header that can be modified by the caller to add
  7391  // headers to the request.
  7392  func (c *ProjectsTopicsSubscriptionsListCall) Header() http.Header {
  7393  	if c.header_ == nil {
  7394  		c.header_ = make(http.Header)
  7395  	}
  7396  	return c.header_
  7397  }
  7398  
  7399  func (c *ProjectsTopicsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  7400  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7401  	if c.ifNoneMatch_ != "" {
  7402  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7403  	}
  7404  	var body io.Reader = nil
  7405  	c.urlParams_.Set("alt", alt)
  7406  	c.urlParams_.Set("prettyPrint", "false")
  7407  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}/subscriptions")
  7408  	urls += "?" + c.urlParams_.Encode()
  7409  	req, err := http.NewRequest("GET", urls, body)
  7410  	if err != nil {
  7411  		return nil, err
  7412  	}
  7413  	req.Header = reqHeaders
  7414  	googleapi.Expand(req.URL, map[string]string{
  7415  		"topic": c.topic,
  7416  	})
  7417  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7418  }
  7419  
  7420  // Do executes the "pubsub.projects.topics.subscriptions.list" call.
  7421  // Any non-2xx status code is an error. Response headers are in either
  7422  // *ListTopicSubscriptionsResponse.ServerResponse.Header or (if a response was
  7423  // returned at all) in error.(*googleapi.Error).Header. Use
  7424  // googleapi.IsNotModified to check whether the returned error was because
  7425  // http.StatusNotModified was returned.
  7426  func (c *ProjectsTopicsSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListTopicSubscriptionsResponse, error) {
  7427  	gensupport.SetOptions(c.urlParams_, opts...)
  7428  	res, err := c.doRequest("json")
  7429  	if res != nil && res.StatusCode == http.StatusNotModified {
  7430  		if res.Body != nil {
  7431  			res.Body.Close()
  7432  		}
  7433  		return nil, gensupport.WrapError(&googleapi.Error{
  7434  			Code:   res.StatusCode,
  7435  			Header: res.Header,
  7436  		})
  7437  	}
  7438  	if err != nil {
  7439  		return nil, err
  7440  	}
  7441  	defer googleapi.CloseBody(res)
  7442  	if err := googleapi.CheckResponse(res); err != nil {
  7443  		return nil, gensupport.WrapError(err)
  7444  	}
  7445  	ret := &ListTopicSubscriptionsResponse{
  7446  		ServerResponse: googleapi.ServerResponse{
  7447  			Header:         res.Header,
  7448  			HTTPStatusCode: res.StatusCode,
  7449  		},
  7450  	}
  7451  	target := &ret
  7452  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7453  		return nil, err
  7454  	}
  7455  	return ret, nil
  7456  }
  7457  
  7458  // Pages invokes f for each page of results.
  7459  // A non-nil error returned from f will halt the iteration.
  7460  // The provided context supersedes any context provided to the Context method.
  7461  func (c *ProjectsTopicsSubscriptionsListCall) Pages(ctx context.Context, f func(*ListTopicSubscriptionsResponse) error) error {
  7462  	c.ctx_ = ctx
  7463  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7464  	for {
  7465  		x, err := c.Do()
  7466  		if err != nil {
  7467  			return err
  7468  		}
  7469  		if err := f(x); err != nil {
  7470  			return err
  7471  		}
  7472  		if x.NextPageToken == "" {
  7473  			return nil
  7474  		}
  7475  		c.PageToken(x.NextPageToken)
  7476  	}
  7477  }
  7478  

View as plain text