...

Source file src/google.golang.org/api/factchecktools/v1alpha1/factchecktools-gen.go

Documentation: google.golang.org/api/factchecktools/v1alpha1

     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 factchecktools provides access to the Fact Check Tools API.
     8  //
     9  // For product documentation, see: https://developers.google.com/fact-check/tools/api/
    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/factchecktools/v1alpha1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	factchecktoolsService, err := factchecktools.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  //	factchecktoolsService, err := factchecktools.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  //	factchecktoolsService, err := factchecktools.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package factchecktools // import "google.golang.org/api/factchecktools/v1alpha1"
    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 = "factchecktools:v1alpha1"
    90  const apiName = "factchecktools"
    91  const apiVersion = "v1alpha1"
    92  const basePath = "https://factchecktools.googleapis.com/"
    93  const basePathTemplate = "https://factchecktools.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://factchecktools.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See your primary Google Account email address
    99  	UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
   100  )
   101  
   102  // NewService creates a new Service.
   103  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   104  	scopesOption := internaloption.WithDefaultScopes(
   105  		"https://www.googleapis.com/auth/userinfo.email",
   106  	)
   107  	// NOTE: prepend, so we don't override user-specified scopes.
   108  	opts = append([]option.ClientOption{scopesOption}, opts...)
   109  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   110  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   111  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   112  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   113  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	s, err := New(client)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	if endpoint != "" {
   122  		s.BasePath = endpoint
   123  	}
   124  	return s, nil
   125  }
   126  
   127  // New creates a new Service. It uses the provided http.Client for requests.
   128  //
   129  // Deprecated: please use NewService instead.
   130  // To provide a custom HTTP client, use option.WithHTTPClient.
   131  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   132  func New(client *http.Client) (*Service, error) {
   133  	if client == nil {
   134  		return nil, errors.New("client is nil")
   135  	}
   136  	s := &Service{client: client, BasePath: basePath}
   137  	s.Claims = NewClaimsService(s)
   138  	s.Pages = NewPagesService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	Claims *ClaimsService
   148  
   149  	Pages *PagesService
   150  }
   151  
   152  func (s *Service) userAgent() string {
   153  	if s.UserAgent == "" {
   154  		return googleapi.UserAgent
   155  	}
   156  	return googleapi.UserAgent + " " + s.UserAgent
   157  }
   158  
   159  func NewClaimsService(s *Service) *ClaimsService {
   160  	rs := &ClaimsService{s: s}
   161  	return rs
   162  }
   163  
   164  type ClaimsService struct {
   165  	s *Service
   166  }
   167  
   168  func NewPagesService(s *Service) *PagesService {
   169  	rs := &PagesService{s: s}
   170  	return rs
   171  }
   172  
   173  type PagesService struct {
   174  	s *Service
   175  }
   176  
   177  // GoogleFactcheckingFactchecktoolsV1alpha1Claim: Information about the claim.
   178  type GoogleFactcheckingFactchecktoolsV1alpha1Claim struct {
   179  	// ClaimDate: The date that the claim was made.
   180  	ClaimDate string `json:"claimDate,omitempty"`
   181  	// ClaimReview: One or more reviews of this claim (namely, a fact-checking
   182  	// article).
   183  	ClaimReview []*GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview `json:"claimReview,omitempty"`
   184  	// Claimant: A person or organization stating the claim. For instance, "John
   185  	// Doe".
   186  	Claimant string `json:"claimant,omitempty"`
   187  	// Text: The claim text. For instance, "Crime has doubled in the last 2 years."
   188  	Text string `json:"text,omitempty"`
   189  	// ForceSendFields is a list of field names (e.g. "ClaimDate") to
   190  	// unconditionally include in API requests. By default, fields with empty or
   191  	// default values are omitted from API requests. See
   192  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   193  	// details.
   194  	ForceSendFields []string `json:"-"`
   195  	// NullFields is a list of field names (e.g. "ClaimDate") to include in API
   196  	// requests with the JSON null value. By default, fields with empty values are
   197  	// omitted from API requests. See
   198  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   199  	NullFields []string `json:"-"`
   200  }
   201  
   202  func (s *GoogleFactcheckingFactchecktoolsV1alpha1Claim) MarshalJSON() ([]byte, error) {
   203  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1Claim
   204  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   205  }
   206  
   207  // GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor: Information about the
   208  // claim author.
   209  type GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor struct {
   210  	// ImageUrl: Corresponds to `ClaimReview.itemReviewed.author.image`.
   211  	ImageUrl string `json:"imageUrl,omitempty"`
   212  	// JobTitle: Corresponds to `ClaimReview.itemReviewed.author.jobTitle`.
   213  	JobTitle string `json:"jobTitle,omitempty"`
   214  	// Name: A person or organization stating the claim. For instance, "John Doe".
   215  	// Corresponds to `ClaimReview.itemReviewed.author.name`.
   216  	Name string `json:"name,omitempty"`
   217  	// SameAs: Corresponds to `ClaimReview.itemReviewed.author.sameAs`.
   218  	SameAs string `json:"sameAs,omitempty"`
   219  	// ForceSendFields is a list of field names (e.g. "ImageUrl") to
   220  	// unconditionally include in API requests. By default, fields with empty or
   221  	// default values are omitted from API requests. See
   222  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   223  	// details.
   224  	ForceSendFields []string `json:"-"`
   225  	// NullFields is a list of field names (e.g. "ImageUrl") to include in API
   226  	// requests with the JSON null value. By default, fields with empty values are
   227  	// omitted from API requests. See
   228  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   229  	NullFields []string `json:"-"`
   230  }
   231  
   232  func (s *GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor) MarshalJSON() ([]byte, error) {
   233  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor
   234  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   235  }
   236  
   237  // GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating: Information about the
   238  // claim rating.
   239  type GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating struct {
   240  	// BestRating: For numeric ratings, the best value possible in the scale from
   241  	// worst to best. Corresponds to `ClaimReview.reviewRating.bestRating`.
   242  	BestRating int64 `json:"bestRating,omitempty"`
   243  	// ImageUrl: Corresponds to `ClaimReview.reviewRating.image`.
   244  	ImageUrl string `json:"imageUrl,omitempty"`
   245  	// RatingExplanation: Corresponds to
   246  	// `ClaimReview.reviewRating.ratingExplanation`.
   247  	RatingExplanation string `json:"ratingExplanation,omitempty"`
   248  	// RatingValue: A numeric rating of this claim, in the range worstRating —
   249  	// bestRating inclusive. Corresponds to `ClaimReview.reviewRating.ratingValue`.
   250  	RatingValue int64 `json:"ratingValue,omitempty"`
   251  	// TextualRating: The truthfulness rating as a human-readible short word or
   252  	// phrase. Corresponds to `ClaimReview.reviewRating.alternateName`.
   253  	TextualRating string `json:"textualRating,omitempty"`
   254  	// WorstRating: For numeric ratings, the worst value possible in the scale from
   255  	// worst to best. Corresponds to `ClaimReview.reviewRating.worstRating`.
   256  	WorstRating int64 `json:"worstRating,omitempty"`
   257  	// ForceSendFields is a list of field names (e.g. "BestRating") to
   258  	// unconditionally include in API requests. By default, fields with empty or
   259  	// default values are omitted from API requests. See
   260  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   261  	// details.
   262  	ForceSendFields []string `json:"-"`
   263  	// NullFields is a list of field names (e.g. "BestRating") to include in API
   264  	// requests with the JSON null value. By default, fields with empty values are
   265  	// omitted from API requests. See
   266  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   267  	NullFields []string `json:"-"`
   268  }
   269  
   270  func (s *GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating) MarshalJSON() ([]byte, error) {
   271  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating
   272  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   273  }
   274  
   275  // GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview: Information about a
   276  // claim review.
   277  type GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview struct {
   278  	// LanguageCode: The language this review was written in. For instance, "en" or
   279  	// "de".
   280  	LanguageCode string `json:"languageCode,omitempty"`
   281  	// Publisher: The publisher of this claim review.
   282  	Publisher *GoogleFactcheckingFactchecktoolsV1alpha1Publisher `json:"publisher,omitempty"`
   283  	// ReviewDate: The date the claim was reviewed.
   284  	ReviewDate string `json:"reviewDate,omitempty"`
   285  	// TextualRating: Textual rating. For instance, "Mostly false".
   286  	TextualRating string `json:"textualRating,omitempty"`
   287  	// Title: The title of this claim review, if it can be determined.
   288  	Title string `json:"title,omitempty"`
   289  	// Url: The URL of this claim review.
   290  	Url string `json:"url,omitempty"`
   291  	// ForceSendFields is a list of field names (e.g. "LanguageCode") to
   292  	// unconditionally include in API requests. By default, fields with empty or
   293  	// default values are omitted from API requests. See
   294  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   295  	// details.
   296  	ForceSendFields []string `json:"-"`
   297  	// NullFields is a list of field names (e.g. "LanguageCode") to include in API
   298  	// requests with the JSON null value. By default, fields with empty values are
   299  	// omitted from API requests. See
   300  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   301  	NullFields []string `json:"-"`
   302  }
   303  
   304  func (s *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview) MarshalJSON() ([]byte, error) {
   305  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview
   306  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   307  }
   308  
   309  // GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor: Information about
   310  // the claim review author.
   311  type GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor struct {
   312  	// ImageUrl: Corresponds to `ClaimReview.author.image`.
   313  	ImageUrl string `json:"imageUrl,omitempty"`
   314  	// Name: Name of the organization that is publishing the fact check.
   315  	// Corresponds to `ClaimReview.author.name`.
   316  	Name string `json:"name,omitempty"`
   317  	// ForceSendFields is a list of field names (e.g. "ImageUrl") to
   318  	// unconditionally include in API requests. By default, fields with empty or
   319  	// default values are omitted from API requests. See
   320  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   321  	// details.
   322  	ForceSendFields []string `json:"-"`
   323  	// NullFields is a list of field names (e.g. "ImageUrl") to include in API
   324  	// requests with the JSON null value. By default, fields with empty values are
   325  	// omitted from API requests. See
   326  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   327  	NullFields []string `json:"-"`
   328  }
   329  
   330  func (s *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor) MarshalJSON() ([]byte, error) {
   331  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor
   332  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   333  }
   334  
   335  // GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup: Fields for an
   336  // individual `ClaimReview` element. Except for sub-messages that group fields
   337  // together, each of these fields correspond those in
   338  // https://schema.org/ClaimReview. We list the precise mapping for each field.
   339  type GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup struct {
   340  	// ClaimAppearances: A list of links to works in which this claim appears,
   341  	// aside from the one specified in `claim_first_appearance`. Corresponds to
   342  	// `ClaimReview.itemReviewed[@type=Claim].appearance.url`.
   343  	ClaimAppearances []string `json:"claimAppearances,omitempty"`
   344  	// ClaimAuthor: Info about the author of this claim.
   345  	ClaimAuthor *GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor `json:"claimAuthor,omitempty"`
   346  	// ClaimDate: The date when the claim was made or entered public discourse.
   347  	// Corresponds to `ClaimReview.itemReviewed.datePublished`.
   348  	ClaimDate string `json:"claimDate,omitempty"`
   349  	// ClaimFirstAppearance: A link to a work in which this claim first appears.
   350  	// Corresponds to `ClaimReview.itemReviewed[@type=Claim].firstAppearance.url`.
   351  	ClaimFirstAppearance string `json:"claimFirstAppearance,omitempty"`
   352  	// ClaimLocation: The location where this claim was made. Corresponds to
   353  	// `ClaimReview.itemReviewed.name`.
   354  	ClaimLocation string `json:"claimLocation,omitempty"`
   355  	// ClaimReviewed: A short summary of the claim being evaluated. Corresponds to
   356  	// `ClaimReview.claimReviewed`.
   357  	ClaimReviewed string `json:"claimReviewed,omitempty"`
   358  	// Rating: Info about the rating of this claim review.
   359  	Rating *GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating `json:"rating,omitempty"`
   360  	// Url: This field is optional, and will default to the page URL. We provide
   361  	// this field to allow you the override the default value, but the only
   362  	// permitted override is the page URL plus an optional anchor link ("page
   363  	// jump"). Corresponds to `ClaimReview.url`
   364  	Url string `json:"url,omitempty"`
   365  	// ForceSendFields is a list of field names (e.g. "ClaimAppearances") to
   366  	// unconditionally include in API requests. By default, fields with empty or
   367  	// default values are omitted from API requests. See
   368  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   369  	// details.
   370  	ForceSendFields []string `json:"-"`
   371  	// NullFields is a list of field names (e.g. "ClaimAppearances") to include in
   372  	// API requests with the JSON null value. By default, fields with empty values
   373  	// are omitted from API requests. See
   374  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   375  	NullFields []string `json:"-"`
   376  }
   377  
   378  func (s *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup) MarshalJSON() ([]byte, error) {
   379  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup
   380  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   381  }
   382  
   383  // GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage: Holds one or
   384  // more instances of `ClaimReview` markup for a webpage.
   385  type GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage struct {
   386  	// ClaimReviewAuthor: Info about the author of this claim review. Similar to
   387  	// the above, semantically these are page-level fields, and each `ClaimReview`
   388  	// on this page will contain the same values.
   389  	ClaimReviewAuthor *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor `json:"claimReviewAuthor,omitempty"`
   390  	// ClaimReviewMarkups: A list of individual claim reviews for this page. Each
   391  	// item in the list corresponds to one `ClaimReview` element.
   392  	ClaimReviewMarkups []*GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup `json:"claimReviewMarkups,omitempty"`
   393  	// Name: The name of this `ClaimReview` markup page resource, in the form of
   394  	// `pages/{page_id}`. Except for update requests, this field is output-only and
   395  	// should not be set by the user.
   396  	Name string `json:"name,omitempty"`
   397  	// PageUrl: The URL of the page associated with this `ClaimReview` markup.
   398  	// While every individual `ClaimReview` has its own URL field, semantically
   399  	// this is a page-level field, and each `ClaimReview` on this page will use
   400  	// this value unless individually overridden. Corresponds to `ClaimReview.url`
   401  	PageUrl string `json:"pageUrl,omitempty"`
   402  	// PublishDate: The date when the fact check was published. Similar to the URL,
   403  	// semantically this is a page-level field, and each `ClaimReview` on this page
   404  	// will contain the same value. Corresponds to `ClaimReview.datePublished`
   405  	PublishDate string `json:"publishDate,omitempty"`
   406  	// VersionId: The version ID for this markup. Except for update requests, this
   407  	// field is output-only and should not be set by the user.
   408  	VersionId string `json:"versionId,omitempty"`
   409  
   410  	// ServerResponse contains the HTTP response code and headers from the server.
   411  	googleapi.ServerResponse `json:"-"`
   412  	// ForceSendFields is a list of field names (e.g. "ClaimReviewAuthor") to
   413  	// unconditionally include in API requests. By default, fields with empty or
   414  	// default values are omitted from API requests. See
   415  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   416  	// details.
   417  	ForceSendFields []string `json:"-"`
   418  	// NullFields is a list of field names (e.g. "ClaimReviewAuthor") to include in
   419  	// API requests with the JSON null value. By default, fields with empty values
   420  	// are omitted from API requests. See
   421  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   422  	NullFields []string `json:"-"`
   423  }
   424  
   425  func (s *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage) MarshalJSON() ([]byte, error) {
   426  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
   427  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   428  }
   429  
   430  // GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse:
   431  // Response from searching fact-checked claims by image.
   432  type GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse struct {
   433  	// NextPageToken: The next pagination token in the Search response. It should
   434  	// be used as the `page_token` for the following request. An empty value means
   435  	// no more results.
   436  	NextPageToken string `json:"nextPageToken,omitempty"`
   437  	// Results: The list of claims and all of their associated information.
   438  	Results []*GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponseResult `json:"results,omitempty"`
   439  
   440  	// ServerResponse contains the HTTP response code and headers from the server.
   441  	googleapi.ServerResponse `json:"-"`
   442  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   443  	// unconditionally include in API requests. By default, fields with empty or
   444  	// default values are omitted from API requests. See
   445  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   446  	// details.
   447  	ForceSendFields []string `json:"-"`
   448  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   449  	// requests with the JSON null value. By default, fields with empty values are
   450  	// omitted from API requests. See
   451  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   452  	NullFields []string `json:"-"`
   453  }
   454  
   455  func (s *GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse) MarshalJSON() ([]byte, error) {
   456  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse
   457  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   458  }
   459  
   460  // GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponseRe
   461  // sult: A claim and its associated information.
   462  type GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponseResult struct {
   463  	// Claim: A claim which matched the query.
   464  	Claim *GoogleFactcheckingFactchecktoolsV1alpha1Claim `json:"claim,omitempty"`
   465  	// ForceSendFields is a list of field names (e.g. "Claim") to unconditionally
   466  	// include in API requests. By default, fields with empty or default values are
   467  	// omitted from API requests. See
   468  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   469  	// details.
   470  	ForceSendFields []string `json:"-"`
   471  	// NullFields is a list of field names (e.g. "Claim") to include in API
   472  	// requests with the JSON null value. By default, fields with empty values are
   473  	// omitted from API requests. See
   474  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   475  	NullFields []string `json:"-"`
   476  }
   477  
   478  func (s *GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponseResult) MarshalJSON() ([]byte, error) {
   479  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponseResult
   480  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   481  }
   482  
   483  // GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse:
   484  // Response from searching fact-checked claims.
   485  type GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse struct {
   486  	// Claims: The list of claims and all of their associated information.
   487  	Claims []*GoogleFactcheckingFactchecktoolsV1alpha1Claim `json:"claims,omitempty"`
   488  	// NextPageToken: The next pagination token in the Search response. It should
   489  	// be used as the `page_token` for the following request. An empty value means
   490  	// no more results.
   491  	NextPageToken string `json:"nextPageToken,omitempty"`
   492  
   493  	// ServerResponse contains the HTTP response code and headers from the server.
   494  	googleapi.ServerResponse `json:"-"`
   495  	// ForceSendFields is a list of field names (e.g. "Claims") to unconditionally
   496  	// include in API requests. By default, fields with empty or default values are
   497  	// omitted from API requests. See
   498  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   499  	// details.
   500  	ForceSendFields []string `json:"-"`
   501  	// NullFields is a list of field names (e.g. "Claims") to include in API
   502  	// requests with the JSON null value. By default, fields with empty values are
   503  	// omitted from API requests. See
   504  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   505  	NullFields []string `json:"-"`
   506  }
   507  
   508  func (s *GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse) MarshalJSON() ([]byte, error) {
   509  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse
   510  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   511  }
   512  
   513  // GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse:
   514  // Response from listing `ClaimReview` markup.
   515  type GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse struct {
   516  	// ClaimReviewMarkupPages: The result list of pages of `ClaimReview` markup.
   517  	ClaimReviewMarkupPages []*GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage `json:"claimReviewMarkupPages,omitempty"`
   518  	// NextPageToken: The next pagination token in the Search response. It should
   519  	// be used as the `page_token` for the following request. An empty value means
   520  	// no more results.
   521  	NextPageToken string `json:"nextPageToken,omitempty"`
   522  
   523  	// ServerResponse contains the HTTP response code and headers from the server.
   524  	googleapi.ServerResponse `json:"-"`
   525  	// ForceSendFields is a list of field names (e.g. "ClaimReviewMarkupPages") to
   526  	// unconditionally include in API requests. By default, fields with empty or
   527  	// default values are omitted from API requests. See
   528  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   529  	// details.
   530  	ForceSendFields []string `json:"-"`
   531  	// NullFields is a list of field names (e.g. "ClaimReviewMarkupPages") to
   532  	// include in API requests with the JSON null value. By default, fields with
   533  	// empty values are omitted from API requests. See
   534  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   535  	NullFields []string `json:"-"`
   536  }
   537  
   538  func (s *GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse) MarshalJSON() ([]byte, error) {
   539  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse
   540  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   541  }
   542  
   543  // GoogleFactcheckingFactchecktoolsV1alpha1Publisher: Information about the
   544  // publisher.
   545  type GoogleFactcheckingFactchecktoolsV1alpha1Publisher struct {
   546  	// Name: The name of this publisher. For instance, "Awesome Fact Checks".
   547  	Name string `json:"name,omitempty"`
   548  	// Site: Host-level site name, without the protocol or "www" prefix. For
   549  	// instance, "awesomefactchecks.com". This value of this field is based purely
   550  	// on the claim review URL.
   551  	Site string `json:"site,omitempty"`
   552  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   553  	// include in API requests. By default, fields with empty or default values are
   554  	// omitted from API requests. See
   555  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   556  	// details.
   557  	ForceSendFields []string `json:"-"`
   558  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   559  	// with the JSON null value. By default, fields with empty values are omitted
   560  	// from API requests. See
   561  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   562  	NullFields []string `json:"-"`
   563  }
   564  
   565  func (s *GoogleFactcheckingFactchecktoolsV1alpha1Publisher) MarshalJSON() ([]byte, error) {
   566  	type NoMethod GoogleFactcheckingFactchecktoolsV1alpha1Publisher
   567  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   568  }
   569  
   570  // GoogleProtobufEmpty: A generic empty message that you can re-use to avoid
   571  // defining duplicated empty messages in your APIs. A typical example is to use
   572  // it as the request or the response type of an API method. For instance:
   573  // service Foo { rpc Bar(google.protobuf.Empty) returns
   574  // (google.protobuf.Empty); }
   575  type GoogleProtobufEmpty struct {
   576  	// ServerResponse contains the HTTP response code and headers from the server.
   577  	googleapi.ServerResponse `json:"-"`
   578  }
   579  
   580  type ClaimsImageSearchCall struct {
   581  	s            *Service
   582  	urlParams_   gensupport.URLParams
   583  	ifNoneMatch_ string
   584  	ctx_         context.Context
   585  	header_      http.Header
   586  }
   587  
   588  // ImageSearch: Search through fact-checked claims using an image as the query.
   589  func (r *ClaimsService) ImageSearch() *ClaimsImageSearchCall {
   590  	c := &ClaimsImageSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   591  	return c
   592  }
   593  
   594  // ImageUri sets the optional parameter "imageUri": Required. The URI of the
   595  // source image. This must be a publicly-accessible image HTTP/HTTPS URL. When
   596  // fetching images from HTTP/HTTPS URLs, Google cannot guarantee that the
   597  // request will be completed. Your request may fail if the specified host
   598  // denies the request (e.g. due to request throttling or DOS prevention), or if
   599  // Google throttles requests to the site for abuse prevention. You should not
   600  // depend on externally-hosted images for production applications.
   601  func (c *ClaimsImageSearchCall) ImageUri(imageUri string) *ClaimsImageSearchCall {
   602  	c.urlParams_.Set("imageUri", imageUri)
   603  	return c
   604  }
   605  
   606  // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
   607  // code, such as "en-US" or "sr-Latn". Can be used to restrict results by
   608  // language, though we do not currently consider the region.
   609  func (c *ClaimsImageSearchCall) LanguageCode(languageCode string) *ClaimsImageSearchCall {
   610  	c.urlParams_.Set("languageCode", languageCode)
   611  	return c
   612  }
   613  
   614  // Offset sets the optional parameter "offset": An integer that specifies the
   615  // current offset (that is, starting result location) in search results. This
   616  // field is only considered if `page_token` is unset. For example, 0 means to
   617  // return results starting from the first matching result, and 10 means to
   618  // return from the 11th result.
   619  func (c *ClaimsImageSearchCall) Offset(offset int64) *ClaimsImageSearchCall {
   620  	c.urlParams_.Set("offset", fmt.Sprint(offset))
   621  	return c
   622  }
   623  
   624  // PageSize sets the optional parameter "pageSize": The pagination size. We
   625  // will return up to that many results. Defaults to 10 if not set.
   626  func (c *ClaimsImageSearchCall) PageSize(pageSize int64) *ClaimsImageSearchCall {
   627  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   628  	return c
   629  }
   630  
   631  // PageToken sets the optional parameter "pageToken": The pagination token. You
   632  // may provide the `next_page_token` returned from a previous List request, if
   633  // any, in order to get the next page. All other fields must have the same
   634  // values as in the previous request.
   635  func (c *ClaimsImageSearchCall) PageToken(pageToken string) *ClaimsImageSearchCall {
   636  	c.urlParams_.Set("pageToken", pageToken)
   637  	return c
   638  }
   639  
   640  // Fields allows partial responses to be retrieved. See
   641  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   642  // details.
   643  func (c *ClaimsImageSearchCall) Fields(s ...googleapi.Field) *ClaimsImageSearchCall {
   644  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   645  	return c
   646  }
   647  
   648  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   649  // object's ETag matches the given value. This is useful for getting updates
   650  // only after the object has changed since the last request.
   651  func (c *ClaimsImageSearchCall) IfNoneMatch(entityTag string) *ClaimsImageSearchCall {
   652  	c.ifNoneMatch_ = entityTag
   653  	return c
   654  }
   655  
   656  // Context sets the context to be used in this call's Do method.
   657  func (c *ClaimsImageSearchCall) Context(ctx context.Context) *ClaimsImageSearchCall {
   658  	c.ctx_ = ctx
   659  	return c
   660  }
   661  
   662  // Header returns a http.Header that can be modified by the caller to add
   663  // headers to the request.
   664  func (c *ClaimsImageSearchCall) Header() http.Header {
   665  	if c.header_ == nil {
   666  		c.header_ = make(http.Header)
   667  	}
   668  	return c.header_
   669  }
   670  
   671  func (c *ClaimsImageSearchCall) doRequest(alt string) (*http.Response, error) {
   672  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   673  	if c.ifNoneMatch_ != "" {
   674  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   675  	}
   676  	var body io.Reader = nil
   677  	c.urlParams_.Set("alt", alt)
   678  	c.urlParams_.Set("prettyPrint", "false")
   679  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/claims:imageSearch")
   680  	urls += "?" + c.urlParams_.Encode()
   681  	req, err := http.NewRequest("GET", urls, body)
   682  	if err != nil {
   683  		return nil, err
   684  	}
   685  	req.Header = reqHeaders
   686  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   687  }
   688  
   689  // Do executes the "factchecktools.claims.imageSearch" call.
   690  // Any non-2xx status code is an error. Response headers are in either
   691  // *GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse.
   692  // ServerResponse.Header or (if a response was returned at all) in
   693  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   694  // whether the returned error was because http.StatusNotModified was returned.
   695  func (c *ClaimsImageSearchCall) Do(opts ...googleapi.CallOption) (*GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse, error) {
   696  	gensupport.SetOptions(c.urlParams_, opts...)
   697  	res, err := c.doRequest("json")
   698  	if res != nil && res.StatusCode == http.StatusNotModified {
   699  		if res.Body != nil {
   700  			res.Body.Close()
   701  		}
   702  		return nil, gensupport.WrapError(&googleapi.Error{
   703  			Code:   res.StatusCode,
   704  			Header: res.Header,
   705  		})
   706  	}
   707  	if err != nil {
   708  		return nil, err
   709  	}
   710  	defer googleapi.CloseBody(res)
   711  	if err := googleapi.CheckResponse(res); err != nil {
   712  		return nil, gensupport.WrapError(err)
   713  	}
   714  	ret := &GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse{
   715  		ServerResponse: googleapi.ServerResponse{
   716  			Header:         res.Header,
   717  			HTTPStatusCode: res.StatusCode,
   718  		},
   719  	}
   720  	target := &ret
   721  	if err := gensupport.DecodeResponse(target, res); err != nil {
   722  		return nil, err
   723  	}
   724  	return ret, nil
   725  }
   726  
   727  // Pages invokes f for each page of results.
   728  // A non-nil error returned from f will halt the iteration.
   729  // The provided context supersedes any context provided to the Context method.
   730  func (c *ClaimsImageSearchCall) Pages(ctx context.Context, f func(*GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse) error) error {
   731  	c.ctx_ = ctx
   732  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   733  	for {
   734  		x, err := c.Do()
   735  		if err != nil {
   736  			return err
   737  		}
   738  		if err := f(x); err != nil {
   739  			return err
   740  		}
   741  		if x.NextPageToken == "" {
   742  			return nil
   743  		}
   744  		c.PageToken(x.NextPageToken)
   745  	}
   746  }
   747  
   748  type ClaimsSearchCall struct {
   749  	s            *Service
   750  	urlParams_   gensupport.URLParams
   751  	ifNoneMatch_ string
   752  	ctx_         context.Context
   753  	header_      http.Header
   754  }
   755  
   756  // Search: Search through fact-checked claims.
   757  func (r *ClaimsService) Search() *ClaimsSearchCall {
   758  	c := &ClaimsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   759  	return c
   760  }
   761  
   762  // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
   763  // code, such as "en-US" or "sr-Latn". Can be used to restrict results by
   764  // language, though we do not currently consider the region.
   765  func (c *ClaimsSearchCall) LanguageCode(languageCode string) *ClaimsSearchCall {
   766  	c.urlParams_.Set("languageCode", languageCode)
   767  	return c
   768  }
   769  
   770  // MaxAgeDays sets the optional parameter "maxAgeDays": The maximum age of the
   771  // returned search results, in days. Age is determined by either claim date or
   772  // review date, whichever is newer.
   773  func (c *ClaimsSearchCall) MaxAgeDays(maxAgeDays int64) *ClaimsSearchCall {
   774  	c.urlParams_.Set("maxAgeDays", fmt.Sprint(maxAgeDays))
   775  	return c
   776  }
   777  
   778  // Offset sets the optional parameter "offset": An integer that specifies the
   779  // current offset (that is, starting result location) in search results. This
   780  // field is only considered if `page_token` is unset. For example, 0 means to
   781  // return results starting from the first matching result, and 10 means to
   782  // return from the 11th result.
   783  func (c *ClaimsSearchCall) Offset(offset int64) *ClaimsSearchCall {
   784  	c.urlParams_.Set("offset", fmt.Sprint(offset))
   785  	return c
   786  }
   787  
   788  // PageSize sets the optional parameter "pageSize": The pagination size. We
   789  // will return up to that many results. Defaults to 10 if not set.
   790  func (c *ClaimsSearchCall) PageSize(pageSize int64) *ClaimsSearchCall {
   791  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   792  	return c
   793  }
   794  
   795  // PageToken sets the optional parameter "pageToken": The pagination token. You
   796  // may provide the `next_page_token` returned from a previous List request, if
   797  // any, in order to get the next page. All other fields must have the same
   798  // values as in the previous request.
   799  func (c *ClaimsSearchCall) PageToken(pageToken string) *ClaimsSearchCall {
   800  	c.urlParams_.Set("pageToken", pageToken)
   801  	return c
   802  }
   803  
   804  // Query sets the optional parameter "query": Textual query string. Required
   805  // unless `review_publisher_site_filter` is specified.
   806  func (c *ClaimsSearchCall) Query(query string) *ClaimsSearchCall {
   807  	c.urlParams_.Set("query", query)
   808  	return c
   809  }
   810  
   811  // ReviewPublisherSiteFilter sets the optional parameter
   812  // "reviewPublisherSiteFilter": The review publisher site to filter results by,
   813  // e.g. nytimes.com.
   814  func (c *ClaimsSearchCall) ReviewPublisherSiteFilter(reviewPublisherSiteFilter string) *ClaimsSearchCall {
   815  	c.urlParams_.Set("reviewPublisherSiteFilter", reviewPublisherSiteFilter)
   816  	return c
   817  }
   818  
   819  // Fields allows partial responses to be retrieved. See
   820  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   821  // details.
   822  func (c *ClaimsSearchCall) Fields(s ...googleapi.Field) *ClaimsSearchCall {
   823  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   824  	return c
   825  }
   826  
   827  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   828  // object's ETag matches the given value. This is useful for getting updates
   829  // only after the object has changed since the last request.
   830  func (c *ClaimsSearchCall) IfNoneMatch(entityTag string) *ClaimsSearchCall {
   831  	c.ifNoneMatch_ = entityTag
   832  	return c
   833  }
   834  
   835  // Context sets the context to be used in this call's Do method.
   836  func (c *ClaimsSearchCall) Context(ctx context.Context) *ClaimsSearchCall {
   837  	c.ctx_ = ctx
   838  	return c
   839  }
   840  
   841  // Header returns a http.Header that can be modified by the caller to add
   842  // headers to the request.
   843  func (c *ClaimsSearchCall) Header() http.Header {
   844  	if c.header_ == nil {
   845  		c.header_ = make(http.Header)
   846  	}
   847  	return c.header_
   848  }
   849  
   850  func (c *ClaimsSearchCall) doRequest(alt string) (*http.Response, error) {
   851  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   852  	if c.ifNoneMatch_ != "" {
   853  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   854  	}
   855  	var body io.Reader = nil
   856  	c.urlParams_.Set("alt", alt)
   857  	c.urlParams_.Set("prettyPrint", "false")
   858  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/claims:search")
   859  	urls += "?" + c.urlParams_.Encode()
   860  	req, err := http.NewRequest("GET", urls, body)
   861  	if err != nil {
   862  		return nil, err
   863  	}
   864  	req.Header = reqHeaders
   865  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   866  }
   867  
   868  // Do executes the "factchecktools.claims.search" call.
   869  // Any non-2xx status code is an error. Response headers are in either
   870  // *GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse.Serve
   871  // rResponse.Header or (if a response was returned at all) in
   872  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   873  // whether the returned error was because http.StatusNotModified was returned.
   874  func (c *ClaimsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse, error) {
   875  	gensupport.SetOptions(c.urlParams_, opts...)
   876  	res, err := c.doRequest("json")
   877  	if res != nil && res.StatusCode == http.StatusNotModified {
   878  		if res.Body != nil {
   879  			res.Body.Close()
   880  		}
   881  		return nil, gensupport.WrapError(&googleapi.Error{
   882  			Code:   res.StatusCode,
   883  			Header: res.Header,
   884  		})
   885  	}
   886  	if err != nil {
   887  		return nil, err
   888  	}
   889  	defer googleapi.CloseBody(res)
   890  	if err := googleapi.CheckResponse(res); err != nil {
   891  		return nil, gensupport.WrapError(err)
   892  	}
   893  	ret := &GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse{
   894  		ServerResponse: googleapi.ServerResponse{
   895  			Header:         res.Header,
   896  			HTTPStatusCode: res.StatusCode,
   897  		},
   898  	}
   899  	target := &ret
   900  	if err := gensupport.DecodeResponse(target, res); err != nil {
   901  		return nil, err
   902  	}
   903  	return ret, nil
   904  }
   905  
   906  // Pages invokes f for each page of results.
   907  // A non-nil error returned from f will halt the iteration.
   908  // The provided context supersedes any context provided to the Context method.
   909  func (c *ClaimsSearchCall) Pages(ctx context.Context, f func(*GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse) error) error {
   910  	c.ctx_ = ctx
   911  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   912  	for {
   913  		x, err := c.Do()
   914  		if err != nil {
   915  			return err
   916  		}
   917  		if err := f(x); err != nil {
   918  			return err
   919  		}
   920  		if x.NextPageToken == "" {
   921  			return nil
   922  		}
   923  		c.PageToken(x.NextPageToken)
   924  	}
   925  }
   926  
   927  type PagesCreateCall struct {
   928  	s                                                             *Service
   929  	googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
   930  	urlParams_                                                    gensupport.URLParams
   931  	ctx_                                                          context.Context
   932  	header_                                                       http.Header
   933  }
   934  
   935  // Create: Create `ClaimReview` markup on a page.
   936  func (r *PagesService) Create(googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage) *PagesCreateCall {
   937  	c := &PagesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   938  	c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage = googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage
   939  	return c
   940  }
   941  
   942  // Fields allows partial responses to be retrieved. See
   943  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   944  // details.
   945  func (c *PagesCreateCall) Fields(s ...googleapi.Field) *PagesCreateCall {
   946  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   947  	return c
   948  }
   949  
   950  // Context sets the context to be used in this call's Do method.
   951  func (c *PagesCreateCall) Context(ctx context.Context) *PagesCreateCall {
   952  	c.ctx_ = ctx
   953  	return c
   954  }
   955  
   956  // Header returns a http.Header that can be modified by the caller to add
   957  // headers to the request.
   958  func (c *PagesCreateCall) Header() http.Header {
   959  	if c.header_ == nil {
   960  		c.header_ = make(http.Header)
   961  	}
   962  	return c.header_
   963  }
   964  
   965  func (c *PagesCreateCall) doRequest(alt string) (*http.Response, error) {
   966  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   967  	var body io.Reader = nil
   968  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage)
   969  	if err != nil {
   970  		return nil, err
   971  	}
   972  	c.urlParams_.Set("alt", alt)
   973  	c.urlParams_.Set("prettyPrint", "false")
   974  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/pages")
   975  	urls += "?" + c.urlParams_.Encode()
   976  	req, err := http.NewRequest("POST", urls, body)
   977  	if err != nil {
   978  		return nil, err
   979  	}
   980  	req.Header = reqHeaders
   981  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   982  }
   983  
   984  // Do executes the "factchecktools.pages.create" call.
   985  // Any non-2xx status code is an error. Response headers are in either
   986  // *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage.ServerResponse
   987  // .Header or (if a response was returned at all) in
   988  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   989  // whether the returned error was because http.StatusNotModified was returned.
   990  func (c *PagesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage, error) {
   991  	gensupport.SetOptions(c.urlParams_, opts...)
   992  	res, err := c.doRequest("json")
   993  	if res != nil && res.StatusCode == http.StatusNotModified {
   994  		if res.Body != nil {
   995  			res.Body.Close()
   996  		}
   997  		return nil, gensupport.WrapError(&googleapi.Error{
   998  			Code:   res.StatusCode,
   999  			Header: res.Header,
  1000  		})
  1001  	}
  1002  	if err != nil {
  1003  		return nil, err
  1004  	}
  1005  	defer googleapi.CloseBody(res)
  1006  	if err := googleapi.CheckResponse(res); err != nil {
  1007  		return nil, gensupport.WrapError(err)
  1008  	}
  1009  	ret := &GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage{
  1010  		ServerResponse: googleapi.ServerResponse{
  1011  			Header:         res.Header,
  1012  			HTTPStatusCode: res.StatusCode,
  1013  		},
  1014  	}
  1015  	target := &ret
  1016  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1017  		return nil, err
  1018  	}
  1019  	return ret, nil
  1020  }
  1021  
  1022  type PagesDeleteCall struct {
  1023  	s          *Service
  1024  	name       string
  1025  	urlParams_ gensupport.URLParams
  1026  	ctx_       context.Context
  1027  	header_    http.Header
  1028  }
  1029  
  1030  // Delete: Delete all `ClaimReview` markup on a page.
  1031  //
  1032  //   - name: The name of the resource to delete, in the form of
  1033  //     `pages/{page_id}`.
  1034  func (r *PagesService) Delete(name string) *PagesDeleteCall {
  1035  	c := &PagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1036  	c.name = name
  1037  	return c
  1038  }
  1039  
  1040  // Fields allows partial responses to be retrieved. See
  1041  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1042  // details.
  1043  func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall {
  1044  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1045  	return c
  1046  }
  1047  
  1048  // Context sets the context to be used in this call's Do method.
  1049  func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall {
  1050  	c.ctx_ = ctx
  1051  	return c
  1052  }
  1053  
  1054  // Header returns a http.Header that can be modified by the caller to add
  1055  // headers to the request.
  1056  func (c *PagesDeleteCall) Header() http.Header {
  1057  	if c.header_ == nil {
  1058  		c.header_ = make(http.Header)
  1059  	}
  1060  	return c.header_
  1061  }
  1062  
  1063  func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  1064  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1065  	var body io.Reader = nil
  1066  	c.urlParams_.Set("alt", alt)
  1067  	c.urlParams_.Set("prettyPrint", "false")
  1068  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1069  	urls += "?" + c.urlParams_.Encode()
  1070  	req, err := http.NewRequest("DELETE", urls, body)
  1071  	if err != nil {
  1072  		return nil, err
  1073  	}
  1074  	req.Header = reqHeaders
  1075  	googleapi.Expand(req.URL, map[string]string{
  1076  		"name": c.name,
  1077  	})
  1078  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1079  }
  1080  
  1081  // Do executes the "factchecktools.pages.delete" call.
  1082  // Any non-2xx status code is an error. Response headers are in either
  1083  // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
  1084  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1085  // check whether the returned error was because http.StatusNotModified was
  1086  // returned.
  1087  func (c *PagesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  1088  	gensupport.SetOptions(c.urlParams_, opts...)
  1089  	res, err := c.doRequest("json")
  1090  	if res != nil && res.StatusCode == http.StatusNotModified {
  1091  		if res.Body != nil {
  1092  			res.Body.Close()
  1093  		}
  1094  		return nil, gensupport.WrapError(&googleapi.Error{
  1095  			Code:   res.StatusCode,
  1096  			Header: res.Header,
  1097  		})
  1098  	}
  1099  	if err != nil {
  1100  		return nil, err
  1101  	}
  1102  	defer googleapi.CloseBody(res)
  1103  	if err := googleapi.CheckResponse(res); err != nil {
  1104  		return nil, gensupport.WrapError(err)
  1105  	}
  1106  	ret := &GoogleProtobufEmpty{
  1107  		ServerResponse: googleapi.ServerResponse{
  1108  			Header:         res.Header,
  1109  			HTTPStatusCode: res.StatusCode,
  1110  		},
  1111  	}
  1112  	target := &ret
  1113  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1114  		return nil, err
  1115  	}
  1116  	return ret, nil
  1117  }
  1118  
  1119  type PagesGetCall struct {
  1120  	s            *Service
  1121  	name         string
  1122  	urlParams_   gensupport.URLParams
  1123  	ifNoneMatch_ string
  1124  	ctx_         context.Context
  1125  	header_      http.Header
  1126  }
  1127  
  1128  // Get: Get all `ClaimReview` markup on a page.
  1129  //
  1130  // - name: The name of the resource to get, in the form of `pages/{page_id}`.
  1131  func (r *PagesService) Get(name string) *PagesGetCall {
  1132  	c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1133  	c.name = name
  1134  	return c
  1135  }
  1136  
  1137  // Fields allows partial responses to be retrieved. See
  1138  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1139  // details.
  1140  func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall {
  1141  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1142  	return c
  1143  }
  1144  
  1145  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1146  // object's ETag matches the given value. This is useful for getting updates
  1147  // only after the object has changed since the last request.
  1148  func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall {
  1149  	c.ifNoneMatch_ = entityTag
  1150  	return c
  1151  }
  1152  
  1153  // Context sets the context to be used in this call's Do method.
  1154  func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall {
  1155  	c.ctx_ = ctx
  1156  	return c
  1157  }
  1158  
  1159  // Header returns a http.Header that can be modified by the caller to add
  1160  // headers to the request.
  1161  func (c *PagesGetCall) Header() http.Header {
  1162  	if c.header_ == nil {
  1163  		c.header_ = make(http.Header)
  1164  	}
  1165  	return c.header_
  1166  }
  1167  
  1168  func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) {
  1169  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1170  	if c.ifNoneMatch_ != "" {
  1171  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1172  	}
  1173  	var body io.Reader = nil
  1174  	c.urlParams_.Set("alt", alt)
  1175  	c.urlParams_.Set("prettyPrint", "false")
  1176  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1177  	urls += "?" + c.urlParams_.Encode()
  1178  	req, err := http.NewRequest("GET", urls, body)
  1179  	if err != nil {
  1180  		return nil, err
  1181  	}
  1182  	req.Header = reqHeaders
  1183  	googleapi.Expand(req.URL, map[string]string{
  1184  		"name": c.name,
  1185  	})
  1186  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1187  }
  1188  
  1189  // Do executes the "factchecktools.pages.get" call.
  1190  // Any non-2xx status code is an error. Response headers are in either
  1191  // *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage.ServerResponse
  1192  // .Header or (if a response was returned at all) in
  1193  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1194  // whether the returned error was because http.StatusNotModified was returned.
  1195  func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage, error) {
  1196  	gensupport.SetOptions(c.urlParams_, opts...)
  1197  	res, err := c.doRequest("json")
  1198  	if res != nil && res.StatusCode == http.StatusNotModified {
  1199  		if res.Body != nil {
  1200  			res.Body.Close()
  1201  		}
  1202  		return nil, gensupport.WrapError(&googleapi.Error{
  1203  			Code:   res.StatusCode,
  1204  			Header: res.Header,
  1205  		})
  1206  	}
  1207  	if err != nil {
  1208  		return nil, err
  1209  	}
  1210  	defer googleapi.CloseBody(res)
  1211  	if err := googleapi.CheckResponse(res); err != nil {
  1212  		return nil, gensupport.WrapError(err)
  1213  	}
  1214  	ret := &GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage{
  1215  		ServerResponse: googleapi.ServerResponse{
  1216  			Header:         res.Header,
  1217  			HTTPStatusCode: res.StatusCode,
  1218  		},
  1219  	}
  1220  	target := &ret
  1221  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1222  		return nil, err
  1223  	}
  1224  	return ret, nil
  1225  }
  1226  
  1227  type PagesListCall struct {
  1228  	s            *Service
  1229  	urlParams_   gensupport.URLParams
  1230  	ifNoneMatch_ string
  1231  	ctx_         context.Context
  1232  	header_      http.Header
  1233  }
  1234  
  1235  // List: List the `ClaimReview` markup pages for a specific URL or for an
  1236  // organization.
  1237  func (r *PagesService) List() *PagesListCall {
  1238  	c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1239  	return c
  1240  }
  1241  
  1242  // Offset sets the optional parameter "offset": An integer that specifies the
  1243  // current offset (that is, starting result location) in search results. This
  1244  // field is only considered if `page_token` is unset, and if the request is not
  1245  // for a specific URL. For example, 0 means to return results starting from the
  1246  // first matching result, and 10 means to return from the 11th result.
  1247  func (c *PagesListCall) Offset(offset int64) *PagesListCall {
  1248  	c.urlParams_.Set("offset", fmt.Sprint(offset))
  1249  	return c
  1250  }
  1251  
  1252  // Organization sets the optional parameter "organization": The organization
  1253  // for which we want to fetch markups for. For instance, "site.com". Cannot be
  1254  // specified along with an URL.
  1255  func (c *PagesListCall) Organization(organization string) *PagesListCall {
  1256  	c.urlParams_.Set("organization", organization)
  1257  	return c
  1258  }
  1259  
  1260  // PageSize sets the optional parameter "pageSize": The pagination size. We
  1261  // will return up to that many results. Defaults to 10 if not set. Has no
  1262  // effect if a URL is requested.
  1263  func (c *PagesListCall) PageSize(pageSize int64) *PagesListCall {
  1264  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1265  	return c
  1266  }
  1267  
  1268  // PageToken sets the optional parameter "pageToken": The pagination token. You
  1269  // may provide the `next_page_token` returned from a previous List request, if
  1270  // any, in order to get the next page. All other fields must have the same
  1271  // values as in the previous request.
  1272  func (c *PagesListCall) PageToken(pageToken string) *PagesListCall {
  1273  	c.urlParams_.Set("pageToken", pageToken)
  1274  	return c
  1275  }
  1276  
  1277  // Url sets the optional parameter "url": The URL from which to get
  1278  // `ClaimReview` markup. There will be at most one result. If markup is
  1279  // associated with a more canonical version of the URL provided, we will return
  1280  // that URL instead. Cannot be specified along with an organization.
  1281  func (c *PagesListCall) Url(url string) *PagesListCall {
  1282  	c.urlParams_.Set("url", url)
  1283  	return c
  1284  }
  1285  
  1286  // Fields allows partial responses to be retrieved. See
  1287  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1288  // details.
  1289  func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall {
  1290  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1291  	return c
  1292  }
  1293  
  1294  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1295  // object's ETag matches the given value. This is useful for getting updates
  1296  // only after the object has changed since the last request.
  1297  func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall {
  1298  	c.ifNoneMatch_ = entityTag
  1299  	return c
  1300  }
  1301  
  1302  // Context sets the context to be used in this call's Do method.
  1303  func (c *PagesListCall) Context(ctx context.Context) *PagesListCall {
  1304  	c.ctx_ = ctx
  1305  	return c
  1306  }
  1307  
  1308  // Header returns a http.Header that can be modified by the caller to add
  1309  // headers to the request.
  1310  func (c *PagesListCall) Header() http.Header {
  1311  	if c.header_ == nil {
  1312  		c.header_ = make(http.Header)
  1313  	}
  1314  	return c.header_
  1315  }
  1316  
  1317  func (c *PagesListCall) doRequest(alt string) (*http.Response, error) {
  1318  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1319  	if c.ifNoneMatch_ != "" {
  1320  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1321  	}
  1322  	var body io.Reader = nil
  1323  	c.urlParams_.Set("alt", alt)
  1324  	c.urlParams_.Set("prettyPrint", "false")
  1325  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/pages")
  1326  	urls += "?" + c.urlParams_.Encode()
  1327  	req, err := http.NewRequest("GET", urls, body)
  1328  	if err != nil {
  1329  		return nil, err
  1330  	}
  1331  	req.Header = reqHeaders
  1332  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1333  }
  1334  
  1335  // Do executes the "factchecktools.pages.list" call.
  1336  // Any non-2xx status code is an error. Response headers are in either
  1337  // *GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse.S
  1338  // erverResponse.Header or (if a response was returned at all) in
  1339  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1340  // whether the returned error was because http.StatusNotModified was returned.
  1341  func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse, error) {
  1342  	gensupport.SetOptions(c.urlParams_, opts...)
  1343  	res, err := c.doRequest("json")
  1344  	if res != nil && res.StatusCode == http.StatusNotModified {
  1345  		if res.Body != nil {
  1346  			res.Body.Close()
  1347  		}
  1348  		return nil, gensupport.WrapError(&googleapi.Error{
  1349  			Code:   res.StatusCode,
  1350  			Header: res.Header,
  1351  		})
  1352  	}
  1353  	if err != nil {
  1354  		return nil, err
  1355  	}
  1356  	defer googleapi.CloseBody(res)
  1357  	if err := googleapi.CheckResponse(res); err != nil {
  1358  		return nil, gensupport.WrapError(err)
  1359  	}
  1360  	ret := &GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse{
  1361  		ServerResponse: googleapi.ServerResponse{
  1362  			Header:         res.Header,
  1363  			HTTPStatusCode: res.StatusCode,
  1364  		},
  1365  	}
  1366  	target := &ret
  1367  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1368  		return nil, err
  1369  	}
  1370  	return ret, nil
  1371  }
  1372  
  1373  // Pages invokes f for each page of results.
  1374  // A non-nil error returned from f will halt the iteration.
  1375  // The provided context supersedes any context provided to the Context method.
  1376  func (c *PagesListCall) Pages(ctx context.Context, f func(*GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse) error) error {
  1377  	c.ctx_ = ctx
  1378  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1379  	for {
  1380  		x, err := c.Do()
  1381  		if err != nil {
  1382  			return err
  1383  		}
  1384  		if err := f(x); err != nil {
  1385  			return err
  1386  		}
  1387  		if x.NextPageToken == "" {
  1388  			return nil
  1389  		}
  1390  		c.PageToken(x.NextPageToken)
  1391  	}
  1392  }
  1393  
  1394  type PagesUpdateCall struct {
  1395  	s                                                             *Service
  1396  	name                                                          string
  1397  	googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
  1398  	urlParams_                                                    gensupport.URLParams
  1399  	ctx_                                                          context.Context
  1400  	header_                                                       http.Header
  1401  }
  1402  
  1403  // Update: Update for all `ClaimReview` markup on a page Note that this is a
  1404  // full update. To retain the existing `ClaimReview` markup on a page, first
  1405  // perform a Get operation, then modify the returned markup, and finally call
  1406  // Update with the entire `ClaimReview` markup as the body.
  1407  //
  1408  //   - name: The name of this `ClaimReview` markup page resource, in the form of
  1409  //     `pages/{page_id}`. Except for update requests, this field is output-only
  1410  //     and should not be set by the user.
  1411  func (r *PagesService) Update(name string, googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage) *PagesUpdateCall {
  1412  	c := &PagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1413  	c.name = name
  1414  	c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage = googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage
  1415  	return c
  1416  }
  1417  
  1418  // Fields allows partial responses to be retrieved. See
  1419  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1420  // details.
  1421  func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall {
  1422  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1423  	return c
  1424  }
  1425  
  1426  // Context sets the context to be used in this call's Do method.
  1427  func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall {
  1428  	c.ctx_ = ctx
  1429  	return c
  1430  }
  1431  
  1432  // Header returns a http.Header that can be modified by the caller to add
  1433  // headers to the request.
  1434  func (c *PagesUpdateCall) Header() http.Header {
  1435  	if c.header_ == nil {
  1436  		c.header_ = make(http.Header)
  1437  	}
  1438  	return c.header_
  1439  }
  1440  
  1441  func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  1442  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1443  	var body io.Reader = nil
  1444  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefactcheckingfactchecktoolsv1alpha1claimreviewmarkuppage)
  1445  	if err != nil {
  1446  		return nil, err
  1447  	}
  1448  	c.urlParams_.Set("alt", alt)
  1449  	c.urlParams_.Set("prettyPrint", "false")
  1450  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1451  	urls += "?" + c.urlParams_.Encode()
  1452  	req, err := http.NewRequest("PUT", urls, body)
  1453  	if err != nil {
  1454  		return nil, err
  1455  	}
  1456  	req.Header = reqHeaders
  1457  	googleapi.Expand(req.URL, map[string]string{
  1458  		"name": c.name,
  1459  	})
  1460  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1461  }
  1462  
  1463  // Do executes the "factchecktools.pages.update" call.
  1464  // Any non-2xx status code is an error. Response headers are in either
  1465  // *GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage.ServerResponse
  1466  // .Header or (if a response was returned at all) in
  1467  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1468  // whether the returned error was because http.StatusNotModified was returned.
  1469  func (c *PagesUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage, error) {
  1470  	gensupport.SetOptions(c.urlParams_, opts...)
  1471  	res, err := c.doRequest("json")
  1472  	if res != nil && res.StatusCode == http.StatusNotModified {
  1473  		if res.Body != nil {
  1474  			res.Body.Close()
  1475  		}
  1476  		return nil, gensupport.WrapError(&googleapi.Error{
  1477  			Code:   res.StatusCode,
  1478  			Header: res.Header,
  1479  		})
  1480  	}
  1481  	if err != nil {
  1482  		return nil, err
  1483  	}
  1484  	defer googleapi.CloseBody(res)
  1485  	if err := googleapi.CheckResponse(res); err != nil {
  1486  		return nil, gensupport.WrapError(err)
  1487  	}
  1488  	ret := &GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage{
  1489  		ServerResponse: googleapi.ServerResponse{
  1490  			Header:         res.Header,
  1491  			HTTPStatusCode: res.StatusCode,
  1492  		},
  1493  	}
  1494  	target := &ret
  1495  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1496  		return nil, err
  1497  	}
  1498  	return ret, nil
  1499  }
  1500  

View as plain text