...

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

Documentation: google.golang.org/api/pubsublite/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 pubsublite provides access to the Pub/Sub Lite API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/pubsub/lite/docs
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/pubsublite/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	pubsubliteService, err := pubsublite.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	pubsubliteService, err := pubsublite.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	pubsubliteService, err := pubsublite.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package pubsublite // import "google.golang.org/api/pubsublite/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "pubsublite:v1"
    90  const apiName = "pubsublite"
    91  const apiVersion = "v1"
    92  const basePath = "https://pubsublite.googleapis.com/"
    93  const basePathTemplate = "https://pubsublite.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://pubsublite.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Admin = NewAdminService(s)
   139  	s.Cursor = NewCursorService(s)
   140  	s.TopicStats = NewTopicStatsService(s)
   141  	return s, nil
   142  }
   143  
   144  type Service struct {
   145  	client    *http.Client
   146  	BasePath  string // API endpoint base URL
   147  	UserAgent string // optional additional User-Agent fragment
   148  
   149  	Admin *AdminService
   150  
   151  	Cursor *CursorService
   152  
   153  	TopicStats *TopicStatsService
   154  }
   155  
   156  func (s *Service) userAgent() string {
   157  	if s.UserAgent == "" {
   158  		return googleapi.UserAgent
   159  	}
   160  	return googleapi.UserAgent + " " + s.UserAgent
   161  }
   162  
   163  func NewAdminService(s *Service) *AdminService {
   164  	rs := &AdminService{s: s}
   165  	rs.Projects = NewAdminProjectsService(s)
   166  	return rs
   167  }
   168  
   169  type AdminService struct {
   170  	s *Service
   171  
   172  	Projects *AdminProjectsService
   173  }
   174  
   175  func NewAdminProjectsService(s *Service) *AdminProjectsService {
   176  	rs := &AdminProjectsService{s: s}
   177  	rs.Locations = NewAdminProjectsLocationsService(s)
   178  	return rs
   179  }
   180  
   181  type AdminProjectsService struct {
   182  	s *Service
   183  
   184  	Locations *AdminProjectsLocationsService
   185  }
   186  
   187  func NewAdminProjectsLocationsService(s *Service) *AdminProjectsLocationsService {
   188  	rs := &AdminProjectsLocationsService{s: s}
   189  	rs.Operations = NewAdminProjectsLocationsOperationsService(s)
   190  	rs.Reservations = NewAdminProjectsLocationsReservationsService(s)
   191  	rs.Subscriptions = NewAdminProjectsLocationsSubscriptionsService(s)
   192  	rs.Topics = NewAdminProjectsLocationsTopicsService(s)
   193  	return rs
   194  }
   195  
   196  type AdminProjectsLocationsService struct {
   197  	s *Service
   198  
   199  	Operations *AdminProjectsLocationsOperationsService
   200  
   201  	Reservations *AdminProjectsLocationsReservationsService
   202  
   203  	Subscriptions *AdminProjectsLocationsSubscriptionsService
   204  
   205  	Topics *AdminProjectsLocationsTopicsService
   206  }
   207  
   208  func NewAdminProjectsLocationsOperationsService(s *Service) *AdminProjectsLocationsOperationsService {
   209  	rs := &AdminProjectsLocationsOperationsService{s: s}
   210  	return rs
   211  }
   212  
   213  type AdminProjectsLocationsOperationsService struct {
   214  	s *Service
   215  }
   216  
   217  func NewAdminProjectsLocationsReservationsService(s *Service) *AdminProjectsLocationsReservationsService {
   218  	rs := &AdminProjectsLocationsReservationsService{s: s}
   219  	rs.Topics = NewAdminProjectsLocationsReservationsTopicsService(s)
   220  	return rs
   221  }
   222  
   223  type AdminProjectsLocationsReservationsService struct {
   224  	s *Service
   225  
   226  	Topics *AdminProjectsLocationsReservationsTopicsService
   227  }
   228  
   229  func NewAdminProjectsLocationsReservationsTopicsService(s *Service) *AdminProjectsLocationsReservationsTopicsService {
   230  	rs := &AdminProjectsLocationsReservationsTopicsService{s: s}
   231  	return rs
   232  }
   233  
   234  type AdminProjectsLocationsReservationsTopicsService struct {
   235  	s *Service
   236  }
   237  
   238  func NewAdminProjectsLocationsSubscriptionsService(s *Service) *AdminProjectsLocationsSubscriptionsService {
   239  	rs := &AdminProjectsLocationsSubscriptionsService{s: s}
   240  	return rs
   241  }
   242  
   243  type AdminProjectsLocationsSubscriptionsService struct {
   244  	s *Service
   245  }
   246  
   247  func NewAdminProjectsLocationsTopicsService(s *Service) *AdminProjectsLocationsTopicsService {
   248  	rs := &AdminProjectsLocationsTopicsService{s: s}
   249  	rs.Subscriptions = NewAdminProjectsLocationsTopicsSubscriptionsService(s)
   250  	return rs
   251  }
   252  
   253  type AdminProjectsLocationsTopicsService struct {
   254  	s *Service
   255  
   256  	Subscriptions *AdminProjectsLocationsTopicsSubscriptionsService
   257  }
   258  
   259  func NewAdminProjectsLocationsTopicsSubscriptionsService(s *Service) *AdminProjectsLocationsTopicsSubscriptionsService {
   260  	rs := &AdminProjectsLocationsTopicsSubscriptionsService{s: s}
   261  	return rs
   262  }
   263  
   264  type AdminProjectsLocationsTopicsSubscriptionsService struct {
   265  	s *Service
   266  }
   267  
   268  func NewCursorService(s *Service) *CursorService {
   269  	rs := &CursorService{s: s}
   270  	rs.Projects = NewCursorProjectsService(s)
   271  	return rs
   272  }
   273  
   274  type CursorService struct {
   275  	s *Service
   276  
   277  	Projects *CursorProjectsService
   278  }
   279  
   280  func NewCursorProjectsService(s *Service) *CursorProjectsService {
   281  	rs := &CursorProjectsService{s: s}
   282  	rs.Locations = NewCursorProjectsLocationsService(s)
   283  	return rs
   284  }
   285  
   286  type CursorProjectsService struct {
   287  	s *Service
   288  
   289  	Locations *CursorProjectsLocationsService
   290  }
   291  
   292  func NewCursorProjectsLocationsService(s *Service) *CursorProjectsLocationsService {
   293  	rs := &CursorProjectsLocationsService{s: s}
   294  	rs.Subscriptions = NewCursorProjectsLocationsSubscriptionsService(s)
   295  	return rs
   296  }
   297  
   298  type CursorProjectsLocationsService struct {
   299  	s *Service
   300  
   301  	Subscriptions *CursorProjectsLocationsSubscriptionsService
   302  }
   303  
   304  func NewCursorProjectsLocationsSubscriptionsService(s *Service) *CursorProjectsLocationsSubscriptionsService {
   305  	rs := &CursorProjectsLocationsSubscriptionsService{s: s}
   306  	rs.Cursors = NewCursorProjectsLocationsSubscriptionsCursorsService(s)
   307  	return rs
   308  }
   309  
   310  type CursorProjectsLocationsSubscriptionsService struct {
   311  	s *Service
   312  
   313  	Cursors *CursorProjectsLocationsSubscriptionsCursorsService
   314  }
   315  
   316  func NewCursorProjectsLocationsSubscriptionsCursorsService(s *Service) *CursorProjectsLocationsSubscriptionsCursorsService {
   317  	rs := &CursorProjectsLocationsSubscriptionsCursorsService{s: s}
   318  	return rs
   319  }
   320  
   321  type CursorProjectsLocationsSubscriptionsCursorsService struct {
   322  	s *Service
   323  }
   324  
   325  func NewTopicStatsService(s *Service) *TopicStatsService {
   326  	rs := &TopicStatsService{s: s}
   327  	rs.Projects = NewTopicStatsProjectsService(s)
   328  	return rs
   329  }
   330  
   331  type TopicStatsService struct {
   332  	s *Service
   333  
   334  	Projects *TopicStatsProjectsService
   335  }
   336  
   337  func NewTopicStatsProjectsService(s *Service) *TopicStatsProjectsService {
   338  	rs := &TopicStatsProjectsService{s: s}
   339  	rs.Locations = NewTopicStatsProjectsLocationsService(s)
   340  	return rs
   341  }
   342  
   343  type TopicStatsProjectsService struct {
   344  	s *Service
   345  
   346  	Locations *TopicStatsProjectsLocationsService
   347  }
   348  
   349  func NewTopicStatsProjectsLocationsService(s *Service) *TopicStatsProjectsLocationsService {
   350  	rs := &TopicStatsProjectsLocationsService{s: s}
   351  	rs.Topics = NewTopicStatsProjectsLocationsTopicsService(s)
   352  	return rs
   353  }
   354  
   355  type TopicStatsProjectsLocationsService struct {
   356  	s *Service
   357  
   358  	Topics *TopicStatsProjectsLocationsTopicsService
   359  }
   360  
   361  func NewTopicStatsProjectsLocationsTopicsService(s *Service) *TopicStatsProjectsLocationsTopicsService {
   362  	rs := &TopicStatsProjectsLocationsTopicsService{s: s}
   363  	return rs
   364  }
   365  
   366  type TopicStatsProjectsLocationsTopicsService struct {
   367  	s *Service
   368  }
   369  
   370  // CancelOperationRequest: The request message for Operations.CancelOperation.
   371  type CancelOperationRequest struct {
   372  }
   373  
   374  // Capacity: The throughput capacity configuration for each partition.
   375  type Capacity struct {
   376  	// PublishMibPerSec: Publish throughput capacity per partition in MiB/s. Must
   377  	// be >= 4 and <= 16.
   378  	PublishMibPerSec int64 `json:"publishMibPerSec,omitempty"`
   379  	// SubscribeMibPerSec: Subscribe throughput capacity per partition in MiB/s.
   380  	// Must be >= 4 and <= 32.
   381  	SubscribeMibPerSec int64 `json:"subscribeMibPerSec,omitempty"`
   382  	// ForceSendFields is a list of field names (e.g. "PublishMibPerSec") to
   383  	// unconditionally include in API requests. By default, fields with empty or
   384  	// default values are omitted from API requests. See
   385  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   386  	// details.
   387  	ForceSendFields []string `json:"-"`
   388  	// NullFields is a list of field names (e.g. "PublishMibPerSec") to include in
   389  	// API requests with the JSON null value. By default, fields with empty values
   390  	// are omitted from API requests. See
   391  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   392  	NullFields []string `json:"-"`
   393  }
   394  
   395  func (s *Capacity) MarshalJSON() ([]byte, error) {
   396  	type NoMethod Capacity
   397  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   398  }
   399  
   400  // CommitCursorRequest: Request for CommitCursor.
   401  type CommitCursorRequest struct {
   402  	// Cursor: The new value for the committed cursor.
   403  	Cursor *Cursor `json:"cursor,omitempty"`
   404  	// Partition: The partition for which to update the cursor. Partitions are zero
   405  	// indexed, so `partition` must be in the range [0, topic.num_partitions).
   406  	Partition int64 `json:"partition,omitempty,string"`
   407  	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
   408  	// include in API requests. By default, fields with empty or default values are
   409  	// omitted from API requests. See
   410  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   411  	// details.
   412  	ForceSendFields []string `json:"-"`
   413  	// NullFields is a list of field names (e.g. "Cursor") to include in API
   414  	// requests with the JSON null value. By default, fields with empty values are
   415  	// omitted from API requests. See
   416  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   417  	NullFields []string `json:"-"`
   418  }
   419  
   420  func (s *CommitCursorRequest) MarshalJSON() ([]byte, error) {
   421  	type NoMethod CommitCursorRequest
   422  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   423  }
   424  
   425  // CommitCursorResponse: Response for CommitCursor.
   426  type CommitCursorResponse struct {
   427  	// ServerResponse contains the HTTP response code and headers from the server.
   428  	googleapi.ServerResponse `json:"-"`
   429  }
   430  
   431  // ComputeHeadCursorRequest: Compute the current head cursor for a partition.
   432  type ComputeHeadCursorRequest struct {
   433  	// Partition: Required. The partition for which we should compute the head
   434  	// cursor.
   435  	Partition int64 `json:"partition,omitempty,string"`
   436  	// ForceSendFields is a list of field names (e.g. "Partition") to
   437  	// unconditionally include in API requests. By default, fields with empty or
   438  	// default values are omitted from API requests. See
   439  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   440  	// details.
   441  	ForceSendFields []string `json:"-"`
   442  	// NullFields is a list of field names (e.g. "Partition") to include in API
   443  	// requests with the JSON null value. By default, fields with empty values are
   444  	// omitted from API requests. See
   445  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   446  	NullFields []string `json:"-"`
   447  }
   448  
   449  func (s *ComputeHeadCursorRequest) MarshalJSON() ([]byte, error) {
   450  	type NoMethod ComputeHeadCursorRequest
   451  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   452  }
   453  
   454  // ComputeHeadCursorResponse: Response containing the head cursor for the
   455  // requested topic and partition.
   456  type ComputeHeadCursorResponse struct {
   457  	// HeadCursor: The head cursor.
   458  	HeadCursor *Cursor `json:"headCursor,omitempty"`
   459  
   460  	// ServerResponse contains the HTTP response code and headers from the server.
   461  	googleapi.ServerResponse `json:"-"`
   462  	// ForceSendFields is a list of field names (e.g. "HeadCursor") to
   463  	// unconditionally include in API requests. By default, fields with empty or
   464  	// default values are omitted from API requests. See
   465  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   466  	// details.
   467  	ForceSendFields []string `json:"-"`
   468  	// NullFields is a list of field names (e.g. "HeadCursor") to include in API
   469  	// requests with the JSON null value. By default, fields with empty values are
   470  	// omitted from API requests. See
   471  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   472  	NullFields []string `json:"-"`
   473  }
   474  
   475  func (s *ComputeHeadCursorResponse) MarshalJSON() ([]byte, error) {
   476  	type NoMethod ComputeHeadCursorResponse
   477  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   478  }
   479  
   480  // ComputeMessageStatsRequest: Compute statistics about a range of messages in
   481  // a given topic and partition.
   482  type ComputeMessageStatsRequest struct {
   483  	// EndCursor: The exclusive end of the range. The range is empty if end_cursor
   484  	// <= start_cursor. Specifying a start_cursor before the first message and an
   485  	// end_cursor after the last message will retrieve all messages.
   486  	EndCursor *Cursor `json:"endCursor,omitempty"`
   487  	// Partition: Required. The partition for which we should compute message
   488  	// stats.
   489  	Partition int64 `json:"partition,omitempty,string"`
   490  	// StartCursor: The inclusive start of the range.
   491  	StartCursor *Cursor `json:"startCursor,omitempty"`
   492  	// ForceSendFields is a list of field names (e.g. "EndCursor") to
   493  	// unconditionally include in API requests. By default, fields with empty or
   494  	// default values are omitted from API requests. See
   495  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   496  	// details.
   497  	ForceSendFields []string `json:"-"`
   498  	// NullFields is a list of field names (e.g. "EndCursor") to include in API
   499  	// requests with the JSON null value. By default, fields with empty values are
   500  	// omitted from API requests. See
   501  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   502  	NullFields []string `json:"-"`
   503  }
   504  
   505  func (s *ComputeMessageStatsRequest) MarshalJSON() ([]byte, error) {
   506  	type NoMethod ComputeMessageStatsRequest
   507  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   508  }
   509  
   510  // ComputeMessageStatsResponse: Response containing stats for messages in the
   511  // requested topic and partition.
   512  type ComputeMessageStatsResponse struct {
   513  	// MessageBytes: The number of quota bytes accounted to these messages.
   514  	MessageBytes int64 `json:"messageBytes,omitempty,string"`
   515  	// MessageCount: The count of messages.
   516  	MessageCount int64 `json:"messageCount,omitempty,string"`
   517  	// MinimumEventTime: The minimum event timestamp across these messages. For the
   518  	// purposes of this computation, if a message does not have an event time, we
   519  	// use the publish time. The timestamp will be unset if there are no messages.
   520  	MinimumEventTime string `json:"minimumEventTime,omitempty"`
   521  	// MinimumPublishTime: The minimum publish timestamp across these messages.
   522  	// Note that publish timestamps within a partition are not guaranteed to be
   523  	// non-decreasing. The timestamp will be unset if there are no messages.
   524  	MinimumPublishTime string `json:"minimumPublishTime,omitempty"`
   525  
   526  	// ServerResponse contains the HTTP response code and headers from the server.
   527  	googleapi.ServerResponse `json:"-"`
   528  	// ForceSendFields is a list of field names (e.g. "MessageBytes") to
   529  	// unconditionally include in API requests. By default, fields with empty or
   530  	// default values are omitted from API requests. See
   531  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   532  	// details.
   533  	ForceSendFields []string `json:"-"`
   534  	// NullFields is a list of field names (e.g. "MessageBytes") to include in API
   535  	// requests with the JSON null value. By default, fields with empty values are
   536  	// omitted from API requests. See
   537  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   538  	NullFields []string `json:"-"`
   539  }
   540  
   541  func (s *ComputeMessageStatsResponse) MarshalJSON() ([]byte, error) {
   542  	type NoMethod ComputeMessageStatsResponse
   543  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   544  }
   545  
   546  // ComputeTimeCursorRequest: Compute the corresponding cursor for a publish or
   547  // event time in a topic partition.
   548  type ComputeTimeCursorRequest struct {
   549  	// Partition: Required. The partition for which we should compute the cursor.
   550  	Partition int64 `json:"partition,omitempty,string"`
   551  	// Target: Required. The target publish or event time. Specifying a future time
   552  	// will return an unset cursor.
   553  	Target *TimeTarget `json:"target,omitempty"`
   554  	// ForceSendFields is a list of field names (e.g. "Partition") to
   555  	// unconditionally include in API requests. By default, fields with empty or
   556  	// default values are omitted from API requests. See
   557  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   558  	// details.
   559  	ForceSendFields []string `json:"-"`
   560  	// NullFields is a list of field names (e.g. "Partition") to include in API
   561  	// requests with the JSON null value. By default, fields with empty values are
   562  	// omitted from API requests. See
   563  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   564  	NullFields []string `json:"-"`
   565  }
   566  
   567  func (s *ComputeTimeCursorRequest) MarshalJSON() ([]byte, error) {
   568  	type NoMethod ComputeTimeCursorRequest
   569  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   570  }
   571  
   572  // ComputeTimeCursorResponse: Response containing the cursor corresponding to a
   573  // publish or event time in a topic partition.
   574  type ComputeTimeCursorResponse struct {
   575  	// Cursor: If present, the cursor references the first message with time
   576  	// greater than or equal to the specified target time. If such a message cannot
   577  	// be found, the cursor will be unset (i.e. `cursor` is not present).
   578  	Cursor *Cursor `json:"cursor,omitempty"`
   579  
   580  	// ServerResponse contains the HTTP response code and headers from the server.
   581  	googleapi.ServerResponse `json:"-"`
   582  	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
   583  	// include in API requests. By default, fields with empty or default values are
   584  	// omitted from API requests. See
   585  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   586  	// details.
   587  	ForceSendFields []string `json:"-"`
   588  	// NullFields is a list of field names (e.g. "Cursor") to include in API
   589  	// requests with the JSON null value. By default, fields with empty values are
   590  	// omitted from API requests. See
   591  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   592  	NullFields []string `json:"-"`
   593  }
   594  
   595  func (s *ComputeTimeCursorResponse) MarshalJSON() ([]byte, error) {
   596  	type NoMethod ComputeTimeCursorResponse
   597  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   598  }
   599  
   600  // Cursor: A cursor that describes the position of a message within a topic
   601  // partition.
   602  type Cursor struct {
   603  	// Offset: The offset of a message within a topic partition. Must be greater
   604  	// than or equal 0.
   605  	Offset int64 `json:"offset,omitempty,string"`
   606  	// ForceSendFields is a list of field names (e.g. "Offset") 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. "Offset") 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 *Cursor) MarshalJSON() ([]byte, error) {
   620  	type NoMethod Cursor
   621  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   622  }
   623  
   624  // DeliveryConfig: The settings for a subscription's message delivery.
   625  type DeliveryConfig struct {
   626  	// DeliveryRequirement: The DeliveryRequirement for this subscription.
   627  	//
   628  	// Possible values:
   629  	//   "DELIVERY_REQUIREMENT_UNSPECIFIED" - Default value. This value is unused.
   630  	//   "DELIVER_IMMEDIATELY" - The server does not wait for a published message
   631  	// to be successfully written to storage before delivering it to subscribers.
   632  	//   "DELIVER_AFTER_STORED" - The server will not deliver a published message
   633  	// to subscribers until the message has been successfully written to storage.
   634  	// This will result in higher end-to-end latency, but consistent delivery.
   635  	DeliveryRequirement string `json:"deliveryRequirement,omitempty"`
   636  	// ForceSendFields is a list of field names (e.g. "DeliveryRequirement") to
   637  	// unconditionally include in API requests. By default, fields with empty or
   638  	// default values are omitted from API requests. See
   639  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   640  	// details.
   641  	ForceSendFields []string `json:"-"`
   642  	// NullFields is a list of field names (e.g. "DeliveryRequirement") to include
   643  	// in API requests with the JSON null value. By default, fields with empty
   644  	// values are omitted from API requests. See
   645  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   646  	NullFields []string `json:"-"`
   647  }
   648  
   649  func (s *DeliveryConfig) MarshalJSON() ([]byte, error) {
   650  	type NoMethod DeliveryConfig
   651  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   652  }
   653  
   654  // Empty: A generic empty message that you can re-use to avoid defining
   655  // duplicated empty messages in your APIs. A typical example is to use it as
   656  // the request or the response type of an API method. For instance: service Foo
   657  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   658  type Empty struct {
   659  	// ServerResponse contains the HTTP response code and headers from the server.
   660  	googleapi.ServerResponse `json:"-"`
   661  }
   662  
   663  // ExportConfig: Configuration for a Pub/Sub Lite subscription that writes
   664  // messages to a destination. User subscriber clients must not connect to this
   665  // subscription.
   666  type ExportConfig struct {
   667  	// CurrentState: Output only. The current state of the export, which may be
   668  	// different to the desired state due to errors. This field is output only.
   669  	//
   670  	// Possible values:
   671  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
   672  	//   "ACTIVE" - Messages are being exported.
   673  	//   "PAUSED" - Exporting messages is suspended.
   674  	//   "PERMISSION_DENIED" - Messages cannot be exported due to permission denied
   675  	// errors. Output only.
   676  	//   "NOT_FOUND" - Messages cannot be exported due to missing resources. Output
   677  	// only.
   678  	CurrentState string `json:"currentState,omitempty"`
   679  	// DeadLetterTopic: Optional. The name of an optional Pub/Sub Lite topic to
   680  	// publish messages that can not be exported to the destination. For example,
   681  	// the message can not be published to the Pub/Sub service because it does not
   682  	// satisfy the constraints documented at
   683  	// https://cloud.google.com/pubsub/docs/publisher. Structured like:
   684  	// projects/{project_number}/locations/{location}/topics/{topic_id}. Must be
   685  	// within the same project and location as the subscription. The topic may be
   686  	// changed or removed.
   687  	DeadLetterTopic string `json:"deadLetterTopic,omitempty"`
   688  	// DesiredState: The desired state of this export. Setting this to values other
   689  	// than `ACTIVE` and `PAUSED` will result in an error.
   690  	//
   691  	// Possible values:
   692  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
   693  	//   "ACTIVE" - Messages are being exported.
   694  	//   "PAUSED" - Exporting messages is suspended.
   695  	//   "PERMISSION_DENIED" - Messages cannot be exported due to permission denied
   696  	// errors. Output only.
   697  	//   "NOT_FOUND" - Messages cannot be exported due to missing resources. Output
   698  	// only.
   699  	DesiredState string `json:"desiredState,omitempty"`
   700  	// PubsubConfig: Messages are automatically written from the Pub/Sub Lite topic
   701  	// associated with this subscription to a Pub/Sub topic.
   702  	PubsubConfig *PubSubConfig `json:"pubsubConfig,omitempty"`
   703  	// ForceSendFields is a list of field names (e.g. "CurrentState") to
   704  	// unconditionally include in API requests. By default, fields with empty or
   705  	// default values are omitted from API requests. See
   706  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   707  	// details.
   708  	ForceSendFields []string `json:"-"`
   709  	// NullFields is a list of field names (e.g. "CurrentState") to include in API
   710  	// requests with the JSON null value. By default, fields with empty values are
   711  	// omitted from API requests. See
   712  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   713  	NullFields []string `json:"-"`
   714  }
   715  
   716  func (s *ExportConfig) MarshalJSON() ([]byte, error) {
   717  	type NoMethod ExportConfig
   718  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   719  }
   720  
   721  // ListOperationsResponse: The response message for Operations.ListOperations.
   722  type ListOperationsResponse struct {
   723  	// NextPageToken: The standard List next-page token.
   724  	NextPageToken string `json:"nextPageToken,omitempty"`
   725  	// Operations: A list of operations that matches the specified filter in the
   726  	// request.
   727  	Operations []*Operation `json:"operations,omitempty"`
   728  
   729  	// ServerResponse contains the HTTP response code and headers from the server.
   730  	googleapi.ServerResponse `json:"-"`
   731  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   732  	// unconditionally include in API requests. By default, fields with empty or
   733  	// default values are omitted from API requests. See
   734  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   735  	// details.
   736  	ForceSendFields []string `json:"-"`
   737  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   738  	// requests with the JSON null value. By default, fields with empty values are
   739  	// omitted from API requests. See
   740  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   741  	NullFields []string `json:"-"`
   742  }
   743  
   744  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   745  	type NoMethod ListOperationsResponse
   746  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   747  }
   748  
   749  // ListPartitionCursorsResponse: Response for ListPartitionCursors
   750  type ListPartitionCursorsResponse struct {
   751  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   752  	// next page. If this field is omitted, there are no subsequent pages.
   753  	NextPageToken string `json:"nextPageToken,omitempty"`
   754  	// PartitionCursors: The partition cursors from this request.
   755  	PartitionCursors []*PartitionCursor `json:"partitionCursors,omitempty"`
   756  
   757  	// ServerResponse contains the HTTP response code and headers from the server.
   758  	googleapi.ServerResponse `json:"-"`
   759  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   760  	// unconditionally include in API requests. By default, fields with empty or
   761  	// default values are omitted from API requests. See
   762  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   763  	// details.
   764  	ForceSendFields []string `json:"-"`
   765  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   766  	// requests with the JSON null value. By default, fields with empty values are
   767  	// omitted from API requests. See
   768  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   769  	NullFields []string `json:"-"`
   770  }
   771  
   772  func (s *ListPartitionCursorsResponse) MarshalJSON() ([]byte, error) {
   773  	type NoMethod ListPartitionCursorsResponse
   774  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   775  }
   776  
   777  // ListReservationTopicsResponse: Response for ListReservationTopics.
   778  type ListReservationTopicsResponse struct {
   779  	// NextPageToken: A token that can be sent as `page_token` to retrieve the next
   780  	// page of results. If this field is omitted, there are no more results.
   781  	NextPageToken string `json:"nextPageToken,omitempty"`
   782  	// Topics: The names of topics attached to the reservation. The order of the
   783  	// topics is unspecified.
   784  	Topics []string `json:"topics,omitempty"`
   785  
   786  	// ServerResponse contains the HTTP response code and headers from the server.
   787  	googleapi.ServerResponse `json:"-"`
   788  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   789  	// unconditionally include in API requests. By default, fields with empty or
   790  	// default values are omitted from API requests. See
   791  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   792  	// details.
   793  	ForceSendFields []string `json:"-"`
   794  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   795  	// requests with the JSON null value. By default, fields with empty values are
   796  	// omitted from API requests. See
   797  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   798  	NullFields []string `json:"-"`
   799  }
   800  
   801  func (s *ListReservationTopicsResponse) MarshalJSON() ([]byte, error) {
   802  	type NoMethod ListReservationTopicsResponse
   803  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   804  }
   805  
   806  // ListReservationsResponse: Response for ListReservations.
   807  type ListReservationsResponse struct {
   808  	// NextPageToken: A token that can be sent as `page_token` to retrieve the next
   809  	// page of results. If this field is omitted, there are no more results.
   810  	NextPageToken string `json:"nextPageToken,omitempty"`
   811  	// Reservations: The list of reservation in the requested parent. The order of
   812  	// the reservations is unspecified.
   813  	Reservations []*Reservation `json:"reservations,omitempty"`
   814  
   815  	// ServerResponse contains the HTTP response code and headers from the server.
   816  	googleapi.ServerResponse `json:"-"`
   817  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   818  	// unconditionally include in API requests. By default, fields with empty or
   819  	// default values are omitted from API requests. See
   820  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   821  	// details.
   822  	ForceSendFields []string `json:"-"`
   823  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   824  	// requests with the JSON null value. By default, fields with empty values are
   825  	// omitted from API requests. See
   826  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   827  	NullFields []string `json:"-"`
   828  }
   829  
   830  func (s *ListReservationsResponse) MarshalJSON() ([]byte, error) {
   831  	type NoMethod ListReservationsResponse
   832  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   833  }
   834  
   835  // ListSubscriptionsResponse: Response for ListSubscriptions.
   836  type ListSubscriptionsResponse struct {
   837  	// NextPageToken: A token that can be sent as `page_token` to retrieve the next
   838  	// page of results. If this field is omitted, there are no more results.
   839  	NextPageToken string `json:"nextPageToken,omitempty"`
   840  	// Subscriptions: The list of subscriptions in the requested parent. The order
   841  	// of the subscriptions is unspecified.
   842  	Subscriptions []*Subscription `json:"subscriptions,omitempty"`
   843  
   844  	// ServerResponse contains the HTTP response code and headers from the server.
   845  	googleapi.ServerResponse `json:"-"`
   846  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   847  	// unconditionally include in API requests. By default, fields with empty or
   848  	// default values are omitted from API requests. See
   849  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   850  	// details.
   851  	ForceSendFields []string `json:"-"`
   852  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   853  	// requests with the JSON null value. By default, fields with empty values are
   854  	// omitted from API requests. See
   855  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   856  	NullFields []string `json:"-"`
   857  }
   858  
   859  func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) {
   860  	type NoMethod ListSubscriptionsResponse
   861  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   862  }
   863  
   864  // ListTopicSubscriptionsResponse: Response for ListTopicSubscriptions.
   865  type ListTopicSubscriptionsResponse struct {
   866  	// NextPageToken: A token that can be sent as `page_token` to retrieve the next
   867  	// page of results. If this field is omitted, there are no more results.
   868  	NextPageToken string `json:"nextPageToken,omitempty"`
   869  	// Subscriptions: The names of subscriptions attached to the topic. The order
   870  	// of the subscriptions is unspecified.
   871  	Subscriptions []string `json:"subscriptions,omitempty"`
   872  
   873  	// ServerResponse contains the HTTP response code and headers from the server.
   874  	googleapi.ServerResponse `json:"-"`
   875  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   876  	// unconditionally include in API requests. By default, fields with empty or
   877  	// default values are omitted from API requests. See
   878  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   879  	// details.
   880  	ForceSendFields []string `json:"-"`
   881  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   882  	// requests with the JSON null value. By default, fields with empty values are
   883  	// omitted from API requests. See
   884  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   885  	NullFields []string `json:"-"`
   886  }
   887  
   888  func (s *ListTopicSubscriptionsResponse) MarshalJSON() ([]byte, error) {
   889  	type NoMethod ListTopicSubscriptionsResponse
   890  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   891  }
   892  
   893  // ListTopicsResponse: Response for ListTopics.
   894  type ListTopicsResponse struct {
   895  	// NextPageToken: A token that can be sent as `page_token` to retrieve the next
   896  	// page of results. If this field is omitted, there are no more results.
   897  	NextPageToken string `json:"nextPageToken,omitempty"`
   898  	// Topics: The list of topic in the requested parent. The order of the topics
   899  	// is unspecified.
   900  	Topics []*Topic `json:"topics,omitempty"`
   901  
   902  	// ServerResponse contains the HTTP response code and headers from the server.
   903  	googleapi.ServerResponse `json:"-"`
   904  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   905  	// unconditionally include in API requests. By default, fields with empty or
   906  	// default values are omitted from API requests. See
   907  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   908  	// details.
   909  	ForceSendFields []string `json:"-"`
   910  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   911  	// requests with the JSON null value. By default, fields with empty values are
   912  	// omitted from API requests. See
   913  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   914  	NullFields []string `json:"-"`
   915  }
   916  
   917  func (s *ListTopicsResponse) MarshalJSON() ([]byte, error) {
   918  	type NoMethod ListTopicsResponse
   919  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   920  }
   921  
   922  // Operation: This resource represents a long-running operation that is the
   923  // result of a network API call.
   924  type Operation struct {
   925  	// Done: If the value is `false`, it means the operation is still in progress.
   926  	// If `true`, the operation is completed, and either `error` or `response` is
   927  	// available.
   928  	Done bool `json:"done,omitempty"`
   929  	// Error: The error result of the operation in case of failure or cancellation.
   930  	Error *Status `json:"error,omitempty"`
   931  	// Metadata: Service-specific metadata associated with the operation. It
   932  	// typically contains progress information and common metadata such as create
   933  	// time. Some services might not provide such metadata. Any method that returns
   934  	// a long-running operation should document the metadata type, if any.
   935  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   936  	// Name: The server-assigned name, which is only unique within the same service
   937  	// that originally returns it. If you use the default HTTP mapping, the `name`
   938  	// should be a resource name ending with `operations/{unique_id}`.
   939  	Name string `json:"name,omitempty"`
   940  	// Response: The normal, successful response of the operation. If the original
   941  	// method returns no data on success, such as `Delete`, the response is
   942  	// `google.protobuf.Empty`. If the original method is standard
   943  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   944  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   945  	// original method name. For example, if the original method name is
   946  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   947  	Response googleapi.RawMessage `json:"response,omitempty"`
   948  
   949  	// ServerResponse contains the HTTP response code and headers from the server.
   950  	googleapi.ServerResponse `json:"-"`
   951  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   952  	// include in API requests. By default, fields with empty or default values are
   953  	// omitted from API requests. See
   954  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   955  	// details.
   956  	ForceSendFields []string `json:"-"`
   957  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   958  	// with the JSON null value. By default, fields with empty values are omitted
   959  	// from API requests. See
   960  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   961  	NullFields []string `json:"-"`
   962  }
   963  
   964  func (s *Operation) MarshalJSON() ([]byte, error) {
   965  	type NoMethod Operation
   966  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   967  }
   968  
   969  // OperationMetadata: Metadata for long running operations.
   970  type OperationMetadata struct {
   971  	// CreateTime: The time the operation was created.
   972  	CreateTime string `json:"createTime,omitempty"`
   973  	// EndTime: The time the operation finished running. Not set if the operation
   974  	// has not completed.
   975  	EndTime string `json:"endTime,omitempty"`
   976  	// Target: Resource path for the target of the operation. For example, targets
   977  	// of seeks are subscription resources, structured like:
   978  	// projects/{project_number}/locations/{location}/subscriptions/{subscription_id
   979  	// }
   980  	Target string `json:"target,omitempty"`
   981  	// Verb: Name of the verb executed by the operation.
   982  	Verb string `json:"verb,omitempty"`
   983  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   984  	// unconditionally include in API requests. By default, fields with empty or
   985  	// default values are omitted from API requests. See
   986  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   987  	// details.
   988  	ForceSendFields []string `json:"-"`
   989  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   990  	// requests with the JSON null value. By default, fields with empty values are
   991  	// omitted from API requests. See
   992  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   993  	NullFields []string `json:"-"`
   994  }
   995  
   996  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   997  	type NoMethod OperationMetadata
   998  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   999  }
  1000  
  1001  // PartitionConfig: The settings for a topic's partitions.
  1002  type PartitionConfig struct {
  1003  	// Capacity: The capacity configuration.
  1004  	Capacity *Capacity `json:"capacity,omitempty"`
  1005  	// Count: The number of partitions in the topic. Must be at least 1. Once a
  1006  	// topic has been created the number of partitions can be increased but not
  1007  	// decreased. Message ordering is not guaranteed across a topic resize. For
  1008  	// more information see
  1009  	// https://cloud.google.com/pubsub/lite/docs/topics#scaling_capacity
  1010  	Count int64 `json:"count,omitempty,string"`
  1011  	// Scale: DEPRECATED: Use capacity instead which can express a superset of
  1012  	// configurations. Every partition in the topic is allocated throughput
  1013  	// equivalent to `scale` times the standard partition throughput (4 MiB/s).
  1014  	// This is also reflected in the cost of this topic; a topic with `scale` of 2
  1015  	// and count of 10 is charged for 20 partitions. This value must be in the
  1016  	// range [1,4].
  1017  	Scale int64 `json:"scale,omitempty"`
  1018  	// ForceSendFields is a list of field names (e.g. "Capacity") to
  1019  	// unconditionally include in API requests. By default, fields with empty or
  1020  	// default values are omitted from API requests. See
  1021  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1022  	// details.
  1023  	ForceSendFields []string `json:"-"`
  1024  	// NullFields is a list of field names (e.g. "Capacity") to include in API
  1025  	// requests with the JSON null value. By default, fields with empty values are
  1026  	// omitted from API requests. See
  1027  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1028  	NullFields []string `json:"-"`
  1029  }
  1030  
  1031  func (s *PartitionConfig) MarshalJSON() ([]byte, error) {
  1032  	type NoMethod PartitionConfig
  1033  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1034  }
  1035  
  1036  // PartitionCursor: A pair of a Cursor and the partition it is for.
  1037  type PartitionCursor struct {
  1038  	// Cursor: The value of the cursor.
  1039  	Cursor *Cursor `json:"cursor,omitempty"`
  1040  	// Partition: The partition this is for.
  1041  	Partition int64 `json:"partition,omitempty,string"`
  1042  	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
  1043  	// include in API requests. By default, fields with empty or default values are
  1044  	// omitted from API requests. See
  1045  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1046  	// details.
  1047  	ForceSendFields []string `json:"-"`
  1048  	// NullFields is a list of field names (e.g. "Cursor") to include in API
  1049  	// requests with the JSON null value. By default, fields with empty values are
  1050  	// omitted from API requests. See
  1051  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1052  	NullFields []string `json:"-"`
  1053  }
  1054  
  1055  func (s *PartitionCursor) MarshalJSON() ([]byte, error) {
  1056  	type NoMethod PartitionCursor
  1057  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1058  }
  1059  
  1060  // PubSubConfig: Configuration for exporting to a Pub/Sub topic.
  1061  type PubSubConfig struct {
  1062  	// Topic: The name of the Pub/Sub topic. Structured like:
  1063  	// projects/{project_number}/topics/{topic_id}. The topic may be changed.
  1064  	Topic string `json:"topic,omitempty"`
  1065  	// ForceSendFields is a list of field names (e.g. "Topic") to unconditionally
  1066  	// include in API requests. By default, fields with empty or default values are
  1067  	// omitted from API requests. See
  1068  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1069  	// details.
  1070  	ForceSendFields []string `json:"-"`
  1071  	// NullFields is a list of field names (e.g. "Topic") to include in API
  1072  	// requests with the JSON null value. By default, fields with empty values are
  1073  	// omitted from API requests. See
  1074  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1075  	NullFields []string `json:"-"`
  1076  }
  1077  
  1078  func (s *PubSubConfig) MarshalJSON() ([]byte, error) {
  1079  	type NoMethod PubSubConfig
  1080  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1081  }
  1082  
  1083  // Reservation: Metadata about a reservation resource.
  1084  type Reservation struct {
  1085  	// Name: The name of the reservation. Structured like:
  1086  	// projects/{project_number}/locations/{location}/reservations/{reservation_id}
  1087  	Name string `json:"name,omitempty"`
  1088  	// ThroughputCapacity: The reserved throughput capacity. Every unit of
  1089  	// throughput capacity is equivalent to 1 MiB/s of published messages or 2
  1090  	// MiB/s of subscribed messages. Any topics which are declared as using
  1091  	// capacity from a Reservation will consume resources from this reservation
  1092  	// instead of being charged individually.
  1093  	ThroughputCapacity int64 `json:"throughputCapacity,omitempty,string"`
  1094  
  1095  	// ServerResponse contains the HTTP response code and headers from the server.
  1096  	googleapi.ServerResponse `json:"-"`
  1097  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
  1098  	// include in API requests. By default, fields with empty or default values are
  1099  	// omitted from API requests. See
  1100  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1101  	// details.
  1102  	ForceSendFields []string `json:"-"`
  1103  	// NullFields is a list of field names (e.g. "Name") to include in API requests
  1104  	// with the JSON null value. By default, fields with empty values are omitted
  1105  	// from API requests. See
  1106  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1107  	NullFields []string `json:"-"`
  1108  }
  1109  
  1110  func (s *Reservation) MarshalJSON() ([]byte, error) {
  1111  	type NoMethod Reservation
  1112  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1113  }
  1114  
  1115  // ReservationConfig: The settings for this topic's Reservation usage.
  1116  type ReservationConfig struct {
  1117  	// ThroughputReservation: The Reservation to use for this topic's throughput
  1118  	// capacity. Structured like:
  1119  	// projects/{project_number}/locations/{location}/reservations/{reservation_id}
  1120  	ThroughputReservation string `json:"throughputReservation,omitempty"`
  1121  	// ForceSendFields is a list of field names (e.g. "ThroughputReservation") to
  1122  	// unconditionally include in API requests. By default, fields with empty or
  1123  	// default values are omitted from API requests. See
  1124  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1125  	// details.
  1126  	ForceSendFields []string `json:"-"`
  1127  	// NullFields is a list of field names (e.g. "ThroughputReservation") to
  1128  	// include in API requests with the JSON null value. By default, fields with
  1129  	// empty values are omitted from API requests. See
  1130  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1131  	NullFields []string `json:"-"`
  1132  }
  1133  
  1134  func (s *ReservationConfig) MarshalJSON() ([]byte, error) {
  1135  	type NoMethod ReservationConfig
  1136  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1137  }
  1138  
  1139  // RetentionConfig: The settings for a topic's message retention.
  1140  type RetentionConfig struct {
  1141  	// PerPartitionBytes: The provisioned storage, in bytes, per partition. If the
  1142  	// number of bytes stored in any of the topic's partitions grows beyond this
  1143  	// value, older messages will be dropped to make room for newer ones,
  1144  	// regardless of the value of `period`.
  1145  	PerPartitionBytes int64 `json:"perPartitionBytes,omitempty,string"`
  1146  	// Period: How long a published message is retained. If unset, messages will be
  1147  	// retained as long as the bytes retained for each partition is below
  1148  	// `per_partition_bytes`.
  1149  	Period string `json:"period,omitempty"`
  1150  	// ForceSendFields is a list of field names (e.g. "PerPartitionBytes") to
  1151  	// unconditionally include in API requests. By default, fields with empty or
  1152  	// default values are omitted from API requests. See
  1153  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1154  	// details.
  1155  	ForceSendFields []string `json:"-"`
  1156  	// NullFields is a list of field names (e.g. "PerPartitionBytes") to include in
  1157  	// API requests with the JSON null value. By default, fields with empty values
  1158  	// are omitted from API requests. See
  1159  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1160  	NullFields []string `json:"-"`
  1161  }
  1162  
  1163  func (s *RetentionConfig) MarshalJSON() ([]byte, error) {
  1164  	type NoMethod RetentionConfig
  1165  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1166  }
  1167  
  1168  // SeekSubscriptionRequest: Request for SeekSubscription.
  1169  type SeekSubscriptionRequest struct {
  1170  	// NamedTarget: Seek to a named position with respect to the message backlog.
  1171  	//
  1172  	// Possible values:
  1173  	//   "NAMED_TARGET_UNSPECIFIED" - Unspecified named target. Do not use.
  1174  	//   "TAIL" - Seek to the oldest retained message.
  1175  	//   "HEAD" - Seek past all recently published messages, skipping the entire
  1176  	// message backlog.
  1177  	NamedTarget string `json:"namedTarget,omitempty"`
  1178  	// TimeTarget: Seek to the first message whose publish or event time is greater
  1179  	// than or equal to the specified query time. If no such message can be
  1180  	// located, will seek to the end of the message backlog.
  1181  	TimeTarget *TimeTarget `json:"timeTarget,omitempty"`
  1182  	// ForceSendFields is a list of field names (e.g. "NamedTarget") to
  1183  	// unconditionally include in API requests. By default, fields with empty or
  1184  	// default values are omitted from API requests. See
  1185  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1186  	// details.
  1187  	ForceSendFields []string `json:"-"`
  1188  	// NullFields is a list of field names (e.g. "NamedTarget") to include in API
  1189  	// requests with the JSON null value. By default, fields with empty values are
  1190  	// omitted from API requests. See
  1191  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1192  	NullFields []string `json:"-"`
  1193  }
  1194  
  1195  func (s *SeekSubscriptionRequest) MarshalJSON() ([]byte, error) {
  1196  	type NoMethod SeekSubscriptionRequest
  1197  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1198  }
  1199  
  1200  // SeekSubscriptionResponse: Response for SeekSubscription long running
  1201  // operation.
  1202  type SeekSubscriptionResponse struct {
  1203  }
  1204  
  1205  // Status: The `Status` type defines a logical error model that is suitable for
  1206  // different programming environments, including REST APIs and RPC APIs. It is
  1207  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
  1208  // pieces of data: error code, error message, and error details. You can find
  1209  // out more about this error model and how to work with it in the API Design
  1210  // Guide (https://cloud.google.com/apis/design/errors).
  1211  type Status struct {
  1212  	// Code: The status code, which should be an enum value of google.rpc.Code.
  1213  	Code int64 `json:"code,omitempty"`
  1214  	// Details: A list of messages that carry the error details. There is a common
  1215  	// set of message types for APIs to use.
  1216  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1217  	// Message: A developer-facing error message, which should be in English. Any
  1218  	// user-facing error message should be localized and sent in the
  1219  	// google.rpc.Status.details field, or localized by the client.
  1220  	Message string `json:"message,omitempty"`
  1221  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1222  	// include in API requests. By default, fields with empty or default values are
  1223  	// omitted from API requests. See
  1224  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1225  	// details.
  1226  	ForceSendFields []string `json:"-"`
  1227  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1228  	// with the JSON null value. By default, fields with empty values are omitted
  1229  	// from API requests. See
  1230  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1231  	NullFields []string `json:"-"`
  1232  }
  1233  
  1234  func (s *Status) MarshalJSON() ([]byte, error) {
  1235  	type NoMethod Status
  1236  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1237  }
  1238  
  1239  // Subscription: Metadata about a subscription resource.
  1240  type Subscription struct {
  1241  	// DeliveryConfig: The settings for this subscription's message delivery.
  1242  	DeliveryConfig *DeliveryConfig `json:"deliveryConfig,omitempty"`
  1243  	// ExportConfig: If present, messages are automatically written from the
  1244  	// Pub/Sub Lite topic associated with this subscription to a destination.
  1245  	ExportConfig *ExportConfig `json:"exportConfig,omitempty"`
  1246  	// Name: The name of the subscription. Structured like:
  1247  	// projects/{project_number}/locations/{location}/subscriptions/{subscription_id
  1248  	// }
  1249  	Name string `json:"name,omitempty"`
  1250  	// Topic: The name of the topic this subscription is attached to. Structured
  1251  	// like: projects/{project_number}/locations/{location}/topics/{topic_id}
  1252  	Topic string `json:"topic,omitempty"`
  1253  
  1254  	// ServerResponse contains the HTTP response code and headers from the server.
  1255  	googleapi.ServerResponse `json:"-"`
  1256  	// ForceSendFields is a list of field names (e.g. "DeliveryConfig") to
  1257  	// unconditionally include in API requests. By default, fields with empty or
  1258  	// default values are omitted from API requests. See
  1259  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1260  	// details.
  1261  	ForceSendFields []string `json:"-"`
  1262  	// NullFields is a list of field names (e.g. "DeliveryConfig") to include in
  1263  	// API requests with the JSON null value. By default, fields with empty values
  1264  	// are omitted from API requests. See
  1265  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1266  	NullFields []string `json:"-"`
  1267  }
  1268  
  1269  func (s *Subscription) MarshalJSON() ([]byte, error) {
  1270  	type NoMethod Subscription
  1271  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1272  }
  1273  
  1274  // TimeTarget: A target publish or event time. Can be used for seeking to or
  1275  // retrieving the corresponding cursor.
  1276  type TimeTarget struct {
  1277  	// EventTime: Request the cursor of the first message with event time greater
  1278  	// than or equal to `event_time`. If messages are missing an event time, the
  1279  	// publish time is used as a fallback. As event times are user supplied,
  1280  	// subsequent messages may have event times less than `event_time` and should
  1281  	// be filtered by the client, if necessary.
  1282  	EventTime string `json:"eventTime,omitempty"`
  1283  	// PublishTime: Request the cursor of the first message with publish time
  1284  	// greater than or equal to `publish_time`. All messages thereafter are
  1285  	// guaranteed to have publish times >= `publish_time`.
  1286  	PublishTime string `json:"publishTime,omitempty"`
  1287  	// ForceSendFields is a list of field names (e.g. "EventTime") to
  1288  	// unconditionally include in API requests. By default, fields with empty or
  1289  	// default values are omitted from API requests. See
  1290  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1291  	// details.
  1292  	ForceSendFields []string `json:"-"`
  1293  	// NullFields is a list of field names (e.g. "EventTime") to include in API
  1294  	// requests with the JSON null value. By default, fields with empty values are
  1295  	// omitted from API requests. See
  1296  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1297  	NullFields []string `json:"-"`
  1298  }
  1299  
  1300  func (s *TimeTarget) MarshalJSON() ([]byte, error) {
  1301  	type NoMethod TimeTarget
  1302  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1303  }
  1304  
  1305  // Topic: Metadata about a topic resource.
  1306  type Topic struct {
  1307  	// Name: The name of the topic. Structured like:
  1308  	// projects/{project_number}/locations/{location}/topics/{topic_id}
  1309  	Name string `json:"name,omitempty"`
  1310  	// PartitionConfig: The settings for this topic's partitions.
  1311  	PartitionConfig *PartitionConfig `json:"partitionConfig,omitempty"`
  1312  	// ReservationConfig: The settings for this topic's Reservation usage.
  1313  	ReservationConfig *ReservationConfig `json:"reservationConfig,omitempty"`
  1314  	// RetentionConfig: The settings for this topic's message retention.
  1315  	RetentionConfig *RetentionConfig `json:"retentionConfig,omitempty"`
  1316  
  1317  	// ServerResponse contains the HTTP response code and headers from the server.
  1318  	googleapi.ServerResponse `json:"-"`
  1319  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
  1320  	// include in API requests. By default, fields with empty or default values are
  1321  	// omitted from API requests. See
  1322  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1323  	// details.
  1324  	ForceSendFields []string `json:"-"`
  1325  	// NullFields is a list of field names (e.g. "Name") to include in API requests
  1326  	// with the JSON null value. By default, fields with empty values are omitted
  1327  	// from API requests. See
  1328  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1329  	NullFields []string `json:"-"`
  1330  }
  1331  
  1332  func (s *Topic) MarshalJSON() ([]byte, error) {
  1333  	type NoMethod Topic
  1334  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1335  }
  1336  
  1337  // TopicPartitions: Response for GetTopicPartitions.
  1338  type TopicPartitions struct {
  1339  	// PartitionCount: The number of partitions in the topic.
  1340  	PartitionCount int64 `json:"partitionCount,omitempty,string"`
  1341  
  1342  	// ServerResponse contains the HTTP response code and headers from the server.
  1343  	googleapi.ServerResponse `json:"-"`
  1344  	// ForceSendFields is a list of field names (e.g. "PartitionCount") to
  1345  	// unconditionally include in API requests. By default, fields with empty or
  1346  	// default values are omitted from API requests. See
  1347  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1348  	// details.
  1349  	ForceSendFields []string `json:"-"`
  1350  	// NullFields is a list of field names (e.g. "PartitionCount") to include in
  1351  	// API requests with the JSON null value. By default, fields with empty values
  1352  	// are omitted from API requests. See
  1353  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1354  	NullFields []string `json:"-"`
  1355  }
  1356  
  1357  func (s *TopicPartitions) MarshalJSON() ([]byte, error) {
  1358  	type NoMethod TopicPartitions
  1359  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1360  }
  1361  
  1362  type AdminProjectsLocationsOperationsCancelCall struct {
  1363  	s                      *Service
  1364  	name                   string
  1365  	canceloperationrequest *CancelOperationRequest
  1366  	urlParams_             gensupport.URLParams
  1367  	ctx_                   context.Context
  1368  	header_                http.Header
  1369  }
  1370  
  1371  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  1372  // server makes a best effort to cancel the operation, but success is not
  1373  // guaranteed. If the server doesn't support this method, it returns
  1374  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  1375  // other methods to check whether the cancellation succeeded or whether the
  1376  // operation completed despite cancellation. On successful cancellation, the
  1377  // operation is not deleted; instead, it becomes an operation with an
  1378  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  1379  // `Code.CANCELLED`.
  1380  //
  1381  // - name: The name of the operation resource to be cancelled.
  1382  func (r *AdminProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *AdminProjectsLocationsOperationsCancelCall {
  1383  	c := &AdminProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1384  	c.name = name
  1385  	c.canceloperationrequest = canceloperationrequest
  1386  	return c
  1387  }
  1388  
  1389  // Fields allows partial responses to be retrieved. See
  1390  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1391  // details.
  1392  func (c *AdminProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsOperationsCancelCall {
  1393  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1394  	return c
  1395  }
  1396  
  1397  // Context sets the context to be used in this call's Do method.
  1398  func (c *AdminProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *AdminProjectsLocationsOperationsCancelCall {
  1399  	c.ctx_ = ctx
  1400  	return c
  1401  }
  1402  
  1403  // Header returns a http.Header that can be modified by the caller to add
  1404  // headers to the request.
  1405  func (c *AdminProjectsLocationsOperationsCancelCall) Header() http.Header {
  1406  	if c.header_ == nil {
  1407  		c.header_ = make(http.Header)
  1408  	}
  1409  	return c.header_
  1410  }
  1411  
  1412  func (c *AdminProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  1413  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1414  	var body io.Reader = nil
  1415  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  1416  	if err != nil {
  1417  		return nil, err
  1418  	}
  1419  	c.urlParams_.Set("alt", alt)
  1420  	c.urlParams_.Set("prettyPrint", "false")
  1421  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}:cancel")
  1422  	urls += "?" + c.urlParams_.Encode()
  1423  	req, err := http.NewRequest("POST", urls, body)
  1424  	if err != nil {
  1425  		return nil, err
  1426  	}
  1427  	req.Header = reqHeaders
  1428  	googleapi.Expand(req.URL, map[string]string{
  1429  		"name": c.name,
  1430  	})
  1431  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1432  }
  1433  
  1434  // Do executes the "pubsublite.admin.projects.locations.operations.cancel" call.
  1435  // Any non-2xx status code is an error. Response headers are in either
  1436  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1437  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1438  // whether the returned error was because http.StatusNotModified was returned.
  1439  func (c *AdminProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1440  	gensupport.SetOptions(c.urlParams_, opts...)
  1441  	res, err := c.doRequest("json")
  1442  	if res != nil && res.StatusCode == http.StatusNotModified {
  1443  		if res.Body != nil {
  1444  			res.Body.Close()
  1445  		}
  1446  		return nil, gensupport.WrapError(&googleapi.Error{
  1447  			Code:   res.StatusCode,
  1448  			Header: res.Header,
  1449  		})
  1450  	}
  1451  	if err != nil {
  1452  		return nil, err
  1453  	}
  1454  	defer googleapi.CloseBody(res)
  1455  	if err := googleapi.CheckResponse(res); err != nil {
  1456  		return nil, gensupport.WrapError(err)
  1457  	}
  1458  	ret := &Empty{
  1459  		ServerResponse: googleapi.ServerResponse{
  1460  			Header:         res.Header,
  1461  			HTTPStatusCode: res.StatusCode,
  1462  		},
  1463  	}
  1464  	target := &ret
  1465  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1466  		return nil, err
  1467  	}
  1468  	return ret, nil
  1469  }
  1470  
  1471  type AdminProjectsLocationsOperationsDeleteCall struct {
  1472  	s          *Service
  1473  	name       string
  1474  	urlParams_ gensupport.URLParams
  1475  	ctx_       context.Context
  1476  	header_    http.Header
  1477  }
  1478  
  1479  // Delete: Deletes a long-running operation. This method indicates that the
  1480  // client is no longer interested in the operation result. It does not cancel
  1481  // the operation. If the server doesn't support this method, it returns
  1482  // `google.rpc.Code.UNIMPLEMENTED`.
  1483  //
  1484  // - name: The name of the operation resource to be deleted.
  1485  func (r *AdminProjectsLocationsOperationsService) Delete(name string) *AdminProjectsLocationsOperationsDeleteCall {
  1486  	c := &AdminProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1487  	c.name = name
  1488  	return c
  1489  }
  1490  
  1491  // Fields allows partial responses to be retrieved. See
  1492  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1493  // details.
  1494  func (c *AdminProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsOperationsDeleteCall {
  1495  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1496  	return c
  1497  }
  1498  
  1499  // Context sets the context to be used in this call's Do method.
  1500  func (c *AdminProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *AdminProjectsLocationsOperationsDeleteCall {
  1501  	c.ctx_ = ctx
  1502  	return c
  1503  }
  1504  
  1505  // Header returns a http.Header that can be modified by the caller to add
  1506  // headers to the request.
  1507  func (c *AdminProjectsLocationsOperationsDeleteCall) Header() http.Header {
  1508  	if c.header_ == nil {
  1509  		c.header_ = make(http.Header)
  1510  	}
  1511  	return c.header_
  1512  }
  1513  
  1514  func (c *AdminProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1515  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1516  	var body io.Reader = nil
  1517  	c.urlParams_.Set("alt", alt)
  1518  	c.urlParams_.Set("prettyPrint", "false")
  1519  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  1520  	urls += "?" + c.urlParams_.Encode()
  1521  	req, err := http.NewRequest("DELETE", urls, body)
  1522  	if err != nil {
  1523  		return nil, err
  1524  	}
  1525  	req.Header = reqHeaders
  1526  	googleapi.Expand(req.URL, map[string]string{
  1527  		"name": c.name,
  1528  	})
  1529  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1530  }
  1531  
  1532  // Do executes the "pubsublite.admin.projects.locations.operations.delete" call.
  1533  // Any non-2xx status code is an error. Response headers are in either
  1534  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1535  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1536  // whether the returned error was because http.StatusNotModified was returned.
  1537  func (c *AdminProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1538  	gensupport.SetOptions(c.urlParams_, opts...)
  1539  	res, err := c.doRequest("json")
  1540  	if res != nil && res.StatusCode == http.StatusNotModified {
  1541  		if res.Body != nil {
  1542  			res.Body.Close()
  1543  		}
  1544  		return nil, gensupport.WrapError(&googleapi.Error{
  1545  			Code:   res.StatusCode,
  1546  			Header: res.Header,
  1547  		})
  1548  	}
  1549  	if err != nil {
  1550  		return nil, err
  1551  	}
  1552  	defer googleapi.CloseBody(res)
  1553  	if err := googleapi.CheckResponse(res); err != nil {
  1554  		return nil, gensupport.WrapError(err)
  1555  	}
  1556  	ret := &Empty{
  1557  		ServerResponse: googleapi.ServerResponse{
  1558  			Header:         res.Header,
  1559  			HTTPStatusCode: res.StatusCode,
  1560  		},
  1561  	}
  1562  	target := &ret
  1563  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1564  		return nil, err
  1565  	}
  1566  	return ret, nil
  1567  }
  1568  
  1569  type AdminProjectsLocationsOperationsGetCall struct {
  1570  	s            *Service
  1571  	name         string
  1572  	urlParams_   gensupport.URLParams
  1573  	ifNoneMatch_ string
  1574  	ctx_         context.Context
  1575  	header_      http.Header
  1576  }
  1577  
  1578  // Get: Gets the latest state of a long-running operation. Clients can use this
  1579  // method to poll the operation result at intervals as recommended by the API
  1580  // service.
  1581  //
  1582  // - name: The name of the operation resource.
  1583  func (r *AdminProjectsLocationsOperationsService) Get(name string) *AdminProjectsLocationsOperationsGetCall {
  1584  	c := &AdminProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1585  	c.name = name
  1586  	return c
  1587  }
  1588  
  1589  // Fields allows partial responses to be retrieved. See
  1590  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1591  // details.
  1592  func (c *AdminProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsOperationsGetCall {
  1593  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1594  	return c
  1595  }
  1596  
  1597  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1598  // object's ETag matches the given value. This is useful for getting updates
  1599  // only after the object has changed since the last request.
  1600  func (c *AdminProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsOperationsGetCall {
  1601  	c.ifNoneMatch_ = entityTag
  1602  	return c
  1603  }
  1604  
  1605  // Context sets the context to be used in this call's Do method.
  1606  func (c *AdminProjectsLocationsOperationsGetCall) Context(ctx context.Context) *AdminProjectsLocationsOperationsGetCall {
  1607  	c.ctx_ = ctx
  1608  	return c
  1609  }
  1610  
  1611  // Header returns a http.Header that can be modified by the caller to add
  1612  // headers to the request.
  1613  func (c *AdminProjectsLocationsOperationsGetCall) Header() http.Header {
  1614  	if c.header_ == nil {
  1615  		c.header_ = make(http.Header)
  1616  	}
  1617  	return c.header_
  1618  }
  1619  
  1620  func (c *AdminProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1621  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1622  	if c.ifNoneMatch_ != "" {
  1623  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1624  	}
  1625  	var body io.Reader = nil
  1626  	c.urlParams_.Set("alt", alt)
  1627  	c.urlParams_.Set("prettyPrint", "false")
  1628  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  1629  	urls += "?" + c.urlParams_.Encode()
  1630  	req, err := http.NewRequest("GET", urls, body)
  1631  	if err != nil {
  1632  		return nil, err
  1633  	}
  1634  	req.Header = reqHeaders
  1635  	googleapi.Expand(req.URL, map[string]string{
  1636  		"name": c.name,
  1637  	})
  1638  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1639  }
  1640  
  1641  // Do executes the "pubsublite.admin.projects.locations.operations.get" call.
  1642  // Any non-2xx status code is an error. Response headers are in either
  1643  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1644  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1645  // whether the returned error was because http.StatusNotModified was returned.
  1646  func (c *AdminProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1647  	gensupport.SetOptions(c.urlParams_, opts...)
  1648  	res, err := c.doRequest("json")
  1649  	if res != nil && res.StatusCode == http.StatusNotModified {
  1650  		if res.Body != nil {
  1651  			res.Body.Close()
  1652  		}
  1653  		return nil, gensupport.WrapError(&googleapi.Error{
  1654  			Code:   res.StatusCode,
  1655  			Header: res.Header,
  1656  		})
  1657  	}
  1658  	if err != nil {
  1659  		return nil, err
  1660  	}
  1661  	defer googleapi.CloseBody(res)
  1662  	if err := googleapi.CheckResponse(res); err != nil {
  1663  		return nil, gensupport.WrapError(err)
  1664  	}
  1665  	ret := &Operation{
  1666  		ServerResponse: googleapi.ServerResponse{
  1667  			Header:         res.Header,
  1668  			HTTPStatusCode: res.StatusCode,
  1669  		},
  1670  	}
  1671  	target := &ret
  1672  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1673  		return nil, err
  1674  	}
  1675  	return ret, nil
  1676  }
  1677  
  1678  type AdminProjectsLocationsOperationsListCall struct {
  1679  	s            *Service
  1680  	name         string
  1681  	urlParams_   gensupport.URLParams
  1682  	ifNoneMatch_ string
  1683  	ctx_         context.Context
  1684  	header_      http.Header
  1685  }
  1686  
  1687  // List: Lists operations that match the specified filter in the request. If
  1688  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  1689  //
  1690  // - name: The name of the operation's parent resource.
  1691  func (r *AdminProjectsLocationsOperationsService) List(name string) *AdminProjectsLocationsOperationsListCall {
  1692  	c := &AdminProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1693  	c.name = name
  1694  	return c
  1695  }
  1696  
  1697  // Filter sets the optional parameter "filter": The standard list filter.
  1698  func (c *AdminProjectsLocationsOperationsListCall) Filter(filter string) *AdminProjectsLocationsOperationsListCall {
  1699  	c.urlParams_.Set("filter", filter)
  1700  	return c
  1701  }
  1702  
  1703  // PageSize sets the optional parameter "pageSize": The standard list page
  1704  // size.
  1705  func (c *AdminProjectsLocationsOperationsListCall) PageSize(pageSize int64) *AdminProjectsLocationsOperationsListCall {
  1706  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1707  	return c
  1708  }
  1709  
  1710  // PageToken sets the optional parameter "pageToken": The standard list page
  1711  // token.
  1712  func (c *AdminProjectsLocationsOperationsListCall) PageToken(pageToken string) *AdminProjectsLocationsOperationsListCall {
  1713  	c.urlParams_.Set("pageToken", pageToken)
  1714  	return c
  1715  }
  1716  
  1717  // Fields allows partial responses to be retrieved. See
  1718  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1719  // details.
  1720  func (c *AdminProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsOperationsListCall {
  1721  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1722  	return c
  1723  }
  1724  
  1725  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1726  // object's ETag matches the given value. This is useful for getting updates
  1727  // only after the object has changed since the last request.
  1728  func (c *AdminProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsOperationsListCall {
  1729  	c.ifNoneMatch_ = entityTag
  1730  	return c
  1731  }
  1732  
  1733  // Context sets the context to be used in this call's Do method.
  1734  func (c *AdminProjectsLocationsOperationsListCall) Context(ctx context.Context) *AdminProjectsLocationsOperationsListCall {
  1735  	c.ctx_ = ctx
  1736  	return c
  1737  }
  1738  
  1739  // Header returns a http.Header that can be modified by the caller to add
  1740  // headers to the request.
  1741  func (c *AdminProjectsLocationsOperationsListCall) Header() http.Header {
  1742  	if c.header_ == nil {
  1743  		c.header_ = make(http.Header)
  1744  	}
  1745  	return c.header_
  1746  }
  1747  
  1748  func (c *AdminProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1749  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1750  	if c.ifNoneMatch_ != "" {
  1751  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1752  	}
  1753  	var body io.Reader = nil
  1754  	c.urlParams_.Set("alt", alt)
  1755  	c.urlParams_.Set("prettyPrint", "false")
  1756  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/operations")
  1757  	urls += "?" + c.urlParams_.Encode()
  1758  	req, err := http.NewRequest("GET", urls, body)
  1759  	if err != nil {
  1760  		return nil, err
  1761  	}
  1762  	req.Header = reqHeaders
  1763  	googleapi.Expand(req.URL, map[string]string{
  1764  		"name": c.name,
  1765  	})
  1766  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1767  }
  1768  
  1769  // Do executes the "pubsublite.admin.projects.locations.operations.list" call.
  1770  // Any non-2xx status code is an error. Response headers are in either
  1771  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  1772  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1773  // check whether the returned error was because http.StatusNotModified was
  1774  // returned.
  1775  func (c *AdminProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1776  	gensupport.SetOptions(c.urlParams_, opts...)
  1777  	res, err := c.doRequest("json")
  1778  	if res != nil && res.StatusCode == http.StatusNotModified {
  1779  		if res.Body != nil {
  1780  			res.Body.Close()
  1781  		}
  1782  		return nil, gensupport.WrapError(&googleapi.Error{
  1783  			Code:   res.StatusCode,
  1784  			Header: res.Header,
  1785  		})
  1786  	}
  1787  	if err != nil {
  1788  		return nil, err
  1789  	}
  1790  	defer googleapi.CloseBody(res)
  1791  	if err := googleapi.CheckResponse(res); err != nil {
  1792  		return nil, gensupport.WrapError(err)
  1793  	}
  1794  	ret := &ListOperationsResponse{
  1795  		ServerResponse: googleapi.ServerResponse{
  1796  			Header:         res.Header,
  1797  			HTTPStatusCode: res.StatusCode,
  1798  		},
  1799  	}
  1800  	target := &ret
  1801  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1802  		return nil, err
  1803  	}
  1804  	return ret, nil
  1805  }
  1806  
  1807  // Pages invokes f for each page of results.
  1808  // A non-nil error returned from f will halt the iteration.
  1809  // The provided context supersedes any context provided to the Context method.
  1810  func (c *AdminProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1811  	c.ctx_ = ctx
  1812  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1813  	for {
  1814  		x, err := c.Do()
  1815  		if err != nil {
  1816  			return err
  1817  		}
  1818  		if err := f(x); err != nil {
  1819  			return err
  1820  		}
  1821  		if x.NextPageToken == "" {
  1822  			return nil
  1823  		}
  1824  		c.PageToken(x.NextPageToken)
  1825  	}
  1826  }
  1827  
  1828  type AdminProjectsLocationsReservationsCreateCall struct {
  1829  	s           *Service
  1830  	parent      string
  1831  	reservation *Reservation
  1832  	urlParams_  gensupport.URLParams
  1833  	ctx_        context.Context
  1834  	header_     http.Header
  1835  }
  1836  
  1837  // Create: Creates a new reservation.
  1838  //
  1839  //   - parent: The parent location in which to create the reservation. Structured
  1840  //     like `projects/{project_number}/locations/{location}`.
  1841  func (r *AdminProjectsLocationsReservationsService) Create(parent string, reservation *Reservation) *AdminProjectsLocationsReservationsCreateCall {
  1842  	c := &AdminProjectsLocationsReservationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1843  	c.parent = parent
  1844  	c.reservation = reservation
  1845  	return c
  1846  }
  1847  
  1848  // ReservationId sets the optional parameter "reservationId": Required. The ID
  1849  // to use for the reservation, which will become the final component of the
  1850  // reservation's name. This value is structured like: `my-reservation-name`.
  1851  func (c *AdminProjectsLocationsReservationsCreateCall) ReservationId(reservationId string) *AdminProjectsLocationsReservationsCreateCall {
  1852  	c.urlParams_.Set("reservationId", reservationId)
  1853  	return c
  1854  }
  1855  
  1856  // Fields allows partial responses to be retrieved. See
  1857  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1858  // details.
  1859  func (c *AdminProjectsLocationsReservationsCreateCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsReservationsCreateCall {
  1860  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1861  	return c
  1862  }
  1863  
  1864  // Context sets the context to be used in this call's Do method.
  1865  func (c *AdminProjectsLocationsReservationsCreateCall) Context(ctx context.Context) *AdminProjectsLocationsReservationsCreateCall {
  1866  	c.ctx_ = ctx
  1867  	return c
  1868  }
  1869  
  1870  // Header returns a http.Header that can be modified by the caller to add
  1871  // headers to the request.
  1872  func (c *AdminProjectsLocationsReservationsCreateCall) Header() http.Header {
  1873  	if c.header_ == nil {
  1874  		c.header_ = make(http.Header)
  1875  	}
  1876  	return c.header_
  1877  }
  1878  
  1879  func (c *AdminProjectsLocationsReservationsCreateCall) doRequest(alt string) (*http.Response, error) {
  1880  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1881  	var body io.Reader = nil
  1882  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation)
  1883  	if err != nil {
  1884  		return nil, err
  1885  	}
  1886  	c.urlParams_.Set("alt", alt)
  1887  	c.urlParams_.Set("prettyPrint", "false")
  1888  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/reservations")
  1889  	urls += "?" + c.urlParams_.Encode()
  1890  	req, err := http.NewRequest("POST", urls, body)
  1891  	if err != nil {
  1892  		return nil, err
  1893  	}
  1894  	req.Header = reqHeaders
  1895  	googleapi.Expand(req.URL, map[string]string{
  1896  		"parent": c.parent,
  1897  	})
  1898  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1899  }
  1900  
  1901  // Do executes the "pubsublite.admin.projects.locations.reservations.create" call.
  1902  // Any non-2xx status code is an error. Response headers are in either
  1903  // *Reservation.ServerResponse.Header or (if a response was returned at all) in
  1904  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1905  // whether the returned error was because http.StatusNotModified was returned.
  1906  func (c *AdminProjectsLocationsReservationsCreateCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  1907  	gensupport.SetOptions(c.urlParams_, opts...)
  1908  	res, err := c.doRequest("json")
  1909  	if res != nil && res.StatusCode == http.StatusNotModified {
  1910  		if res.Body != nil {
  1911  			res.Body.Close()
  1912  		}
  1913  		return nil, gensupport.WrapError(&googleapi.Error{
  1914  			Code:   res.StatusCode,
  1915  			Header: res.Header,
  1916  		})
  1917  	}
  1918  	if err != nil {
  1919  		return nil, err
  1920  	}
  1921  	defer googleapi.CloseBody(res)
  1922  	if err := googleapi.CheckResponse(res); err != nil {
  1923  		return nil, gensupport.WrapError(err)
  1924  	}
  1925  	ret := &Reservation{
  1926  		ServerResponse: googleapi.ServerResponse{
  1927  			Header:         res.Header,
  1928  			HTTPStatusCode: res.StatusCode,
  1929  		},
  1930  	}
  1931  	target := &ret
  1932  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1933  		return nil, err
  1934  	}
  1935  	return ret, nil
  1936  }
  1937  
  1938  type AdminProjectsLocationsReservationsDeleteCall struct {
  1939  	s          *Service
  1940  	name       string
  1941  	urlParams_ gensupport.URLParams
  1942  	ctx_       context.Context
  1943  	header_    http.Header
  1944  }
  1945  
  1946  // Delete: Deletes the specified reservation.
  1947  //
  1948  //   - name: The name of the reservation to delete. Structured like:
  1949  //     projects/{project_number}/locations/{location}/reservations/{reservation_id
  1950  //     }.
  1951  func (r *AdminProjectsLocationsReservationsService) Delete(name string) *AdminProjectsLocationsReservationsDeleteCall {
  1952  	c := &AdminProjectsLocationsReservationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1953  	c.name = name
  1954  	return c
  1955  }
  1956  
  1957  // Fields allows partial responses to be retrieved. See
  1958  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1959  // details.
  1960  func (c *AdminProjectsLocationsReservationsDeleteCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsReservationsDeleteCall {
  1961  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1962  	return c
  1963  }
  1964  
  1965  // Context sets the context to be used in this call's Do method.
  1966  func (c *AdminProjectsLocationsReservationsDeleteCall) Context(ctx context.Context) *AdminProjectsLocationsReservationsDeleteCall {
  1967  	c.ctx_ = ctx
  1968  	return c
  1969  }
  1970  
  1971  // Header returns a http.Header that can be modified by the caller to add
  1972  // headers to the request.
  1973  func (c *AdminProjectsLocationsReservationsDeleteCall) Header() http.Header {
  1974  	if c.header_ == nil {
  1975  		c.header_ = make(http.Header)
  1976  	}
  1977  	return c.header_
  1978  }
  1979  
  1980  func (c *AdminProjectsLocationsReservationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1981  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1982  	var body io.Reader = nil
  1983  	c.urlParams_.Set("alt", alt)
  1984  	c.urlParams_.Set("prettyPrint", "false")
  1985  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  1986  	urls += "?" + c.urlParams_.Encode()
  1987  	req, err := http.NewRequest("DELETE", urls, body)
  1988  	if err != nil {
  1989  		return nil, err
  1990  	}
  1991  	req.Header = reqHeaders
  1992  	googleapi.Expand(req.URL, map[string]string{
  1993  		"name": c.name,
  1994  	})
  1995  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1996  }
  1997  
  1998  // Do executes the "pubsublite.admin.projects.locations.reservations.delete" call.
  1999  // Any non-2xx status code is an error. Response headers are in either
  2000  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2001  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2002  // whether the returned error was because http.StatusNotModified was returned.
  2003  func (c *AdminProjectsLocationsReservationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2004  	gensupport.SetOptions(c.urlParams_, opts...)
  2005  	res, err := c.doRequest("json")
  2006  	if res != nil && res.StatusCode == http.StatusNotModified {
  2007  		if res.Body != nil {
  2008  			res.Body.Close()
  2009  		}
  2010  		return nil, gensupport.WrapError(&googleapi.Error{
  2011  			Code:   res.StatusCode,
  2012  			Header: res.Header,
  2013  		})
  2014  	}
  2015  	if err != nil {
  2016  		return nil, err
  2017  	}
  2018  	defer googleapi.CloseBody(res)
  2019  	if err := googleapi.CheckResponse(res); err != nil {
  2020  		return nil, gensupport.WrapError(err)
  2021  	}
  2022  	ret := &Empty{
  2023  		ServerResponse: googleapi.ServerResponse{
  2024  			Header:         res.Header,
  2025  			HTTPStatusCode: res.StatusCode,
  2026  		},
  2027  	}
  2028  	target := &ret
  2029  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2030  		return nil, err
  2031  	}
  2032  	return ret, nil
  2033  }
  2034  
  2035  type AdminProjectsLocationsReservationsGetCall struct {
  2036  	s            *Service
  2037  	name         string
  2038  	urlParams_   gensupport.URLParams
  2039  	ifNoneMatch_ string
  2040  	ctx_         context.Context
  2041  	header_      http.Header
  2042  }
  2043  
  2044  // Get: Returns the reservation configuration.
  2045  //
  2046  //   - name: The name of the reservation whose configuration to return.
  2047  //     Structured like:
  2048  //     projects/{project_number}/locations/{location}/reservations/{reservation_id
  2049  //     }.
  2050  func (r *AdminProjectsLocationsReservationsService) Get(name string) *AdminProjectsLocationsReservationsGetCall {
  2051  	c := &AdminProjectsLocationsReservationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2052  	c.name = name
  2053  	return c
  2054  }
  2055  
  2056  // Fields allows partial responses to be retrieved. See
  2057  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2058  // details.
  2059  func (c *AdminProjectsLocationsReservationsGetCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsReservationsGetCall {
  2060  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2061  	return c
  2062  }
  2063  
  2064  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2065  // object's ETag matches the given value. This is useful for getting updates
  2066  // only after the object has changed since the last request.
  2067  func (c *AdminProjectsLocationsReservationsGetCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsReservationsGetCall {
  2068  	c.ifNoneMatch_ = entityTag
  2069  	return c
  2070  }
  2071  
  2072  // Context sets the context to be used in this call's Do method.
  2073  func (c *AdminProjectsLocationsReservationsGetCall) Context(ctx context.Context) *AdminProjectsLocationsReservationsGetCall {
  2074  	c.ctx_ = ctx
  2075  	return c
  2076  }
  2077  
  2078  // Header returns a http.Header that can be modified by the caller to add
  2079  // headers to the request.
  2080  func (c *AdminProjectsLocationsReservationsGetCall) Header() http.Header {
  2081  	if c.header_ == nil {
  2082  		c.header_ = make(http.Header)
  2083  	}
  2084  	return c.header_
  2085  }
  2086  
  2087  func (c *AdminProjectsLocationsReservationsGetCall) doRequest(alt string) (*http.Response, error) {
  2088  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2089  	if c.ifNoneMatch_ != "" {
  2090  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2091  	}
  2092  	var body io.Reader = nil
  2093  	c.urlParams_.Set("alt", alt)
  2094  	c.urlParams_.Set("prettyPrint", "false")
  2095  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  2096  	urls += "?" + c.urlParams_.Encode()
  2097  	req, err := http.NewRequest("GET", urls, body)
  2098  	if err != nil {
  2099  		return nil, err
  2100  	}
  2101  	req.Header = reqHeaders
  2102  	googleapi.Expand(req.URL, map[string]string{
  2103  		"name": c.name,
  2104  	})
  2105  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2106  }
  2107  
  2108  // Do executes the "pubsublite.admin.projects.locations.reservations.get" call.
  2109  // Any non-2xx status code is an error. Response headers are in either
  2110  // *Reservation.ServerResponse.Header or (if a response was returned at all) in
  2111  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2112  // whether the returned error was because http.StatusNotModified was returned.
  2113  func (c *AdminProjectsLocationsReservationsGetCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  2114  	gensupport.SetOptions(c.urlParams_, opts...)
  2115  	res, err := c.doRequest("json")
  2116  	if res != nil && res.StatusCode == http.StatusNotModified {
  2117  		if res.Body != nil {
  2118  			res.Body.Close()
  2119  		}
  2120  		return nil, gensupport.WrapError(&googleapi.Error{
  2121  			Code:   res.StatusCode,
  2122  			Header: res.Header,
  2123  		})
  2124  	}
  2125  	if err != nil {
  2126  		return nil, err
  2127  	}
  2128  	defer googleapi.CloseBody(res)
  2129  	if err := googleapi.CheckResponse(res); err != nil {
  2130  		return nil, gensupport.WrapError(err)
  2131  	}
  2132  	ret := &Reservation{
  2133  		ServerResponse: googleapi.ServerResponse{
  2134  			Header:         res.Header,
  2135  			HTTPStatusCode: res.StatusCode,
  2136  		},
  2137  	}
  2138  	target := &ret
  2139  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2140  		return nil, err
  2141  	}
  2142  	return ret, nil
  2143  }
  2144  
  2145  type AdminProjectsLocationsReservationsListCall struct {
  2146  	s            *Service
  2147  	parent       string
  2148  	urlParams_   gensupport.URLParams
  2149  	ifNoneMatch_ string
  2150  	ctx_         context.Context
  2151  	header_      http.Header
  2152  }
  2153  
  2154  // List: Returns the list of reservations for the given project.
  2155  //
  2156  //   - parent: The parent whose reservations are to be listed. Structured like
  2157  //     `projects/{project_number}/locations/{location}`.
  2158  func (r *AdminProjectsLocationsReservationsService) List(parent string) *AdminProjectsLocationsReservationsListCall {
  2159  	c := &AdminProjectsLocationsReservationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2160  	c.parent = parent
  2161  	return c
  2162  }
  2163  
  2164  // PageSize sets the optional parameter "pageSize": The maximum number of
  2165  // reservations to return. The service may return fewer than this value. If
  2166  // unset or zero, all reservations for the parent will be returned.
  2167  func (c *AdminProjectsLocationsReservationsListCall) PageSize(pageSize int64) *AdminProjectsLocationsReservationsListCall {
  2168  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2169  	return c
  2170  }
  2171  
  2172  // PageToken sets the optional parameter "pageToken": A page token, received
  2173  // from a previous `ListReservations` call. Provide this to retrieve the
  2174  // subsequent page. When paginating, all other parameters provided to
  2175  // `ListReservations` must match the call that provided the page token.
  2176  func (c *AdminProjectsLocationsReservationsListCall) PageToken(pageToken string) *AdminProjectsLocationsReservationsListCall {
  2177  	c.urlParams_.Set("pageToken", pageToken)
  2178  	return c
  2179  }
  2180  
  2181  // Fields allows partial responses to be retrieved. See
  2182  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2183  // details.
  2184  func (c *AdminProjectsLocationsReservationsListCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsReservationsListCall {
  2185  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2186  	return c
  2187  }
  2188  
  2189  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2190  // object's ETag matches the given value. This is useful for getting updates
  2191  // only after the object has changed since the last request.
  2192  func (c *AdminProjectsLocationsReservationsListCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsReservationsListCall {
  2193  	c.ifNoneMatch_ = entityTag
  2194  	return c
  2195  }
  2196  
  2197  // Context sets the context to be used in this call's Do method.
  2198  func (c *AdminProjectsLocationsReservationsListCall) Context(ctx context.Context) *AdminProjectsLocationsReservationsListCall {
  2199  	c.ctx_ = ctx
  2200  	return c
  2201  }
  2202  
  2203  // Header returns a http.Header that can be modified by the caller to add
  2204  // headers to the request.
  2205  func (c *AdminProjectsLocationsReservationsListCall) Header() http.Header {
  2206  	if c.header_ == nil {
  2207  		c.header_ = make(http.Header)
  2208  	}
  2209  	return c.header_
  2210  }
  2211  
  2212  func (c *AdminProjectsLocationsReservationsListCall) doRequest(alt string) (*http.Response, error) {
  2213  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2214  	if c.ifNoneMatch_ != "" {
  2215  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2216  	}
  2217  	var body io.Reader = nil
  2218  	c.urlParams_.Set("alt", alt)
  2219  	c.urlParams_.Set("prettyPrint", "false")
  2220  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/reservations")
  2221  	urls += "?" + c.urlParams_.Encode()
  2222  	req, err := http.NewRequest("GET", urls, body)
  2223  	if err != nil {
  2224  		return nil, err
  2225  	}
  2226  	req.Header = reqHeaders
  2227  	googleapi.Expand(req.URL, map[string]string{
  2228  		"parent": c.parent,
  2229  	})
  2230  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2231  }
  2232  
  2233  // Do executes the "pubsublite.admin.projects.locations.reservations.list" call.
  2234  // Any non-2xx status code is an error. Response headers are in either
  2235  // *ListReservationsResponse.ServerResponse.Header or (if a response was
  2236  // returned at all) in error.(*googleapi.Error).Header. Use
  2237  // googleapi.IsNotModified to check whether the returned error was because
  2238  // http.StatusNotModified was returned.
  2239  func (c *AdminProjectsLocationsReservationsListCall) Do(opts ...googleapi.CallOption) (*ListReservationsResponse, error) {
  2240  	gensupport.SetOptions(c.urlParams_, opts...)
  2241  	res, err := c.doRequest("json")
  2242  	if res != nil && res.StatusCode == http.StatusNotModified {
  2243  		if res.Body != nil {
  2244  			res.Body.Close()
  2245  		}
  2246  		return nil, gensupport.WrapError(&googleapi.Error{
  2247  			Code:   res.StatusCode,
  2248  			Header: res.Header,
  2249  		})
  2250  	}
  2251  	if err != nil {
  2252  		return nil, err
  2253  	}
  2254  	defer googleapi.CloseBody(res)
  2255  	if err := googleapi.CheckResponse(res); err != nil {
  2256  		return nil, gensupport.WrapError(err)
  2257  	}
  2258  	ret := &ListReservationsResponse{
  2259  		ServerResponse: googleapi.ServerResponse{
  2260  			Header:         res.Header,
  2261  			HTTPStatusCode: res.StatusCode,
  2262  		},
  2263  	}
  2264  	target := &ret
  2265  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2266  		return nil, err
  2267  	}
  2268  	return ret, nil
  2269  }
  2270  
  2271  // Pages invokes f for each page of results.
  2272  // A non-nil error returned from f will halt the iteration.
  2273  // The provided context supersedes any context provided to the Context method.
  2274  func (c *AdminProjectsLocationsReservationsListCall) Pages(ctx context.Context, f func(*ListReservationsResponse) error) error {
  2275  	c.ctx_ = ctx
  2276  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2277  	for {
  2278  		x, err := c.Do()
  2279  		if err != nil {
  2280  			return err
  2281  		}
  2282  		if err := f(x); err != nil {
  2283  			return err
  2284  		}
  2285  		if x.NextPageToken == "" {
  2286  			return nil
  2287  		}
  2288  		c.PageToken(x.NextPageToken)
  2289  	}
  2290  }
  2291  
  2292  type AdminProjectsLocationsReservationsPatchCall struct {
  2293  	s           *Service
  2294  	name        string
  2295  	reservation *Reservation
  2296  	urlParams_  gensupport.URLParams
  2297  	ctx_        context.Context
  2298  	header_     http.Header
  2299  }
  2300  
  2301  // Patch: Updates properties of the specified reservation.
  2302  //
  2303  //   - name: The name of the reservation. Structured like:
  2304  //     projects/{project_number}/locations/{location}/reservations/{reservation_id
  2305  //     }.
  2306  func (r *AdminProjectsLocationsReservationsService) Patch(name string, reservation *Reservation) *AdminProjectsLocationsReservationsPatchCall {
  2307  	c := &AdminProjectsLocationsReservationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2308  	c.name = name
  2309  	c.reservation = reservation
  2310  	return c
  2311  }
  2312  
  2313  // UpdateMask sets the optional parameter "updateMask": Required. A mask
  2314  // specifying the reservation fields to change.
  2315  func (c *AdminProjectsLocationsReservationsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsReservationsPatchCall {
  2316  	c.urlParams_.Set("updateMask", updateMask)
  2317  	return c
  2318  }
  2319  
  2320  // Fields allows partial responses to be retrieved. See
  2321  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2322  // details.
  2323  func (c *AdminProjectsLocationsReservationsPatchCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsReservationsPatchCall {
  2324  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2325  	return c
  2326  }
  2327  
  2328  // Context sets the context to be used in this call's Do method.
  2329  func (c *AdminProjectsLocationsReservationsPatchCall) Context(ctx context.Context) *AdminProjectsLocationsReservationsPatchCall {
  2330  	c.ctx_ = ctx
  2331  	return c
  2332  }
  2333  
  2334  // Header returns a http.Header that can be modified by the caller to add
  2335  // headers to the request.
  2336  func (c *AdminProjectsLocationsReservationsPatchCall) Header() http.Header {
  2337  	if c.header_ == nil {
  2338  		c.header_ = make(http.Header)
  2339  	}
  2340  	return c.header_
  2341  }
  2342  
  2343  func (c *AdminProjectsLocationsReservationsPatchCall) doRequest(alt string) (*http.Response, error) {
  2344  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2345  	var body io.Reader = nil
  2346  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation)
  2347  	if err != nil {
  2348  		return nil, err
  2349  	}
  2350  	c.urlParams_.Set("alt", alt)
  2351  	c.urlParams_.Set("prettyPrint", "false")
  2352  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  2353  	urls += "?" + c.urlParams_.Encode()
  2354  	req, err := http.NewRequest("PATCH", urls, body)
  2355  	if err != nil {
  2356  		return nil, err
  2357  	}
  2358  	req.Header = reqHeaders
  2359  	googleapi.Expand(req.URL, map[string]string{
  2360  		"name": c.name,
  2361  	})
  2362  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2363  }
  2364  
  2365  // Do executes the "pubsublite.admin.projects.locations.reservations.patch" call.
  2366  // Any non-2xx status code is an error. Response headers are in either
  2367  // *Reservation.ServerResponse.Header or (if a response was returned at all) in
  2368  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2369  // whether the returned error was because http.StatusNotModified was returned.
  2370  func (c *AdminProjectsLocationsReservationsPatchCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  2371  	gensupport.SetOptions(c.urlParams_, opts...)
  2372  	res, err := c.doRequest("json")
  2373  	if res != nil && res.StatusCode == http.StatusNotModified {
  2374  		if res.Body != nil {
  2375  			res.Body.Close()
  2376  		}
  2377  		return nil, gensupport.WrapError(&googleapi.Error{
  2378  			Code:   res.StatusCode,
  2379  			Header: res.Header,
  2380  		})
  2381  	}
  2382  	if err != nil {
  2383  		return nil, err
  2384  	}
  2385  	defer googleapi.CloseBody(res)
  2386  	if err := googleapi.CheckResponse(res); err != nil {
  2387  		return nil, gensupport.WrapError(err)
  2388  	}
  2389  	ret := &Reservation{
  2390  		ServerResponse: googleapi.ServerResponse{
  2391  			Header:         res.Header,
  2392  			HTTPStatusCode: res.StatusCode,
  2393  		},
  2394  	}
  2395  	target := &ret
  2396  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2397  		return nil, err
  2398  	}
  2399  	return ret, nil
  2400  }
  2401  
  2402  type AdminProjectsLocationsReservationsTopicsListCall struct {
  2403  	s            *Service
  2404  	name         string
  2405  	urlParams_   gensupport.URLParams
  2406  	ifNoneMatch_ string
  2407  	ctx_         context.Context
  2408  	header_      http.Header
  2409  }
  2410  
  2411  // List: Lists the topics attached to the specified reservation.
  2412  //
  2413  //   - name: The name of the reservation whose topics to list. Structured like:
  2414  //     projects/{project_number}/locations/{location}/reservations/{reservation_id
  2415  //     }.
  2416  func (r *AdminProjectsLocationsReservationsTopicsService) List(name string) *AdminProjectsLocationsReservationsTopicsListCall {
  2417  	c := &AdminProjectsLocationsReservationsTopicsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2418  	c.name = name
  2419  	return c
  2420  }
  2421  
  2422  // PageSize sets the optional parameter "pageSize": The maximum number of
  2423  // topics to return. The service may return fewer than this value. If unset or
  2424  // zero, all topics for the given reservation will be returned.
  2425  func (c *AdminProjectsLocationsReservationsTopicsListCall) PageSize(pageSize int64) *AdminProjectsLocationsReservationsTopicsListCall {
  2426  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2427  	return c
  2428  }
  2429  
  2430  // PageToken sets the optional parameter "pageToken": A page token, received
  2431  // from a previous `ListReservationTopics` call. Provide this to retrieve the
  2432  // subsequent page. When paginating, all other parameters provided to
  2433  // `ListReservationTopics` must match the call that provided the page token.
  2434  func (c *AdminProjectsLocationsReservationsTopicsListCall) PageToken(pageToken string) *AdminProjectsLocationsReservationsTopicsListCall {
  2435  	c.urlParams_.Set("pageToken", pageToken)
  2436  	return c
  2437  }
  2438  
  2439  // Fields allows partial responses to be retrieved. See
  2440  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2441  // details.
  2442  func (c *AdminProjectsLocationsReservationsTopicsListCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsReservationsTopicsListCall {
  2443  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2444  	return c
  2445  }
  2446  
  2447  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2448  // object's ETag matches the given value. This is useful for getting updates
  2449  // only after the object has changed since the last request.
  2450  func (c *AdminProjectsLocationsReservationsTopicsListCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsReservationsTopicsListCall {
  2451  	c.ifNoneMatch_ = entityTag
  2452  	return c
  2453  }
  2454  
  2455  // Context sets the context to be used in this call's Do method.
  2456  func (c *AdminProjectsLocationsReservationsTopicsListCall) Context(ctx context.Context) *AdminProjectsLocationsReservationsTopicsListCall {
  2457  	c.ctx_ = ctx
  2458  	return c
  2459  }
  2460  
  2461  // Header returns a http.Header that can be modified by the caller to add
  2462  // headers to the request.
  2463  func (c *AdminProjectsLocationsReservationsTopicsListCall) Header() http.Header {
  2464  	if c.header_ == nil {
  2465  		c.header_ = make(http.Header)
  2466  	}
  2467  	return c.header_
  2468  }
  2469  
  2470  func (c *AdminProjectsLocationsReservationsTopicsListCall) doRequest(alt string) (*http.Response, error) {
  2471  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2472  	if c.ifNoneMatch_ != "" {
  2473  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2474  	}
  2475  	var body io.Reader = nil
  2476  	c.urlParams_.Set("alt", alt)
  2477  	c.urlParams_.Set("prettyPrint", "false")
  2478  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/topics")
  2479  	urls += "?" + c.urlParams_.Encode()
  2480  	req, err := http.NewRequest("GET", urls, body)
  2481  	if err != nil {
  2482  		return nil, err
  2483  	}
  2484  	req.Header = reqHeaders
  2485  	googleapi.Expand(req.URL, map[string]string{
  2486  		"name": c.name,
  2487  	})
  2488  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2489  }
  2490  
  2491  // Do executes the "pubsublite.admin.projects.locations.reservations.topics.list" call.
  2492  // Any non-2xx status code is an error. Response headers are in either
  2493  // *ListReservationTopicsResponse.ServerResponse.Header or (if a response was
  2494  // returned at all) in error.(*googleapi.Error).Header. Use
  2495  // googleapi.IsNotModified to check whether the returned error was because
  2496  // http.StatusNotModified was returned.
  2497  func (c *AdminProjectsLocationsReservationsTopicsListCall) Do(opts ...googleapi.CallOption) (*ListReservationTopicsResponse, error) {
  2498  	gensupport.SetOptions(c.urlParams_, opts...)
  2499  	res, err := c.doRequest("json")
  2500  	if res != nil && res.StatusCode == http.StatusNotModified {
  2501  		if res.Body != nil {
  2502  			res.Body.Close()
  2503  		}
  2504  		return nil, gensupport.WrapError(&googleapi.Error{
  2505  			Code:   res.StatusCode,
  2506  			Header: res.Header,
  2507  		})
  2508  	}
  2509  	if err != nil {
  2510  		return nil, err
  2511  	}
  2512  	defer googleapi.CloseBody(res)
  2513  	if err := googleapi.CheckResponse(res); err != nil {
  2514  		return nil, gensupport.WrapError(err)
  2515  	}
  2516  	ret := &ListReservationTopicsResponse{
  2517  		ServerResponse: googleapi.ServerResponse{
  2518  			Header:         res.Header,
  2519  			HTTPStatusCode: res.StatusCode,
  2520  		},
  2521  	}
  2522  	target := &ret
  2523  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2524  		return nil, err
  2525  	}
  2526  	return ret, nil
  2527  }
  2528  
  2529  // Pages invokes f for each page of results.
  2530  // A non-nil error returned from f will halt the iteration.
  2531  // The provided context supersedes any context provided to the Context method.
  2532  func (c *AdminProjectsLocationsReservationsTopicsListCall) Pages(ctx context.Context, f func(*ListReservationTopicsResponse) error) error {
  2533  	c.ctx_ = ctx
  2534  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2535  	for {
  2536  		x, err := c.Do()
  2537  		if err != nil {
  2538  			return err
  2539  		}
  2540  		if err := f(x); err != nil {
  2541  			return err
  2542  		}
  2543  		if x.NextPageToken == "" {
  2544  			return nil
  2545  		}
  2546  		c.PageToken(x.NextPageToken)
  2547  	}
  2548  }
  2549  
  2550  type AdminProjectsLocationsSubscriptionsCreateCall struct {
  2551  	s            *Service
  2552  	parent       string
  2553  	subscription *Subscription
  2554  	urlParams_   gensupport.URLParams
  2555  	ctx_         context.Context
  2556  	header_      http.Header
  2557  }
  2558  
  2559  // Create: Creates a new subscription.
  2560  //
  2561  //   - parent: The parent location in which to create the subscription.
  2562  //     Structured like `projects/{project_number}/locations/{location}`.
  2563  func (r *AdminProjectsLocationsSubscriptionsService) Create(parent string, subscription *Subscription) *AdminProjectsLocationsSubscriptionsCreateCall {
  2564  	c := &AdminProjectsLocationsSubscriptionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2565  	c.parent = parent
  2566  	c.subscription = subscription
  2567  	return c
  2568  }
  2569  
  2570  // SkipBacklog sets the optional parameter "skipBacklog": If true, the newly
  2571  // created subscription will only receive messages published after the
  2572  // subscription was created. Otherwise, the entire message backlog will be
  2573  // received on the subscription. Defaults to false.
  2574  func (c *AdminProjectsLocationsSubscriptionsCreateCall) SkipBacklog(skipBacklog bool) *AdminProjectsLocationsSubscriptionsCreateCall {
  2575  	c.urlParams_.Set("skipBacklog", fmt.Sprint(skipBacklog))
  2576  	return c
  2577  }
  2578  
  2579  // SubscriptionId sets the optional parameter "subscriptionId": Required. The
  2580  // ID to use for the subscription, which will become the final component of the
  2581  // subscription's name. This value is structured like: `my-sub-name`.
  2582  func (c *AdminProjectsLocationsSubscriptionsCreateCall) SubscriptionId(subscriptionId string) *AdminProjectsLocationsSubscriptionsCreateCall {
  2583  	c.urlParams_.Set("subscriptionId", subscriptionId)
  2584  	return c
  2585  }
  2586  
  2587  // Fields allows partial responses to be retrieved. See
  2588  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2589  // details.
  2590  func (c *AdminProjectsLocationsSubscriptionsCreateCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsSubscriptionsCreateCall {
  2591  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2592  	return c
  2593  }
  2594  
  2595  // Context sets the context to be used in this call's Do method.
  2596  func (c *AdminProjectsLocationsSubscriptionsCreateCall) Context(ctx context.Context) *AdminProjectsLocationsSubscriptionsCreateCall {
  2597  	c.ctx_ = ctx
  2598  	return c
  2599  }
  2600  
  2601  // Header returns a http.Header that can be modified by the caller to add
  2602  // headers to the request.
  2603  func (c *AdminProjectsLocationsSubscriptionsCreateCall) Header() http.Header {
  2604  	if c.header_ == nil {
  2605  		c.header_ = make(http.Header)
  2606  	}
  2607  	return c.header_
  2608  }
  2609  
  2610  func (c *AdminProjectsLocationsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) {
  2611  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2612  	var body io.Reader = nil
  2613  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  2614  	if err != nil {
  2615  		return nil, err
  2616  	}
  2617  	c.urlParams_.Set("alt", alt)
  2618  	c.urlParams_.Set("prettyPrint", "false")
  2619  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/subscriptions")
  2620  	urls += "?" + c.urlParams_.Encode()
  2621  	req, err := http.NewRequest("POST", urls, body)
  2622  	if err != nil {
  2623  		return nil, err
  2624  	}
  2625  	req.Header = reqHeaders
  2626  	googleapi.Expand(req.URL, map[string]string{
  2627  		"parent": c.parent,
  2628  	})
  2629  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2630  }
  2631  
  2632  // Do executes the "pubsublite.admin.projects.locations.subscriptions.create" call.
  2633  // Any non-2xx status code is an error. Response headers are in either
  2634  // *Subscription.ServerResponse.Header or (if a response was returned at all)
  2635  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2636  // whether the returned error was because http.StatusNotModified was returned.
  2637  func (c *AdminProjectsLocationsSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  2638  	gensupport.SetOptions(c.urlParams_, opts...)
  2639  	res, err := c.doRequest("json")
  2640  	if res != nil && res.StatusCode == http.StatusNotModified {
  2641  		if res.Body != nil {
  2642  			res.Body.Close()
  2643  		}
  2644  		return nil, gensupport.WrapError(&googleapi.Error{
  2645  			Code:   res.StatusCode,
  2646  			Header: res.Header,
  2647  		})
  2648  	}
  2649  	if err != nil {
  2650  		return nil, err
  2651  	}
  2652  	defer googleapi.CloseBody(res)
  2653  	if err := googleapi.CheckResponse(res); err != nil {
  2654  		return nil, gensupport.WrapError(err)
  2655  	}
  2656  	ret := &Subscription{
  2657  		ServerResponse: googleapi.ServerResponse{
  2658  			Header:         res.Header,
  2659  			HTTPStatusCode: res.StatusCode,
  2660  		},
  2661  	}
  2662  	target := &ret
  2663  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2664  		return nil, err
  2665  	}
  2666  	return ret, nil
  2667  }
  2668  
  2669  type AdminProjectsLocationsSubscriptionsDeleteCall struct {
  2670  	s          *Service
  2671  	name       string
  2672  	urlParams_ gensupport.URLParams
  2673  	ctx_       context.Context
  2674  	header_    http.Header
  2675  }
  2676  
  2677  // Delete: Deletes the specified subscription.
  2678  //
  2679  // - name: The name of the subscription to delete.
  2680  func (r *AdminProjectsLocationsSubscriptionsService) Delete(name string) *AdminProjectsLocationsSubscriptionsDeleteCall {
  2681  	c := &AdminProjectsLocationsSubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2682  	c.name = name
  2683  	return c
  2684  }
  2685  
  2686  // Fields allows partial responses to be retrieved. See
  2687  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2688  // details.
  2689  func (c *AdminProjectsLocationsSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsSubscriptionsDeleteCall {
  2690  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2691  	return c
  2692  }
  2693  
  2694  // Context sets the context to be used in this call's Do method.
  2695  func (c *AdminProjectsLocationsSubscriptionsDeleteCall) Context(ctx context.Context) *AdminProjectsLocationsSubscriptionsDeleteCall {
  2696  	c.ctx_ = ctx
  2697  	return c
  2698  }
  2699  
  2700  // Header returns a http.Header that can be modified by the caller to add
  2701  // headers to the request.
  2702  func (c *AdminProjectsLocationsSubscriptionsDeleteCall) Header() http.Header {
  2703  	if c.header_ == nil {
  2704  		c.header_ = make(http.Header)
  2705  	}
  2706  	return c.header_
  2707  }
  2708  
  2709  func (c *AdminProjectsLocationsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2710  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2711  	var body io.Reader = nil
  2712  	c.urlParams_.Set("alt", alt)
  2713  	c.urlParams_.Set("prettyPrint", "false")
  2714  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  2715  	urls += "?" + c.urlParams_.Encode()
  2716  	req, err := http.NewRequest("DELETE", urls, body)
  2717  	if err != nil {
  2718  		return nil, err
  2719  	}
  2720  	req.Header = reqHeaders
  2721  	googleapi.Expand(req.URL, map[string]string{
  2722  		"name": c.name,
  2723  	})
  2724  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2725  }
  2726  
  2727  // Do executes the "pubsublite.admin.projects.locations.subscriptions.delete" call.
  2728  // Any non-2xx status code is an error. Response headers are in either
  2729  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2730  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2731  // whether the returned error was because http.StatusNotModified was returned.
  2732  func (c *AdminProjectsLocationsSubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2733  	gensupport.SetOptions(c.urlParams_, opts...)
  2734  	res, err := c.doRequest("json")
  2735  	if res != nil && res.StatusCode == http.StatusNotModified {
  2736  		if res.Body != nil {
  2737  			res.Body.Close()
  2738  		}
  2739  		return nil, gensupport.WrapError(&googleapi.Error{
  2740  			Code:   res.StatusCode,
  2741  			Header: res.Header,
  2742  		})
  2743  	}
  2744  	if err != nil {
  2745  		return nil, err
  2746  	}
  2747  	defer googleapi.CloseBody(res)
  2748  	if err := googleapi.CheckResponse(res); err != nil {
  2749  		return nil, gensupport.WrapError(err)
  2750  	}
  2751  	ret := &Empty{
  2752  		ServerResponse: googleapi.ServerResponse{
  2753  			Header:         res.Header,
  2754  			HTTPStatusCode: res.StatusCode,
  2755  		},
  2756  	}
  2757  	target := &ret
  2758  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2759  		return nil, err
  2760  	}
  2761  	return ret, nil
  2762  }
  2763  
  2764  type AdminProjectsLocationsSubscriptionsGetCall struct {
  2765  	s            *Service
  2766  	name         string
  2767  	urlParams_   gensupport.URLParams
  2768  	ifNoneMatch_ string
  2769  	ctx_         context.Context
  2770  	header_      http.Header
  2771  }
  2772  
  2773  // Get: Returns the subscription configuration.
  2774  //
  2775  // - name: The name of the subscription whose configuration to return.
  2776  func (r *AdminProjectsLocationsSubscriptionsService) Get(name string) *AdminProjectsLocationsSubscriptionsGetCall {
  2777  	c := &AdminProjectsLocationsSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2778  	c.name = name
  2779  	return c
  2780  }
  2781  
  2782  // Fields allows partial responses to be retrieved. See
  2783  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2784  // details.
  2785  func (c *AdminProjectsLocationsSubscriptionsGetCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsSubscriptionsGetCall {
  2786  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2787  	return c
  2788  }
  2789  
  2790  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2791  // object's ETag matches the given value. This is useful for getting updates
  2792  // only after the object has changed since the last request.
  2793  func (c *AdminProjectsLocationsSubscriptionsGetCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsSubscriptionsGetCall {
  2794  	c.ifNoneMatch_ = entityTag
  2795  	return c
  2796  }
  2797  
  2798  // Context sets the context to be used in this call's Do method.
  2799  func (c *AdminProjectsLocationsSubscriptionsGetCall) Context(ctx context.Context) *AdminProjectsLocationsSubscriptionsGetCall {
  2800  	c.ctx_ = ctx
  2801  	return c
  2802  }
  2803  
  2804  // Header returns a http.Header that can be modified by the caller to add
  2805  // headers to the request.
  2806  func (c *AdminProjectsLocationsSubscriptionsGetCall) Header() http.Header {
  2807  	if c.header_ == nil {
  2808  		c.header_ = make(http.Header)
  2809  	}
  2810  	return c.header_
  2811  }
  2812  
  2813  func (c *AdminProjectsLocationsSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  2814  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2815  	if c.ifNoneMatch_ != "" {
  2816  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2817  	}
  2818  	var body io.Reader = nil
  2819  	c.urlParams_.Set("alt", alt)
  2820  	c.urlParams_.Set("prettyPrint", "false")
  2821  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  2822  	urls += "?" + c.urlParams_.Encode()
  2823  	req, err := http.NewRequest("GET", urls, body)
  2824  	if err != nil {
  2825  		return nil, err
  2826  	}
  2827  	req.Header = reqHeaders
  2828  	googleapi.Expand(req.URL, map[string]string{
  2829  		"name": c.name,
  2830  	})
  2831  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2832  }
  2833  
  2834  // Do executes the "pubsublite.admin.projects.locations.subscriptions.get" call.
  2835  // Any non-2xx status code is an error. Response headers are in either
  2836  // *Subscription.ServerResponse.Header or (if a response was returned at all)
  2837  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2838  // whether the returned error was because http.StatusNotModified was returned.
  2839  func (c *AdminProjectsLocationsSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  2840  	gensupport.SetOptions(c.urlParams_, opts...)
  2841  	res, err := c.doRequest("json")
  2842  	if res != nil && res.StatusCode == http.StatusNotModified {
  2843  		if res.Body != nil {
  2844  			res.Body.Close()
  2845  		}
  2846  		return nil, gensupport.WrapError(&googleapi.Error{
  2847  			Code:   res.StatusCode,
  2848  			Header: res.Header,
  2849  		})
  2850  	}
  2851  	if err != nil {
  2852  		return nil, err
  2853  	}
  2854  	defer googleapi.CloseBody(res)
  2855  	if err := googleapi.CheckResponse(res); err != nil {
  2856  		return nil, gensupport.WrapError(err)
  2857  	}
  2858  	ret := &Subscription{
  2859  		ServerResponse: googleapi.ServerResponse{
  2860  			Header:         res.Header,
  2861  			HTTPStatusCode: res.StatusCode,
  2862  		},
  2863  	}
  2864  	target := &ret
  2865  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2866  		return nil, err
  2867  	}
  2868  	return ret, nil
  2869  }
  2870  
  2871  type AdminProjectsLocationsSubscriptionsListCall struct {
  2872  	s            *Service
  2873  	parent       string
  2874  	urlParams_   gensupport.URLParams
  2875  	ifNoneMatch_ string
  2876  	ctx_         context.Context
  2877  	header_      http.Header
  2878  }
  2879  
  2880  // List: Returns the list of subscriptions for the given project.
  2881  //
  2882  //   - parent: The parent whose subscriptions are to be listed. Structured like
  2883  //     `projects/{project_number}/locations/{location}`.
  2884  func (r *AdminProjectsLocationsSubscriptionsService) List(parent string) *AdminProjectsLocationsSubscriptionsListCall {
  2885  	c := &AdminProjectsLocationsSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2886  	c.parent = parent
  2887  	return c
  2888  }
  2889  
  2890  // PageSize sets the optional parameter "pageSize": The maximum number of
  2891  // subscriptions to return. The service may return fewer than this value. If
  2892  // unset or zero, all subscriptions for the parent will be returned.
  2893  func (c *AdminProjectsLocationsSubscriptionsListCall) PageSize(pageSize int64) *AdminProjectsLocationsSubscriptionsListCall {
  2894  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2895  	return c
  2896  }
  2897  
  2898  // PageToken sets the optional parameter "pageToken": A page token, received
  2899  // from a previous `ListSubscriptions` call. Provide this to retrieve the
  2900  // subsequent page. When paginating, all other parameters provided to
  2901  // `ListSubscriptions` must match the call that provided the page token.
  2902  func (c *AdminProjectsLocationsSubscriptionsListCall) PageToken(pageToken string) *AdminProjectsLocationsSubscriptionsListCall {
  2903  	c.urlParams_.Set("pageToken", pageToken)
  2904  	return c
  2905  }
  2906  
  2907  // Fields allows partial responses to be retrieved. See
  2908  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2909  // details.
  2910  func (c *AdminProjectsLocationsSubscriptionsListCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsSubscriptionsListCall {
  2911  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2912  	return c
  2913  }
  2914  
  2915  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2916  // object's ETag matches the given value. This is useful for getting updates
  2917  // only after the object has changed since the last request.
  2918  func (c *AdminProjectsLocationsSubscriptionsListCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsSubscriptionsListCall {
  2919  	c.ifNoneMatch_ = entityTag
  2920  	return c
  2921  }
  2922  
  2923  // Context sets the context to be used in this call's Do method.
  2924  func (c *AdminProjectsLocationsSubscriptionsListCall) Context(ctx context.Context) *AdminProjectsLocationsSubscriptionsListCall {
  2925  	c.ctx_ = ctx
  2926  	return c
  2927  }
  2928  
  2929  // Header returns a http.Header that can be modified by the caller to add
  2930  // headers to the request.
  2931  func (c *AdminProjectsLocationsSubscriptionsListCall) Header() http.Header {
  2932  	if c.header_ == nil {
  2933  		c.header_ = make(http.Header)
  2934  	}
  2935  	return c.header_
  2936  }
  2937  
  2938  func (c *AdminProjectsLocationsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  2939  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2940  	if c.ifNoneMatch_ != "" {
  2941  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2942  	}
  2943  	var body io.Reader = nil
  2944  	c.urlParams_.Set("alt", alt)
  2945  	c.urlParams_.Set("prettyPrint", "false")
  2946  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/subscriptions")
  2947  	urls += "?" + c.urlParams_.Encode()
  2948  	req, err := http.NewRequest("GET", urls, body)
  2949  	if err != nil {
  2950  		return nil, err
  2951  	}
  2952  	req.Header = reqHeaders
  2953  	googleapi.Expand(req.URL, map[string]string{
  2954  		"parent": c.parent,
  2955  	})
  2956  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2957  }
  2958  
  2959  // Do executes the "pubsublite.admin.projects.locations.subscriptions.list" call.
  2960  // Any non-2xx status code is an error. Response headers are in either
  2961  // *ListSubscriptionsResponse.ServerResponse.Header or (if a response was
  2962  // returned at all) in error.(*googleapi.Error).Header. Use
  2963  // googleapi.IsNotModified to check whether the returned error was because
  2964  // http.StatusNotModified was returned.
  2965  func (c *AdminProjectsLocationsSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error) {
  2966  	gensupport.SetOptions(c.urlParams_, opts...)
  2967  	res, err := c.doRequest("json")
  2968  	if res != nil && res.StatusCode == http.StatusNotModified {
  2969  		if res.Body != nil {
  2970  			res.Body.Close()
  2971  		}
  2972  		return nil, gensupport.WrapError(&googleapi.Error{
  2973  			Code:   res.StatusCode,
  2974  			Header: res.Header,
  2975  		})
  2976  	}
  2977  	if err != nil {
  2978  		return nil, err
  2979  	}
  2980  	defer googleapi.CloseBody(res)
  2981  	if err := googleapi.CheckResponse(res); err != nil {
  2982  		return nil, gensupport.WrapError(err)
  2983  	}
  2984  	ret := &ListSubscriptionsResponse{
  2985  		ServerResponse: googleapi.ServerResponse{
  2986  			Header:         res.Header,
  2987  			HTTPStatusCode: res.StatusCode,
  2988  		},
  2989  	}
  2990  	target := &ret
  2991  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2992  		return nil, err
  2993  	}
  2994  	return ret, nil
  2995  }
  2996  
  2997  // Pages invokes f for each page of results.
  2998  // A non-nil error returned from f will halt the iteration.
  2999  // The provided context supersedes any context provided to the Context method.
  3000  func (c *AdminProjectsLocationsSubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error {
  3001  	c.ctx_ = ctx
  3002  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3003  	for {
  3004  		x, err := c.Do()
  3005  		if err != nil {
  3006  			return err
  3007  		}
  3008  		if err := f(x); err != nil {
  3009  			return err
  3010  		}
  3011  		if x.NextPageToken == "" {
  3012  			return nil
  3013  		}
  3014  		c.PageToken(x.NextPageToken)
  3015  	}
  3016  }
  3017  
  3018  type AdminProjectsLocationsSubscriptionsPatchCall struct {
  3019  	s            *Service
  3020  	name         string
  3021  	subscription *Subscription
  3022  	urlParams_   gensupport.URLParams
  3023  	ctx_         context.Context
  3024  	header_      http.Header
  3025  }
  3026  
  3027  // Patch: Updates properties of the specified subscription.
  3028  //
  3029  //   - name: The name of the subscription. Structured like:
  3030  //     projects/{project_number}/locations/{location}/subscriptions/{subscription_
  3031  //     id}.
  3032  func (r *AdminProjectsLocationsSubscriptionsService) Patch(name string, subscription *Subscription) *AdminProjectsLocationsSubscriptionsPatchCall {
  3033  	c := &AdminProjectsLocationsSubscriptionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3034  	c.name = name
  3035  	c.subscription = subscription
  3036  	return c
  3037  }
  3038  
  3039  // UpdateMask sets the optional parameter "updateMask": Required. A mask
  3040  // specifying the subscription fields to change.
  3041  func (c *AdminProjectsLocationsSubscriptionsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsSubscriptionsPatchCall {
  3042  	c.urlParams_.Set("updateMask", updateMask)
  3043  	return c
  3044  }
  3045  
  3046  // Fields allows partial responses to be retrieved. See
  3047  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3048  // details.
  3049  func (c *AdminProjectsLocationsSubscriptionsPatchCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsSubscriptionsPatchCall {
  3050  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3051  	return c
  3052  }
  3053  
  3054  // Context sets the context to be used in this call's Do method.
  3055  func (c *AdminProjectsLocationsSubscriptionsPatchCall) Context(ctx context.Context) *AdminProjectsLocationsSubscriptionsPatchCall {
  3056  	c.ctx_ = ctx
  3057  	return c
  3058  }
  3059  
  3060  // Header returns a http.Header that can be modified by the caller to add
  3061  // headers to the request.
  3062  func (c *AdminProjectsLocationsSubscriptionsPatchCall) Header() http.Header {
  3063  	if c.header_ == nil {
  3064  		c.header_ = make(http.Header)
  3065  	}
  3066  	return c.header_
  3067  }
  3068  
  3069  func (c *AdminProjectsLocationsSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) {
  3070  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3071  	var body io.Reader = nil
  3072  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  3073  	if err != nil {
  3074  		return nil, err
  3075  	}
  3076  	c.urlParams_.Set("alt", alt)
  3077  	c.urlParams_.Set("prettyPrint", "false")
  3078  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  3079  	urls += "?" + c.urlParams_.Encode()
  3080  	req, err := http.NewRequest("PATCH", urls, body)
  3081  	if err != nil {
  3082  		return nil, err
  3083  	}
  3084  	req.Header = reqHeaders
  3085  	googleapi.Expand(req.URL, map[string]string{
  3086  		"name": c.name,
  3087  	})
  3088  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3089  }
  3090  
  3091  // Do executes the "pubsublite.admin.projects.locations.subscriptions.patch" call.
  3092  // Any non-2xx status code is an error. Response headers are in either
  3093  // *Subscription.ServerResponse.Header or (if a response was returned at all)
  3094  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3095  // whether the returned error was because http.StatusNotModified was returned.
  3096  func (c *AdminProjectsLocationsSubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  3097  	gensupport.SetOptions(c.urlParams_, opts...)
  3098  	res, err := c.doRequest("json")
  3099  	if res != nil && res.StatusCode == http.StatusNotModified {
  3100  		if res.Body != nil {
  3101  			res.Body.Close()
  3102  		}
  3103  		return nil, gensupport.WrapError(&googleapi.Error{
  3104  			Code:   res.StatusCode,
  3105  			Header: res.Header,
  3106  		})
  3107  	}
  3108  	if err != nil {
  3109  		return nil, err
  3110  	}
  3111  	defer googleapi.CloseBody(res)
  3112  	if err := googleapi.CheckResponse(res); err != nil {
  3113  		return nil, gensupport.WrapError(err)
  3114  	}
  3115  	ret := &Subscription{
  3116  		ServerResponse: googleapi.ServerResponse{
  3117  			Header:         res.Header,
  3118  			HTTPStatusCode: res.StatusCode,
  3119  		},
  3120  	}
  3121  	target := &ret
  3122  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3123  		return nil, err
  3124  	}
  3125  	return ret, nil
  3126  }
  3127  
  3128  type AdminProjectsLocationsSubscriptionsSeekCall struct {
  3129  	s                       *Service
  3130  	name                    string
  3131  	seeksubscriptionrequest *SeekSubscriptionRequest
  3132  	urlParams_              gensupport.URLParams
  3133  	ctx_                    context.Context
  3134  	header_                 http.Header
  3135  }
  3136  
  3137  // Seek: Performs an out-of-band seek for a subscription to a specified target,
  3138  // which may be timestamps or named positions within the message backlog. Seek
  3139  // translates these targets to cursors for each partition and orchestrates
  3140  // subscribers to start consuming messages from these seek cursors. If an
  3141  // operation is returned, the seek has been registered and subscribers will
  3142  // eventually receive messages from the seek cursors (i.e. eventual
  3143  // consistency), as long as they are using a minimum supported client library
  3144  // version and not a system that tracks cursors independently of Pub/Sub Lite
  3145  // (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for
  3146  // unsupported clients. If clients would like to know when subscribers react to
  3147  // the seek (or not), they can poll the operation. The seek operation will
  3148  // succeed and complete once subscribers are ready to receive messages from the
  3149  // seek cursors for all partitions of the topic. This means that the seek
  3150  // operation will not complete until all subscribers come online. If the
  3151  // previous seek operation has not yet completed, it will be aborted and the
  3152  // new invocation of seek will supersede it.
  3153  //
  3154  // - name: The name of the subscription to seek.
  3155  func (r *AdminProjectsLocationsSubscriptionsService) Seek(name string, seeksubscriptionrequest *SeekSubscriptionRequest) *AdminProjectsLocationsSubscriptionsSeekCall {
  3156  	c := &AdminProjectsLocationsSubscriptionsSeekCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3157  	c.name = name
  3158  	c.seeksubscriptionrequest = seeksubscriptionrequest
  3159  	return c
  3160  }
  3161  
  3162  // Fields allows partial responses to be retrieved. See
  3163  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3164  // details.
  3165  func (c *AdminProjectsLocationsSubscriptionsSeekCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsSubscriptionsSeekCall {
  3166  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3167  	return c
  3168  }
  3169  
  3170  // Context sets the context to be used in this call's Do method.
  3171  func (c *AdminProjectsLocationsSubscriptionsSeekCall) Context(ctx context.Context) *AdminProjectsLocationsSubscriptionsSeekCall {
  3172  	c.ctx_ = ctx
  3173  	return c
  3174  }
  3175  
  3176  // Header returns a http.Header that can be modified by the caller to add
  3177  // headers to the request.
  3178  func (c *AdminProjectsLocationsSubscriptionsSeekCall) Header() http.Header {
  3179  	if c.header_ == nil {
  3180  		c.header_ = make(http.Header)
  3181  	}
  3182  	return c.header_
  3183  }
  3184  
  3185  func (c *AdminProjectsLocationsSubscriptionsSeekCall) doRequest(alt string) (*http.Response, error) {
  3186  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3187  	var body io.Reader = nil
  3188  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.seeksubscriptionrequest)
  3189  	if err != nil {
  3190  		return nil, err
  3191  	}
  3192  	c.urlParams_.Set("alt", alt)
  3193  	c.urlParams_.Set("prettyPrint", "false")
  3194  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}:seek")
  3195  	urls += "?" + c.urlParams_.Encode()
  3196  	req, err := http.NewRequest("POST", urls, body)
  3197  	if err != nil {
  3198  		return nil, err
  3199  	}
  3200  	req.Header = reqHeaders
  3201  	googleapi.Expand(req.URL, map[string]string{
  3202  		"name": c.name,
  3203  	})
  3204  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3205  }
  3206  
  3207  // Do executes the "pubsublite.admin.projects.locations.subscriptions.seek" call.
  3208  // Any non-2xx status code is an error. Response headers are in either
  3209  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3210  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3211  // whether the returned error was because http.StatusNotModified was returned.
  3212  func (c *AdminProjectsLocationsSubscriptionsSeekCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3213  	gensupport.SetOptions(c.urlParams_, opts...)
  3214  	res, err := c.doRequest("json")
  3215  	if res != nil && res.StatusCode == http.StatusNotModified {
  3216  		if res.Body != nil {
  3217  			res.Body.Close()
  3218  		}
  3219  		return nil, gensupport.WrapError(&googleapi.Error{
  3220  			Code:   res.StatusCode,
  3221  			Header: res.Header,
  3222  		})
  3223  	}
  3224  	if err != nil {
  3225  		return nil, err
  3226  	}
  3227  	defer googleapi.CloseBody(res)
  3228  	if err := googleapi.CheckResponse(res); err != nil {
  3229  		return nil, gensupport.WrapError(err)
  3230  	}
  3231  	ret := &Operation{
  3232  		ServerResponse: googleapi.ServerResponse{
  3233  			Header:         res.Header,
  3234  			HTTPStatusCode: res.StatusCode,
  3235  		},
  3236  	}
  3237  	target := &ret
  3238  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3239  		return nil, err
  3240  	}
  3241  	return ret, nil
  3242  }
  3243  
  3244  type AdminProjectsLocationsTopicsCreateCall struct {
  3245  	s          *Service
  3246  	parent     string
  3247  	topic      *Topic
  3248  	urlParams_ gensupport.URLParams
  3249  	ctx_       context.Context
  3250  	header_    http.Header
  3251  }
  3252  
  3253  // Create: Creates a new topic.
  3254  //
  3255  //   - parent: The parent location in which to create the topic. Structured like
  3256  //     `projects/{project_number}/locations/{location}`.
  3257  func (r *AdminProjectsLocationsTopicsService) Create(parent string, topic *Topic) *AdminProjectsLocationsTopicsCreateCall {
  3258  	c := &AdminProjectsLocationsTopicsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3259  	c.parent = parent
  3260  	c.topic = topic
  3261  	return c
  3262  }
  3263  
  3264  // TopicId sets the optional parameter "topicId": Required. The ID to use for
  3265  // the topic, which will become the final component of the topic's name. This
  3266  // value is structured like: `my-topic-name`.
  3267  func (c *AdminProjectsLocationsTopicsCreateCall) TopicId(topicId string) *AdminProjectsLocationsTopicsCreateCall {
  3268  	c.urlParams_.Set("topicId", topicId)
  3269  	return c
  3270  }
  3271  
  3272  // Fields allows partial responses to be retrieved. See
  3273  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3274  // details.
  3275  func (c *AdminProjectsLocationsTopicsCreateCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsTopicsCreateCall {
  3276  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3277  	return c
  3278  }
  3279  
  3280  // Context sets the context to be used in this call's Do method.
  3281  func (c *AdminProjectsLocationsTopicsCreateCall) Context(ctx context.Context) *AdminProjectsLocationsTopicsCreateCall {
  3282  	c.ctx_ = ctx
  3283  	return c
  3284  }
  3285  
  3286  // Header returns a http.Header that can be modified by the caller to add
  3287  // headers to the request.
  3288  func (c *AdminProjectsLocationsTopicsCreateCall) Header() http.Header {
  3289  	if c.header_ == nil {
  3290  		c.header_ = make(http.Header)
  3291  	}
  3292  	return c.header_
  3293  }
  3294  
  3295  func (c *AdminProjectsLocationsTopicsCreateCall) doRequest(alt string) (*http.Response, error) {
  3296  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3297  	var body io.Reader = nil
  3298  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic)
  3299  	if err != nil {
  3300  		return nil, err
  3301  	}
  3302  	c.urlParams_.Set("alt", alt)
  3303  	c.urlParams_.Set("prettyPrint", "false")
  3304  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/topics")
  3305  	urls += "?" + c.urlParams_.Encode()
  3306  	req, err := http.NewRequest("POST", urls, body)
  3307  	if err != nil {
  3308  		return nil, err
  3309  	}
  3310  	req.Header = reqHeaders
  3311  	googleapi.Expand(req.URL, map[string]string{
  3312  		"parent": c.parent,
  3313  	})
  3314  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3315  }
  3316  
  3317  // Do executes the "pubsublite.admin.projects.locations.topics.create" call.
  3318  // Any non-2xx status code is an error. Response headers are in either
  3319  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  3320  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3321  // whether the returned error was because http.StatusNotModified was returned.
  3322  func (c *AdminProjectsLocationsTopicsCreateCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  3323  	gensupport.SetOptions(c.urlParams_, opts...)
  3324  	res, err := c.doRequest("json")
  3325  	if res != nil && res.StatusCode == http.StatusNotModified {
  3326  		if res.Body != nil {
  3327  			res.Body.Close()
  3328  		}
  3329  		return nil, gensupport.WrapError(&googleapi.Error{
  3330  			Code:   res.StatusCode,
  3331  			Header: res.Header,
  3332  		})
  3333  	}
  3334  	if err != nil {
  3335  		return nil, err
  3336  	}
  3337  	defer googleapi.CloseBody(res)
  3338  	if err := googleapi.CheckResponse(res); err != nil {
  3339  		return nil, gensupport.WrapError(err)
  3340  	}
  3341  	ret := &Topic{
  3342  		ServerResponse: googleapi.ServerResponse{
  3343  			Header:         res.Header,
  3344  			HTTPStatusCode: res.StatusCode,
  3345  		},
  3346  	}
  3347  	target := &ret
  3348  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3349  		return nil, err
  3350  	}
  3351  	return ret, nil
  3352  }
  3353  
  3354  type AdminProjectsLocationsTopicsDeleteCall struct {
  3355  	s          *Service
  3356  	name       string
  3357  	urlParams_ gensupport.URLParams
  3358  	ctx_       context.Context
  3359  	header_    http.Header
  3360  }
  3361  
  3362  // Delete: Deletes the specified topic.
  3363  //
  3364  // - name: The name of the topic to delete.
  3365  func (r *AdminProjectsLocationsTopicsService) Delete(name string) *AdminProjectsLocationsTopicsDeleteCall {
  3366  	c := &AdminProjectsLocationsTopicsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3367  	c.name = name
  3368  	return c
  3369  }
  3370  
  3371  // Fields allows partial responses to be retrieved. See
  3372  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3373  // details.
  3374  func (c *AdminProjectsLocationsTopicsDeleteCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsTopicsDeleteCall {
  3375  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3376  	return c
  3377  }
  3378  
  3379  // Context sets the context to be used in this call's Do method.
  3380  func (c *AdminProjectsLocationsTopicsDeleteCall) Context(ctx context.Context) *AdminProjectsLocationsTopicsDeleteCall {
  3381  	c.ctx_ = ctx
  3382  	return c
  3383  }
  3384  
  3385  // Header returns a http.Header that can be modified by the caller to add
  3386  // headers to the request.
  3387  func (c *AdminProjectsLocationsTopicsDeleteCall) Header() http.Header {
  3388  	if c.header_ == nil {
  3389  		c.header_ = make(http.Header)
  3390  	}
  3391  	return c.header_
  3392  }
  3393  
  3394  func (c *AdminProjectsLocationsTopicsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3395  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3396  	var body io.Reader = nil
  3397  	c.urlParams_.Set("alt", alt)
  3398  	c.urlParams_.Set("prettyPrint", "false")
  3399  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  3400  	urls += "?" + c.urlParams_.Encode()
  3401  	req, err := http.NewRequest("DELETE", urls, body)
  3402  	if err != nil {
  3403  		return nil, err
  3404  	}
  3405  	req.Header = reqHeaders
  3406  	googleapi.Expand(req.URL, map[string]string{
  3407  		"name": c.name,
  3408  	})
  3409  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3410  }
  3411  
  3412  // Do executes the "pubsublite.admin.projects.locations.topics.delete" call.
  3413  // Any non-2xx status code is an error. Response headers are in either
  3414  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3415  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3416  // whether the returned error was because http.StatusNotModified was returned.
  3417  func (c *AdminProjectsLocationsTopicsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3418  	gensupport.SetOptions(c.urlParams_, opts...)
  3419  	res, err := c.doRequest("json")
  3420  	if res != nil && res.StatusCode == http.StatusNotModified {
  3421  		if res.Body != nil {
  3422  			res.Body.Close()
  3423  		}
  3424  		return nil, gensupport.WrapError(&googleapi.Error{
  3425  			Code:   res.StatusCode,
  3426  			Header: res.Header,
  3427  		})
  3428  	}
  3429  	if err != nil {
  3430  		return nil, err
  3431  	}
  3432  	defer googleapi.CloseBody(res)
  3433  	if err := googleapi.CheckResponse(res); err != nil {
  3434  		return nil, gensupport.WrapError(err)
  3435  	}
  3436  	ret := &Empty{
  3437  		ServerResponse: googleapi.ServerResponse{
  3438  			Header:         res.Header,
  3439  			HTTPStatusCode: res.StatusCode,
  3440  		},
  3441  	}
  3442  	target := &ret
  3443  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3444  		return nil, err
  3445  	}
  3446  	return ret, nil
  3447  }
  3448  
  3449  type AdminProjectsLocationsTopicsGetCall struct {
  3450  	s            *Service
  3451  	name         string
  3452  	urlParams_   gensupport.URLParams
  3453  	ifNoneMatch_ string
  3454  	ctx_         context.Context
  3455  	header_      http.Header
  3456  }
  3457  
  3458  // Get: Returns the topic configuration.
  3459  //
  3460  // - name: The name of the topic whose configuration to return.
  3461  func (r *AdminProjectsLocationsTopicsService) Get(name string) *AdminProjectsLocationsTopicsGetCall {
  3462  	c := &AdminProjectsLocationsTopicsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3463  	c.name = name
  3464  	return c
  3465  }
  3466  
  3467  // Fields allows partial responses to be retrieved. See
  3468  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3469  // details.
  3470  func (c *AdminProjectsLocationsTopicsGetCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsTopicsGetCall {
  3471  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3472  	return c
  3473  }
  3474  
  3475  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3476  // object's ETag matches the given value. This is useful for getting updates
  3477  // only after the object has changed since the last request.
  3478  func (c *AdminProjectsLocationsTopicsGetCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsTopicsGetCall {
  3479  	c.ifNoneMatch_ = entityTag
  3480  	return c
  3481  }
  3482  
  3483  // Context sets the context to be used in this call's Do method.
  3484  func (c *AdminProjectsLocationsTopicsGetCall) Context(ctx context.Context) *AdminProjectsLocationsTopicsGetCall {
  3485  	c.ctx_ = ctx
  3486  	return c
  3487  }
  3488  
  3489  // Header returns a http.Header that can be modified by the caller to add
  3490  // headers to the request.
  3491  func (c *AdminProjectsLocationsTopicsGetCall) Header() http.Header {
  3492  	if c.header_ == nil {
  3493  		c.header_ = make(http.Header)
  3494  	}
  3495  	return c.header_
  3496  }
  3497  
  3498  func (c *AdminProjectsLocationsTopicsGetCall) doRequest(alt string) (*http.Response, error) {
  3499  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3500  	if c.ifNoneMatch_ != "" {
  3501  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3502  	}
  3503  	var body io.Reader = nil
  3504  	c.urlParams_.Set("alt", alt)
  3505  	c.urlParams_.Set("prettyPrint", "false")
  3506  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  3507  	urls += "?" + c.urlParams_.Encode()
  3508  	req, err := http.NewRequest("GET", urls, body)
  3509  	if err != nil {
  3510  		return nil, err
  3511  	}
  3512  	req.Header = reqHeaders
  3513  	googleapi.Expand(req.URL, map[string]string{
  3514  		"name": c.name,
  3515  	})
  3516  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3517  }
  3518  
  3519  // Do executes the "pubsublite.admin.projects.locations.topics.get" call.
  3520  // Any non-2xx status code is an error. Response headers are in either
  3521  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  3522  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3523  // whether the returned error was because http.StatusNotModified was returned.
  3524  func (c *AdminProjectsLocationsTopicsGetCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  3525  	gensupport.SetOptions(c.urlParams_, opts...)
  3526  	res, err := c.doRequest("json")
  3527  	if res != nil && res.StatusCode == http.StatusNotModified {
  3528  		if res.Body != nil {
  3529  			res.Body.Close()
  3530  		}
  3531  		return nil, gensupport.WrapError(&googleapi.Error{
  3532  			Code:   res.StatusCode,
  3533  			Header: res.Header,
  3534  		})
  3535  	}
  3536  	if err != nil {
  3537  		return nil, err
  3538  	}
  3539  	defer googleapi.CloseBody(res)
  3540  	if err := googleapi.CheckResponse(res); err != nil {
  3541  		return nil, gensupport.WrapError(err)
  3542  	}
  3543  	ret := &Topic{
  3544  		ServerResponse: googleapi.ServerResponse{
  3545  			Header:         res.Header,
  3546  			HTTPStatusCode: res.StatusCode,
  3547  		},
  3548  	}
  3549  	target := &ret
  3550  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3551  		return nil, err
  3552  	}
  3553  	return ret, nil
  3554  }
  3555  
  3556  type AdminProjectsLocationsTopicsGetPartitionsCall struct {
  3557  	s            *Service
  3558  	name         string
  3559  	urlParams_   gensupport.URLParams
  3560  	ifNoneMatch_ string
  3561  	ctx_         context.Context
  3562  	header_      http.Header
  3563  }
  3564  
  3565  // GetPartitions: Returns the partition information for the requested topic.
  3566  //
  3567  // - name: The topic whose partition information to return.
  3568  func (r *AdminProjectsLocationsTopicsService) GetPartitions(name string) *AdminProjectsLocationsTopicsGetPartitionsCall {
  3569  	c := &AdminProjectsLocationsTopicsGetPartitionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3570  	c.name = name
  3571  	return c
  3572  }
  3573  
  3574  // Fields allows partial responses to be retrieved. See
  3575  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3576  // details.
  3577  func (c *AdminProjectsLocationsTopicsGetPartitionsCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsTopicsGetPartitionsCall {
  3578  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3579  	return c
  3580  }
  3581  
  3582  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3583  // object's ETag matches the given value. This is useful for getting updates
  3584  // only after the object has changed since the last request.
  3585  func (c *AdminProjectsLocationsTopicsGetPartitionsCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsTopicsGetPartitionsCall {
  3586  	c.ifNoneMatch_ = entityTag
  3587  	return c
  3588  }
  3589  
  3590  // Context sets the context to be used in this call's Do method.
  3591  func (c *AdminProjectsLocationsTopicsGetPartitionsCall) Context(ctx context.Context) *AdminProjectsLocationsTopicsGetPartitionsCall {
  3592  	c.ctx_ = ctx
  3593  	return c
  3594  }
  3595  
  3596  // Header returns a http.Header that can be modified by the caller to add
  3597  // headers to the request.
  3598  func (c *AdminProjectsLocationsTopicsGetPartitionsCall) Header() http.Header {
  3599  	if c.header_ == nil {
  3600  		c.header_ = make(http.Header)
  3601  	}
  3602  	return c.header_
  3603  }
  3604  
  3605  func (c *AdminProjectsLocationsTopicsGetPartitionsCall) doRequest(alt string) (*http.Response, error) {
  3606  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3607  	if c.ifNoneMatch_ != "" {
  3608  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3609  	}
  3610  	var body io.Reader = nil
  3611  	c.urlParams_.Set("alt", alt)
  3612  	c.urlParams_.Set("prettyPrint", "false")
  3613  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/partitions")
  3614  	urls += "?" + c.urlParams_.Encode()
  3615  	req, err := http.NewRequest("GET", urls, body)
  3616  	if err != nil {
  3617  		return nil, err
  3618  	}
  3619  	req.Header = reqHeaders
  3620  	googleapi.Expand(req.URL, map[string]string{
  3621  		"name": c.name,
  3622  	})
  3623  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3624  }
  3625  
  3626  // Do executes the "pubsublite.admin.projects.locations.topics.getPartitions" call.
  3627  // Any non-2xx status code is an error. Response headers are in either
  3628  // *TopicPartitions.ServerResponse.Header or (if a response was returned at
  3629  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3630  // check whether the returned error was because http.StatusNotModified was
  3631  // returned.
  3632  func (c *AdminProjectsLocationsTopicsGetPartitionsCall) Do(opts ...googleapi.CallOption) (*TopicPartitions, error) {
  3633  	gensupport.SetOptions(c.urlParams_, opts...)
  3634  	res, err := c.doRequest("json")
  3635  	if res != nil && res.StatusCode == http.StatusNotModified {
  3636  		if res.Body != nil {
  3637  			res.Body.Close()
  3638  		}
  3639  		return nil, gensupport.WrapError(&googleapi.Error{
  3640  			Code:   res.StatusCode,
  3641  			Header: res.Header,
  3642  		})
  3643  	}
  3644  	if err != nil {
  3645  		return nil, err
  3646  	}
  3647  	defer googleapi.CloseBody(res)
  3648  	if err := googleapi.CheckResponse(res); err != nil {
  3649  		return nil, gensupport.WrapError(err)
  3650  	}
  3651  	ret := &TopicPartitions{
  3652  		ServerResponse: googleapi.ServerResponse{
  3653  			Header:         res.Header,
  3654  			HTTPStatusCode: res.StatusCode,
  3655  		},
  3656  	}
  3657  	target := &ret
  3658  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3659  		return nil, err
  3660  	}
  3661  	return ret, nil
  3662  }
  3663  
  3664  type AdminProjectsLocationsTopicsListCall struct {
  3665  	s            *Service
  3666  	parent       string
  3667  	urlParams_   gensupport.URLParams
  3668  	ifNoneMatch_ string
  3669  	ctx_         context.Context
  3670  	header_      http.Header
  3671  }
  3672  
  3673  // List: Returns the list of topics for the given project.
  3674  //
  3675  //   - parent: The parent whose topics are to be listed. Structured like
  3676  //     `projects/{project_number}/locations/{location}`.
  3677  func (r *AdminProjectsLocationsTopicsService) List(parent string) *AdminProjectsLocationsTopicsListCall {
  3678  	c := &AdminProjectsLocationsTopicsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3679  	c.parent = parent
  3680  	return c
  3681  }
  3682  
  3683  // PageSize sets the optional parameter "pageSize": The maximum number of
  3684  // topics to return. The service may return fewer than this value. If unset or
  3685  // zero, all topics for the parent will be returned.
  3686  func (c *AdminProjectsLocationsTopicsListCall) PageSize(pageSize int64) *AdminProjectsLocationsTopicsListCall {
  3687  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3688  	return c
  3689  }
  3690  
  3691  // PageToken sets the optional parameter "pageToken": A page token, received
  3692  // from a previous `ListTopics` call. Provide this to retrieve the subsequent
  3693  // page. When paginating, all other parameters provided to `ListTopics` must
  3694  // match the call that provided the page token.
  3695  func (c *AdminProjectsLocationsTopicsListCall) PageToken(pageToken string) *AdminProjectsLocationsTopicsListCall {
  3696  	c.urlParams_.Set("pageToken", pageToken)
  3697  	return c
  3698  }
  3699  
  3700  // Fields allows partial responses to be retrieved. See
  3701  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3702  // details.
  3703  func (c *AdminProjectsLocationsTopicsListCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsTopicsListCall {
  3704  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3705  	return c
  3706  }
  3707  
  3708  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3709  // object's ETag matches the given value. This is useful for getting updates
  3710  // only after the object has changed since the last request.
  3711  func (c *AdminProjectsLocationsTopicsListCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsTopicsListCall {
  3712  	c.ifNoneMatch_ = entityTag
  3713  	return c
  3714  }
  3715  
  3716  // Context sets the context to be used in this call's Do method.
  3717  func (c *AdminProjectsLocationsTopicsListCall) Context(ctx context.Context) *AdminProjectsLocationsTopicsListCall {
  3718  	c.ctx_ = ctx
  3719  	return c
  3720  }
  3721  
  3722  // Header returns a http.Header that can be modified by the caller to add
  3723  // headers to the request.
  3724  func (c *AdminProjectsLocationsTopicsListCall) Header() http.Header {
  3725  	if c.header_ == nil {
  3726  		c.header_ = make(http.Header)
  3727  	}
  3728  	return c.header_
  3729  }
  3730  
  3731  func (c *AdminProjectsLocationsTopicsListCall) doRequest(alt string) (*http.Response, error) {
  3732  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3733  	if c.ifNoneMatch_ != "" {
  3734  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3735  	}
  3736  	var body io.Reader = nil
  3737  	c.urlParams_.Set("alt", alt)
  3738  	c.urlParams_.Set("prettyPrint", "false")
  3739  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+parent}/topics")
  3740  	urls += "?" + c.urlParams_.Encode()
  3741  	req, err := http.NewRequest("GET", urls, body)
  3742  	if err != nil {
  3743  		return nil, err
  3744  	}
  3745  	req.Header = reqHeaders
  3746  	googleapi.Expand(req.URL, map[string]string{
  3747  		"parent": c.parent,
  3748  	})
  3749  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3750  }
  3751  
  3752  // Do executes the "pubsublite.admin.projects.locations.topics.list" call.
  3753  // Any non-2xx status code is an error. Response headers are in either
  3754  // *ListTopicsResponse.ServerResponse.Header or (if a response was returned at
  3755  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3756  // check whether the returned error was because http.StatusNotModified was
  3757  // returned.
  3758  func (c *AdminProjectsLocationsTopicsListCall) Do(opts ...googleapi.CallOption) (*ListTopicsResponse, error) {
  3759  	gensupport.SetOptions(c.urlParams_, opts...)
  3760  	res, err := c.doRequest("json")
  3761  	if res != nil && res.StatusCode == http.StatusNotModified {
  3762  		if res.Body != nil {
  3763  			res.Body.Close()
  3764  		}
  3765  		return nil, gensupport.WrapError(&googleapi.Error{
  3766  			Code:   res.StatusCode,
  3767  			Header: res.Header,
  3768  		})
  3769  	}
  3770  	if err != nil {
  3771  		return nil, err
  3772  	}
  3773  	defer googleapi.CloseBody(res)
  3774  	if err := googleapi.CheckResponse(res); err != nil {
  3775  		return nil, gensupport.WrapError(err)
  3776  	}
  3777  	ret := &ListTopicsResponse{
  3778  		ServerResponse: googleapi.ServerResponse{
  3779  			Header:         res.Header,
  3780  			HTTPStatusCode: res.StatusCode,
  3781  		},
  3782  	}
  3783  	target := &ret
  3784  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3785  		return nil, err
  3786  	}
  3787  	return ret, nil
  3788  }
  3789  
  3790  // Pages invokes f for each page of results.
  3791  // A non-nil error returned from f will halt the iteration.
  3792  // The provided context supersedes any context provided to the Context method.
  3793  func (c *AdminProjectsLocationsTopicsListCall) Pages(ctx context.Context, f func(*ListTopicsResponse) error) error {
  3794  	c.ctx_ = ctx
  3795  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3796  	for {
  3797  		x, err := c.Do()
  3798  		if err != nil {
  3799  			return err
  3800  		}
  3801  		if err := f(x); err != nil {
  3802  			return err
  3803  		}
  3804  		if x.NextPageToken == "" {
  3805  			return nil
  3806  		}
  3807  		c.PageToken(x.NextPageToken)
  3808  	}
  3809  }
  3810  
  3811  type AdminProjectsLocationsTopicsPatchCall struct {
  3812  	s          *Service
  3813  	name       string
  3814  	topic      *Topic
  3815  	urlParams_ gensupport.URLParams
  3816  	ctx_       context.Context
  3817  	header_    http.Header
  3818  }
  3819  
  3820  // Patch: Updates properties of the specified topic.
  3821  //
  3822  //   - name: The name of the topic. Structured like:
  3823  //     projects/{project_number}/locations/{location}/topics/{topic_id}.
  3824  func (r *AdminProjectsLocationsTopicsService) Patch(name string, topic *Topic) *AdminProjectsLocationsTopicsPatchCall {
  3825  	c := &AdminProjectsLocationsTopicsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3826  	c.name = name
  3827  	c.topic = topic
  3828  	return c
  3829  }
  3830  
  3831  // UpdateMask sets the optional parameter "updateMask": Required. A mask
  3832  // specifying the topic fields to change.
  3833  func (c *AdminProjectsLocationsTopicsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsTopicsPatchCall {
  3834  	c.urlParams_.Set("updateMask", updateMask)
  3835  	return c
  3836  }
  3837  
  3838  // Fields allows partial responses to be retrieved. See
  3839  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3840  // details.
  3841  func (c *AdminProjectsLocationsTopicsPatchCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsTopicsPatchCall {
  3842  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3843  	return c
  3844  }
  3845  
  3846  // Context sets the context to be used in this call's Do method.
  3847  func (c *AdminProjectsLocationsTopicsPatchCall) Context(ctx context.Context) *AdminProjectsLocationsTopicsPatchCall {
  3848  	c.ctx_ = ctx
  3849  	return c
  3850  }
  3851  
  3852  // Header returns a http.Header that can be modified by the caller to add
  3853  // headers to the request.
  3854  func (c *AdminProjectsLocationsTopicsPatchCall) Header() http.Header {
  3855  	if c.header_ == nil {
  3856  		c.header_ = make(http.Header)
  3857  	}
  3858  	return c.header_
  3859  }
  3860  
  3861  func (c *AdminProjectsLocationsTopicsPatchCall) doRequest(alt string) (*http.Response, error) {
  3862  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3863  	var body io.Reader = nil
  3864  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic)
  3865  	if err != nil {
  3866  		return nil, err
  3867  	}
  3868  	c.urlParams_.Set("alt", alt)
  3869  	c.urlParams_.Set("prettyPrint", "false")
  3870  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}")
  3871  	urls += "?" + c.urlParams_.Encode()
  3872  	req, err := http.NewRequest("PATCH", urls, body)
  3873  	if err != nil {
  3874  		return nil, err
  3875  	}
  3876  	req.Header = reqHeaders
  3877  	googleapi.Expand(req.URL, map[string]string{
  3878  		"name": c.name,
  3879  	})
  3880  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3881  }
  3882  
  3883  // Do executes the "pubsublite.admin.projects.locations.topics.patch" call.
  3884  // Any non-2xx status code is an error. Response headers are in either
  3885  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  3886  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3887  // whether the returned error was because http.StatusNotModified was returned.
  3888  func (c *AdminProjectsLocationsTopicsPatchCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  3889  	gensupport.SetOptions(c.urlParams_, opts...)
  3890  	res, err := c.doRequest("json")
  3891  	if res != nil && res.StatusCode == http.StatusNotModified {
  3892  		if res.Body != nil {
  3893  			res.Body.Close()
  3894  		}
  3895  		return nil, gensupport.WrapError(&googleapi.Error{
  3896  			Code:   res.StatusCode,
  3897  			Header: res.Header,
  3898  		})
  3899  	}
  3900  	if err != nil {
  3901  		return nil, err
  3902  	}
  3903  	defer googleapi.CloseBody(res)
  3904  	if err := googleapi.CheckResponse(res); err != nil {
  3905  		return nil, gensupport.WrapError(err)
  3906  	}
  3907  	ret := &Topic{
  3908  		ServerResponse: googleapi.ServerResponse{
  3909  			Header:         res.Header,
  3910  			HTTPStatusCode: res.StatusCode,
  3911  		},
  3912  	}
  3913  	target := &ret
  3914  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3915  		return nil, err
  3916  	}
  3917  	return ret, nil
  3918  }
  3919  
  3920  type AdminProjectsLocationsTopicsSubscriptionsListCall struct {
  3921  	s            *Service
  3922  	name         string
  3923  	urlParams_   gensupport.URLParams
  3924  	ifNoneMatch_ string
  3925  	ctx_         context.Context
  3926  	header_      http.Header
  3927  }
  3928  
  3929  // List: Lists the subscriptions attached to the specified topic.
  3930  //
  3931  // - name: The name of the topic whose subscriptions to list.
  3932  func (r *AdminProjectsLocationsTopicsSubscriptionsService) List(name string) *AdminProjectsLocationsTopicsSubscriptionsListCall {
  3933  	c := &AdminProjectsLocationsTopicsSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3934  	c.name = name
  3935  	return c
  3936  }
  3937  
  3938  // PageSize sets the optional parameter "pageSize": The maximum number of
  3939  // subscriptions to return. The service may return fewer than this value. If
  3940  // unset or zero, all subscriptions for the given topic will be returned.
  3941  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) PageSize(pageSize int64) *AdminProjectsLocationsTopicsSubscriptionsListCall {
  3942  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3943  	return c
  3944  }
  3945  
  3946  // PageToken sets the optional parameter "pageToken": A page token, received
  3947  // from a previous `ListTopicSubscriptions` call. Provide this to retrieve the
  3948  // subsequent page. When paginating, all other parameters provided to
  3949  // `ListTopicSubscriptions` must match the call that provided the page token.
  3950  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) PageToken(pageToken string) *AdminProjectsLocationsTopicsSubscriptionsListCall {
  3951  	c.urlParams_.Set("pageToken", pageToken)
  3952  	return c
  3953  }
  3954  
  3955  // Fields allows partial responses to be retrieved. See
  3956  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3957  // details.
  3958  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) Fields(s ...googleapi.Field) *AdminProjectsLocationsTopicsSubscriptionsListCall {
  3959  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3960  	return c
  3961  }
  3962  
  3963  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3964  // object's ETag matches the given value. This is useful for getting updates
  3965  // only after the object has changed since the last request.
  3966  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) IfNoneMatch(entityTag string) *AdminProjectsLocationsTopicsSubscriptionsListCall {
  3967  	c.ifNoneMatch_ = entityTag
  3968  	return c
  3969  }
  3970  
  3971  // Context sets the context to be used in this call's Do method.
  3972  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) Context(ctx context.Context) *AdminProjectsLocationsTopicsSubscriptionsListCall {
  3973  	c.ctx_ = ctx
  3974  	return c
  3975  }
  3976  
  3977  // Header returns a http.Header that can be modified by the caller to add
  3978  // headers to the request.
  3979  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) Header() http.Header {
  3980  	if c.header_ == nil {
  3981  		c.header_ = make(http.Header)
  3982  	}
  3983  	return c.header_
  3984  }
  3985  
  3986  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  3987  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3988  	if c.ifNoneMatch_ != "" {
  3989  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3990  	}
  3991  	var body io.Reader = nil
  3992  	c.urlParams_.Set("alt", alt)
  3993  	c.urlParams_.Set("prettyPrint", "false")
  3994  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/admin/{+name}/subscriptions")
  3995  	urls += "?" + c.urlParams_.Encode()
  3996  	req, err := http.NewRequest("GET", urls, body)
  3997  	if err != nil {
  3998  		return nil, err
  3999  	}
  4000  	req.Header = reqHeaders
  4001  	googleapi.Expand(req.URL, map[string]string{
  4002  		"name": c.name,
  4003  	})
  4004  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4005  }
  4006  
  4007  // Do executes the "pubsublite.admin.projects.locations.topics.subscriptions.list" call.
  4008  // Any non-2xx status code is an error. Response headers are in either
  4009  // *ListTopicSubscriptionsResponse.ServerResponse.Header or (if a response was
  4010  // returned at all) in error.(*googleapi.Error).Header. Use
  4011  // googleapi.IsNotModified to check whether the returned error was because
  4012  // http.StatusNotModified was returned.
  4013  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListTopicSubscriptionsResponse, error) {
  4014  	gensupport.SetOptions(c.urlParams_, opts...)
  4015  	res, err := c.doRequest("json")
  4016  	if res != nil && res.StatusCode == http.StatusNotModified {
  4017  		if res.Body != nil {
  4018  			res.Body.Close()
  4019  		}
  4020  		return nil, gensupport.WrapError(&googleapi.Error{
  4021  			Code:   res.StatusCode,
  4022  			Header: res.Header,
  4023  		})
  4024  	}
  4025  	if err != nil {
  4026  		return nil, err
  4027  	}
  4028  	defer googleapi.CloseBody(res)
  4029  	if err := googleapi.CheckResponse(res); err != nil {
  4030  		return nil, gensupport.WrapError(err)
  4031  	}
  4032  	ret := &ListTopicSubscriptionsResponse{
  4033  		ServerResponse: googleapi.ServerResponse{
  4034  			Header:         res.Header,
  4035  			HTTPStatusCode: res.StatusCode,
  4036  		},
  4037  	}
  4038  	target := &ret
  4039  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4040  		return nil, err
  4041  	}
  4042  	return ret, nil
  4043  }
  4044  
  4045  // Pages invokes f for each page of results.
  4046  // A non-nil error returned from f will halt the iteration.
  4047  // The provided context supersedes any context provided to the Context method.
  4048  func (c *AdminProjectsLocationsTopicsSubscriptionsListCall) Pages(ctx context.Context, f func(*ListTopicSubscriptionsResponse) error) error {
  4049  	c.ctx_ = ctx
  4050  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4051  	for {
  4052  		x, err := c.Do()
  4053  		if err != nil {
  4054  			return err
  4055  		}
  4056  		if err := f(x); err != nil {
  4057  			return err
  4058  		}
  4059  		if x.NextPageToken == "" {
  4060  			return nil
  4061  		}
  4062  		c.PageToken(x.NextPageToken)
  4063  	}
  4064  }
  4065  
  4066  type CursorProjectsLocationsSubscriptionsCommitCursorCall struct {
  4067  	s                   *Service
  4068  	subscription        string
  4069  	commitcursorrequest *CommitCursorRequest
  4070  	urlParams_          gensupport.URLParams
  4071  	ctx_                context.Context
  4072  	header_             http.Header
  4073  }
  4074  
  4075  // CommitCursor: Updates the committed cursor.
  4076  //
  4077  // - subscription: The subscription for which to update the cursor.
  4078  func (r *CursorProjectsLocationsSubscriptionsService) CommitCursor(subscription string, commitcursorrequest *CommitCursorRequest) *CursorProjectsLocationsSubscriptionsCommitCursorCall {
  4079  	c := &CursorProjectsLocationsSubscriptionsCommitCursorCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4080  	c.subscription = subscription
  4081  	c.commitcursorrequest = commitcursorrequest
  4082  	return c
  4083  }
  4084  
  4085  // Fields allows partial responses to be retrieved. See
  4086  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4087  // details.
  4088  func (c *CursorProjectsLocationsSubscriptionsCommitCursorCall) Fields(s ...googleapi.Field) *CursorProjectsLocationsSubscriptionsCommitCursorCall {
  4089  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4090  	return c
  4091  }
  4092  
  4093  // Context sets the context to be used in this call's Do method.
  4094  func (c *CursorProjectsLocationsSubscriptionsCommitCursorCall) Context(ctx context.Context) *CursorProjectsLocationsSubscriptionsCommitCursorCall {
  4095  	c.ctx_ = ctx
  4096  	return c
  4097  }
  4098  
  4099  // Header returns a http.Header that can be modified by the caller to add
  4100  // headers to the request.
  4101  func (c *CursorProjectsLocationsSubscriptionsCommitCursorCall) Header() http.Header {
  4102  	if c.header_ == nil {
  4103  		c.header_ = make(http.Header)
  4104  	}
  4105  	return c.header_
  4106  }
  4107  
  4108  func (c *CursorProjectsLocationsSubscriptionsCommitCursorCall) doRequest(alt string) (*http.Response, error) {
  4109  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4110  	var body io.Reader = nil
  4111  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitcursorrequest)
  4112  	if err != nil {
  4113  		return nil, err
  4114  	}
  4115  	c.urlParams_.Set("alt", alt)
  4116  	c.urlParams_.Set("prettyPrint", "false")
  4117  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/cursor/{+subscription}:commitCursor")
  4118  	urls += "?" + c.urlParams_.Encode()
  4119  	req, err := http.NewRequest("POST", urls, body)
  4120  	if err != nil {
  4121  		return nil, err
  4122  	}
  4123  	req.Header = reqHeaders
  4124  	googleapi.Expand(req.URL, map[string]string{
  4125  		"subscription": c.subscription,
  4126  	})
  4127  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4128  }
  4129  
  4130  // Do executes the "pubsublite.cursor.projects.locations.subscriptions.commitCursor" call.
  4131  // Any non-2xx status code is an error. Response headers are in either
  4132  // *CommitCursorResponse.ServerResponse.Header or (if a response was returned
  4133  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4134  // check whether the returned error was because http.StatusNotModified was
  4135  // returned.
  4136  func (c *CursorProjectsLocationsSubscriptionsCommitCursorCall) Do(opts ...googleapi.CallOption) (*CommitCursorResponse, error) {
  4137  	gensupport.SetOptions(c.urlParams_, opts...)
  4138  	res, err := c.doRequest("json")
  4139  	if res != nil && res.StatusCode == http.StatusNotModified {
  4140  		if res.Body != nil {
  4141  			res.Body.Close()
  4142  		}
  4143  		return nil, gensupport.WrapError(&googleapi.Error{
  4144  			Code:   res.StatusCode,
  4145  			Header: res.Header,
  4146  		})
  4147  	}
  4148  	if err != nil {
  4149  		return nil, err
  4150  	}
  4151  	defer googleapi.CloseBody(res)
  4152  	if err := googleapi.CheckResponse(res); err != nil {
  4153  		return nil, gensupport.WrapError(err)
  4154  	}
  4155  	ret := &CommitCursorResponse{
  4156  		ServerResponse: googleapi.ServerResponse{
  4157  			Header:         res.Header,
  4158  			HTTPStatusCode: res.StatusCode,
  4159  		},
  4160  	}
  4161  	target := &ret
  4162  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4163  		return nil, err
  4164  	}
  4165  	return ret, nil
  4166  }
  4167  
  4168  type CursorProjectsLocationsSubscriptionsCursorsListCall struct {
  4169  	s            *Service
  4170  	parent       string
  4171  	urlParams_   gensupport.URLParams
  4172  	ifNoneMatch_ string
  4173  	ctx_         context.Context
  4174  	header_      http.Header
  4175  }
  4176  
  4177  // List: Returns all committed cursor information for a subscription.
  4178  //
  4179  //   - parent: The subscription for which to retrieve cursors. Structured like
  4180  //     `projects/{project_number}/locations/{location}/subscriptions/{subscription
  4181  //     _id}`.
  4182  func (r *CursorProjectsLocationsSubscriptionsCursorsService) List(parent string) *CursorProjectsLocationsSubscriptionsCursorsListCall {
  4183  	c := &CursorProjectsLocationsSubscriptionsCursorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4184  	c.parent = parent
  4185  	return c
  4186  }
  4187  
  4188  // PageSize sets the optional parameter "pageSize": The maximum number of
  4189  // cursors to return. The service may return fewer than this value. If unset or
  4190  // zero, all cursors for the parent will be returned.
  4191  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) PageSize(pageSize int64) *CursorProjectsLocationsSubscriptionsCursorsListCall {
  4192  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4193  	return c
  4194  }
  4195  
  4196  // PageToken sets the optional parameter "pageToken": A page token, received
  4197  // from a previous `ListPartitionCursors` call. Provide this to retrieve the
  4198  // subsequent page. When paginating, all other parameters provided to
  4199  // `ListPartitionCursors` must match the call that provided the page token.
  4200  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) PageToken(pageToken string) *CursorProjectsLocationsSubscriptionsCursorsListCall {
  4201  	c.urlParams_.Set("pageToken", pageToken)
  4202  	return c
  4203  }
  4204  
  4205  // Fields allows partial responses to be retrieved. See
  4206  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4207  // details.
  4208  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) Fields(s ...googleapi.Field) *CursorProjectsLocationsSubscriptionsCursorsListCall {
  4209  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4210  	return c
  4211  }
  4212  
  4213  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4214  // object's ETag matches the given value. This is useful for getting updates
  4215  // only after the object has changed since the last request.
  4216  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) IfNoneMatch(entityTag string) *CursorProjectsLocationsSubscriptionsCursorsListCall {
  4217  	c.ifNoneMatch_ = entityTag
  4218  	return c
  4219  }
  4220  
  4221  // Context sets the context to be used in this call's Do method.
  4222  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) Context(ctx context.Context) *CursorProjectsLocationsSubscriptionsCursorsListCall {
  4223  	c.ctx_ = ctx
  4224  	return c
  4225  }
  4226  
  4227  // Header returns a http.Header that can be modified by the caller to add
  4228  // headers to the request.
  4229  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) Header() http.Header {
  4230  	if c.header_ == nil {
  4231  		c.header_ = make(http.Header)
  4232  	}
  4233  	return c.header_
  4234  }
  4235  
  4236  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) doRequest(alt string) (*http.Response, error) {
  4237  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4238  	if c.ifNoneMatch_ != "" {
  4239  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4240  	}
  4241  	var body io.Reader = nil
  4242  	c.urlParams_.Set("alt", alt)
  4243  	c.urlParams_.Set("prettyPrint", "false")
  4244  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/cursor/{+parent}/cursors")
  4245  	urls += "?" + c.urlParams_.Encode()
  4246  	req, err := http.NewRequest("GET", urls, body)
  4247  	if err != nil {
  4248  		return nil, err
  4249  	}
  4250  	req.Header = reqHeaders
  4251  	googleapi.Expand(req.URL, map[string]string{
  4252  		"parent": c.parent,
  4253  	})
  4254  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4255  }
  4256  
  4257  // Do executes the "pubsublite.cursor.projects.locations.subscriptions.cursors.list" call.
  4258  // Any non-2xx status code is an error. Response headers are in either
  4259  // *ListPartitionCursorsResponse.ServerResponse.Header or (if a response was
  4260  // returned at all) in error.(*googleapi.Error).Header. Use
  4261  // googleapi.IsNotModified to check whether the returned error was because
  4262  // http.StatusNotModified was returned.
  4263  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) Do(opts ...googleapi.CallOption) (*ListPartitionCursorsResponse, error) {
  4264  	gensupport.SetOptions(c.urlParams_, opts...)
  4265  	res, err := c.doRequest("json")
  4266  	if res != nil && res.StatusCode == http.StatusNotModified {
  4267  		if res.Body != nil {
  4268  			res.Body.Close()
  4269  		}
  4270  		return nil, gensupport.WrapError(&googleapi.Error{
  4271  			Code:   res.StatusCode,
  4272  			Header: res.Header,
  4273  		})
  4274  	}
  4275  	if err != nil {
  4276  		return nil, err
  4277  	}
  4278  	defer googleapi.CloseBody(res)
  4279  	if err := googleapi.CheckResponse(res); err != nil {
  4280  		return nil, gensupport.WrapError(err)
  4281  	}
  4282  	ret := &ListPartitionCursorsResponse{
  4283  		ServerResponse: googleapi.ServerResponse{
  4284  			Header:         res.Header,
  4285  			HTTPStatusCode: res.StatusCode,
  4286  		},
  4287  	}
  4288  	target := &ret
  4289  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4290  		return nil, err
  4291  	}
  4292  	return ret, nil
  4293  }
  4294  
  4295  // Pages invokes f for each page of results.
  4296  // A non-nil error returned from f will halt the iteration.
  4297  // The provided context supersedes any context provided to the Context method.
  4298  func (c *CursorProjectsLocationsSubscriptionsCursorsListCall) Pages(ctx context.Context, f func(*ListPartitionCursorsResponse) error) error {
  4299  	c.ctx_ = ctx
  4300  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4301  	for {
  4302  		x, err := c.Do()
  4303  		if err != nil {
  4304  			return err
  4305  		}
  4306  		if err := f(x); err != nil {
  4307  			return err
  4308  		}
  4309  		if x.NextPageToken == "" {
  4310  			return nil
  4311  		}
  4312  		c.PageToken(x.NextPageToken)
  4313  	}
  4314  }
  4315  
  4316  type TopicStatsProjectsLocationsTopicsComputeHeadCursorCall struct {
  4317  	s                        *Service
  4318  	topic                    string
  4319  	computeheadcursorrequest *ComputeHeadCursorRequest
  4320  	urlParams_               gensupport.URLParams
  4321  	ctx_                     context.Context
  4322  	header_                  http.Header
  4323  }
  4324  
  4325  // ComputeHeadCursor: Compute the head cursor for the partition. The head
  4326  // cursor's offset is guaranteed to be less than or equal to all messages which
  4327  // have not yet been acknowledged as published, and greater than the offset of
  4328  // any message whose publish has already been acknowledged. It is zero if there
  4329  // have never been messages in the partition.
  4330  //
  4331  // - topic: The topic for which we should compute the head cursor.
  4332  func (r *TopicStatsProjectsLocationsTopicsService) ComputeHeadCursor(topic string, computeheadcursorrequest *ComputeHeadCursorRequest) *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall {
  4333  	c := &TopicStatsProjectsLocationsTopicsComputeHeadCursorCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4334  	c.topic = topic
  4335  	c.computeheadcursorrequest = computeheadcursorrequest
  4336  	return c
  4337  }
  4338  
  4339  // Fields allows partial responses to be retrieved. See
  4340  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4341  // details.
  4342  func (c *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall) Fields(s ...googleapi.Field) *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall {
  4343  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4344  	return c
  4345  }
  4346  
  4347  // Context sets the context to be used in this call's Do method.
  4348  func (c *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall) Context(ctx context.Context) *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall {
  4349  	c.ctx_ = ctx
  4350  	return c
  4351  }
  4352  
  4353  // Header returns a http.Header that can be modified by the caller to add
  4354  // headers to the request.
  4355  func (c *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall) Header() http.Header {
  4356  	if c.header_ == nil {
  4357  		c.header_ = make(http.Header)
  4358  	}
  4359  	return c.header_
  4360  }
  4361  
  4362  func (c *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall) doRequest(alt string) (*http.Response, error) {
  4363  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4364  	var body io.Reader = nil
  4365  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.computeheadcursorrequest)
  4366  	if err != nil {
  4367  		return nil, err
  4368  	}
  4369  	c.urlParams_.Set("alt", alt)
  4370  	c.urlParams_.Set("prettyPrint", "false")
  4371  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/topicStats/{+topic}:computeHeadCursor")
  4372  	urls += "?" + c.urlParams_.Encode()
  4373  	req, err := http.NewRequest("POST", urls, body)
  4374  	if err != nil {
  4375  		return nil, err
  4376  	}
  4377  	req.Header = reqHeaders
  4378  	googleapi.Expand(req.URL, map[string]string{
  4379  		"topic": c.topic,
  4380  	})
  4381  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4382  }
  4383  
  4384  // Do executes the "pubsublite.topicStats.projects.locations.topics.computeHeadCursor" call.
  4385  // Any non-2xx status code is an error. Response headers are in either
  4386  // *ComputeHeadCursorResponse.ServerResponse.Header or (if a response was
  4387  // returned at all) in error.(*googleapi.Error).Header. Use
  4388  // googleapi.IsNotModified to check whether the returned error was because
  4389  // http.StatusNotModified was returned.
  4390  func (c *TopicStatsProjectsLocationsTopicsComputeHeadCursorCall) Do(opts ...googleapi.CallOption) (*ComputeHeadCursorResponse, error) {
  4391  	gensupport.SetOptions(c.urlParams_, opts...)
  4392  	res, err := c.doRequest("json")
  4393  	if res != nil && res.StatusCode == http.StatusNotModified {
  4394  		if res.Body != nil {
  4395  			res.Body.Close()
  4396  		}
  4397  		return nil, gensupport.WrapError(&googleapi.Error{
  4398  			Code:   res.StatusCode,
  4399  			Header: res.Header,
  4400  		})
  4401  	}
  4402  	if err != nil {
  4403  		return nil, err
  4404  	}
  4405  	defer googleapi.CloseBody(res)
  4406  	if err := googleapi.CheckResponse(res); err != nil {
  4407  		return nil, gensupport.WrapError(err)
  4408  	}
  4409  	ret := &ComputeHeadCursorResponse{
  4410  		ServerResponse: googleapi.ServerResponse{
  4411  			Header:         res.Header,
  4412  			HTTPStatusCode: res.StatusCode,
  4413  		},
  4414  	}
  4415  	target := &ret
  4416  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4417  		return nil, err
  4418  	}
  4419  	return ret, nil
  4420  }
  4421  
  4422  type TopicStatsProjectsLocationsTopicsComputeMessageStatsCall struct {
  4423  	s                          *Service
  4424  	topic                      string
  4425  	computemessagestatsrequest *ComputeMessageStatsRequest
  4426  	urlParams_                 gensupport.URLParams
  4427  	ctx_                       context.Context
  4428  	header_                    http.Header
  4429  }
  4430  
  4431  // ComputeMessageStats: Compute statistics about a range of messages in a given
  4432  // topic and partition.
  4433  //
  4434  // - topic: The topic for which we should compute message stats.
  4435  func (r *TopicStatsProjectsLocationsTopicsService) ComputeMessageStats(topic string, computemessagestatsrequest *ComputeMessageStatsRequest) *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall {
  4436  	c := &TopicStatsProjectsLocationsTopicsComputeMessageStatsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4437  	c.topic = topic
  4438  	c.computemessagestatsrequest = computemessagestatsrequest
  4439  	return c
  4440  }
  4441  
  4442  // Fields allows partial responses to be retrieved. See
  4443  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4444  // details.
  4445  func (c *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall) Fields(s ...googleapi.Field) *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall {
  4446  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4447  	return c
  4448  }
  4449  
  4450  // Context sets the context to be used in this call's Do method.
  4451  func (c *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall) Context(ctx context.Context) *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall {
  4452  	c.ctx_ = ctx
  4453  	return c
  4454  }
  4455  
  4456  // Header returns a http.Header that can be modified by the caller to add
  4457  // headers to the request.
  4458  func (c *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall) Header() http.Header {
  4459  	if c.header_ == nil {
  4460  		c.header_ = make(http.Header)
  4461  	}
  4462  	return c.header_
  4463  }
  4464  
  4465  func (c *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall) doRequest(alt string) (*http.Response, error) {
  4466  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4467  	var body io.Reader = nil
  4468  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.computemessagestatsrequest)
  4469  	if err != nil {
  4470  		return nil, err
  4471  	}
  4472  	c.urlParams_.Set("alt", alt)
  4473  	c.urlParams_.Set("prettyPrint", "false")
  4474  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/topicStats/{+topic}:computeMessageStats")
  4475  	urls += "?" + c.urlParams_.Encode()
  4476  	req, err := http.NewRequest("POST", urls, body)
  4477  	if err != nil {
  4478  		return nil, err
  4479  	}
  4480  	req.Header = reqHeaders
  4481  	googleapi.Expand(req.URL, map[string]string{
  4482  		"topic": c.topic,
  4483  	})
  4484  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4485  }
  4486  
  4487  // Do executes the "pubsublite.topicStats.projects.locations.topics.computeMessageStats" call.
  4488  // Any non-2xx status code is an error. Response headers are in either
  4489  // *ComputeMessageStatsResponse.ServerResponse.Header or (if a response was
  4490  // returned at all) in error.(*googleapi.Error).Header. Use
  4491  // googleapi.IsNotModified to check whether the returned error was because
  4492  // http.StatusNotModified was returned.
  4493  func (c *TopicStatsProjectsLocationsTopicsComputeMessageStatsCall) Do(opts ...googleapi.CallOption) (*ComputeMessageStatsResponse, error) {
  4494  	gensupport.SetOptions(c.urlParams_, opts...)
  4495  	res, err := c.doRequest("json")
  4496  	if res != nil && res.StatusCode == http.StatusNotModified {
  4497  		if res.Body != nil {
  4498  			res.Body.Close()
  4499  		}
  4500  		return nil, gensupport.WrapError(&googleapi.Error{
  4501  			Code:   res.StatusCode,
  4502  			Header: res.Header,
  4503  		})
  4504  	}
  4505  	if err != nil {
  4506  		return nil, err
  4507  	}
  4508  	defer googleapi.CloseBody(res)
  4509  	if err := googleapi.CheckResponse(res); err != nil {
  4510  		return nil, gensupport.WrapError(err)
  4511  	}
  4512  	ret := &ComputeMessageStatsResponse{
  4513  		ServerResponse: googleapi.ServerResponse{
  4514  			Header:         res.Header,
  4515  			HTTPStatusCode: res.StatusCode,
  4516  		},
  4517  	}
  4518  	target := &ret
  4519  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4520  		return nil, err
  4521  	}
  4522  	return ret, nil
  4523  }
  4524  
  4525  type TopicStatsProjectsLocationsTopicsComputeTimeCursorCall struct {
  4526  	s                        *Service
  4527  	topic                    string
  4528  	computetimecursorrequest *ComputeTimeCursorRequest
  4529  	urlParams_               gensupport.URLParams
  4530  	ctx_                     context.Context
  4531  	header_                  http.Header
  4532  }
  4533  
  4534  // ComputeTimeCursor: Compute the corresponding cursor for a publish or event
  4535  // time in a topic partition.
  4536  //
  4537  // - topic: The topic for which we should compute the cursor.
  4538  func (r *TopicStatsProjectsLocationsTopicsService) ComputeTimeCursor(topic string, computetimecursorrequest *ComputeTimeCursorRequest) *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall {
  4539  	c := &TopicStatsProjectsLocationsTopicsComputeTimeCursorCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4540  	c.topic = topic
  4541  	c.computetimecursorrequest = computetimecursorrequest
  4542  	return c
  4543  }
  4544  
  4545  // Fields allows partial responses to be retrieved. See
  4546  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4547  // details.
  4548  func (c *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall) Fields(s ...googleapi.Field) *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall {
  4549  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4550  	return c
  4551  }
  4552  
  4553  // Context sets the context to be used in this call's Do method.
  4554  func (c *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall) Context(ctx context.Context) *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall {
  4555  	c.ctx_ = ctx
  4556  	return c
  4557  }
  4558  
  4559  // Header returns a http.Header that can be modified by the caller to add
  4560  // headers to the request.
  4561  func (c *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall) Header() http.Header {
  4562  	if c.header_ == nil {
  4563  		c.header_ = make(http.Header)
  4564  	}
  4565  	return c.header_
  4566  }
  4567  
  4568  func (c *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall) doRequest(alt string) (*http.Response, error) {
  4569  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4570  	var body io.Reader = nil
  4571  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.computetimecursorrequest)
  4572  	if err != nil {
  4573  		return nil, err
  4574  	}
  4575  	c.urlParams_.Set("alt", alt)
  4576  	c.urlParams_.Set("prettyPrint", "false")
  4577  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/topicStats/{+topic}:computeTimeCursor")
  4578  	urls += "?" + c.urlParams_.Encode()
  4579  	req, err := http.NewRequest("POST", urls, body)
  4580  	if err != nil {
  4581  		return nil, err
  4582  	}
  4583  	req.Header = reqHeaders
  4584  	googleapi.Expand(req.URL, map[string]string{
  4585  		"topic": c.topic,
  4586  	})
  4587  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4588  }
  4589  
  4590  // Do executes the "pubsublite.topicStats.projects.locations.topics.computeTimeCursor" call.
  4591  // Any non-2xx status code is an error. Response headers are in either
  4592  // *ComputeTimeCursorResponse.ServerResponse.Header or (if a response was
  4593  // returned at all) in error.(*googleapi.Error).Header. Use
  4594  // googleapi.IsNotModified to check whether the returned error was because
  4595  // http.StatusNotModified was returned.
  4596  func (c *TopicStatsProjectsLocationsTopicsComputeTimeCursorCall) Do(opts ...googleapi.CallOption) (*ComputeTimeCursorResponse, error) {
  4597  	gensupport.SetOptions(c.urlParams_, opts...)
  4598  	res, err := c.doRequest("json")
  4599  	if res != nil && res.StatusCode == http.StatusNotModified {
  4600  		if res.Body != nil {
  4601  			res.Body.Close()
  4602  		}
  4603  		return nil, gensupport.WrapError(&googleapi.Error{
  4604  			Code:   res.StatusCode,
  4605  			Header: res.Header,
  4606  		})
  4607  	}
  4608  	if err != nil {
  4609  		return nil, err
  4610  	}
  4611  	defer googleapi.CloseBody(res)
  4612  	if err := googleapi.CheckResponse(res); err != nil {
  4613  		return nil, gensupport.WrapError(err)
  4614  	}
  4615  	ret := &ComputeTimeCursorResponse{
  4616  		ServerResponse: googleapi.ServerResponse{
  4617  			Header:         res.Header,
  4618  			HTTPStatusCode: res.StatusCode,
  4619  		},
  4620  	}
  4621  	target := &ret
  4622  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4623  		return nil, err
  4624  	}
  4625  	return ret, nil
  4626  }
  4627  

View as plain text