Class: Google::Apis::WebcontentpublisherV1::WebContentPublisherService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/webcontentpublisher_v1/service.rb

Overview

Web Content Publisher API

webcontentpublisher.googleapis.com API, a service for web content publishers.

Examples:

require 'google/apis/webcontentpublisher_v1'

Webcontentpublisher = Google::Apis::WebcontentpublisherV1 # Alias the module
service = Webcontentpublisher::WebContentPublisherService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://webcontentpublisher.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWebContentPublisherService

Returns a new instance of WebContentPublisherService.



47
48
49
50
51
52
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-webcontentpublisher_v1',
        client_version: Google::Apis::WebcontentpublisherV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



40
41
42
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 40

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



45
46
47
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#check_publication_free_access(name, http_referrer: nil, uri: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::CheckFreeAccessResponse

Checks if a user is eligible for free article access.

Parameters:

  • name (String)

    Required. The resource name of the publication. Format: publications/ publication_id

  • http_referrer (String) (defaults to: nil)

    Required. The HTTP referrer.

  • uri (String) (defaults to: nil)

    Required. The URI of the content.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



336
337
338
339
340
341
342
343
344
345
346
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 336

def check_publication_free_access(name, http_referrer: nil, uri: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}:checkFreeAccess', options)
  command.response_representation = Google::Apis::WebcontentpublisherV1::CheckFreeAccessResponse::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::CheckFreeAccessResponse
  command.params['name'] = name unless name.nil?
  command.query['httpReferrer'] = http_referrer unless http_referrer.nil?
  command.query['uri'] = uri unless uri.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_organization_publication(parent, publication_object = nil, publication_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::Publication

Creates a publication.

Parameters:

  • parent (String)

    Required. The parent resource where this publication will be created. Format: organizations/organization``.

  • publication_object (Google::Apis::WebcontentpublisherV1::Publication) (defaults to: nil)
  • publication_id (String) (defaults to: nil)

    Optional. The unique identifier of the publication to create. If not specified, the server will generate a random publication ID.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 79

def create_organization_publication(parent, publication_object = nil, publication_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/publications', options)
  command.request_representation = Google::Apis::WebcontentpublisherV1::Publication::Representation
  command.request_object = publication_object
  command.response_representation = Google::Apis::WebcontentpublisherV1::Publication::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::Publication
  command.params['parent'] = parent unless parent.nil?
  command.query['publicationId'] = publication_id unless publication_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_organization_publication_cta(parent, cta_object = nil, cta_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::Cta

Creates a CTA.

Parameters:

  • parent (String)

    Required. The parent publication resource where this CTA will be created. Format: organizations/organization/publications/publication``.

  • cta_object (Google::Apis::WebcontentpublisherV1::Cta) (defaults to: nil)
  • cta_id (String) (defaults to: nil)

    Optional. The unique identifier of the CTA to create. If not specified, the server will generate a random CTA ID.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 228

def create_organization_publication_cta(parent, cta_object = nil, cta_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/ctas', options)
  command.request_representation = Google::Apis::WebcontentpublisherV1::Cta::Representation
  command.request_object = cta_object
  command.response_representation = Google::Apis::WebcontentpublisherV1::Cta::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::Cta
  command.params['parent'] = parent unless parent.nil?
  command.query['ctaId'] = cta_id unless cta_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_organization_publication(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::Publication

Gets a publication.

Parameters:

  • name (String)

    Required. The resource name of the publication to retrieve. Format: organizations/organization/publications/publication``.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



113
114
115
116
117
118
119
120
121
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 113

def get_organization_publication(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::WebcontentpublisherV1::Publication::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::Publication
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_organization_publication_cta(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::Cta

Gets a CTA.

Parameters:

  • name (String)

    Required. The resource name of the CTA to retrieve. Format: organizations/ organization/publications/publication/ctas/cta``.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



262
263
264
265
266
267
268
269
270
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 262

def get_organization_publication_cta(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::WebcontentpublisherV1::Cta::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::Cta
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_organization_publication_ctas(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::ListCtasResponse

Lists CTAs.

Parameters:

  • parent (String)

    Required. The parent publication resource whose CTAs to list. Format: organizations/organization/publications/publication``.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of CTAs to return. The service may return fewer than this value. If unspecified, at most 50 CTAs will be returned.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListCtas call, to retrieve the next page.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



299
300
301
302
303
304
305
306
307
308
309
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 299

def list_organization_publication_ctas(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/ctas', options)
  command.response_representation = Google::Apis::WebcontentpublisherV1::ListCtasResponse::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::ListCtasResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_organization_publications(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::ListPublicationsResponse

Lists publications.

Parameters:

  • parent (String)

    Required. The parent organization whose publications to list. Format: organizations/organization``.

  • filter (String) (defaults to: nil)

    Optional. A filter expression to filter the publications returned.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of publications to return. The service may return fewer than this value. If unspecified, at most 50 publications will be returned.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListPublications call, to retrieve the next page.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 153

def list_organization_publications(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/publications', options)
  command.response_representation = Google::Apis::WebcontentpublisherV1::ListPublicationsResponse::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::ListPublicationsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_organization_publication(name, publication_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebcontentpublisherV1::Publication

Updates a publication.

Parameters:

  • name (String)

    Identifier. The resource name of the publication. Format: organizations/ organization/publications/publication

  • publication_object (Google::Apis::WebcontentpublisherV1::Publication) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Optional. The list of fields to update.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/google/apis/webcontentpublisher_v1/service.rb', line 190

def patch_organization_publication(name, publication_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::WebcontentpublisherV1::Publication::Representation
  command.request_object = publication_object
  command.response_representation = Google::Apis::WebcontentpublisherV1::Publication::Representation
  command.response_class = Google::Apis::WebcontentpublisherV1::Publication
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end