Class: Google::Apis::CssV1::CssService

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

Overview

CSS API

Programmatically manage your Comparison Shopping Service (CSS) account data at scale.

Examples:

require 'google/apis/css_v1'

Css = Google::Apis::CssV1 # Alias the module
service = Css::CssService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCssService

Returns a new instance of CssService.



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

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-css_v1',
        client_version: Google::Apis::CssV1::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.



41
42
43
# File 'lib/google/apis/css_v1/service.rb', line 41

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.



46
47
48
# File 'lib/google/apis/css_v1/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#create_account_label(parent, account_label_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::AccountLabel

Creates a new label, not assigned to any account.

Parameters:

  • parent (String)

    Required. The parent account. Format: accounts/account

  • account_label_object (Google::Apis::CssV1::AccountLabel) (defaults to: nil)
  • 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



351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/apis/css_v1/service.rb', line 351

def (parent,  = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/labels', options)
  command.request_representation = Google::Apis::CssV1::AccountLabel::Representation
  command.request_object = 
  command.response_representation = Google::Apis::CssV1::AccountLabel::Representation
  command.response_class = Google::Apis::CssV1::AccountLabel
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_account_css_product_input(name, supplemental_feed_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::Empty

Deletes a CSS Product input from your CSS Center account. After a delete it may take several minutes until the input is no longer available.

Parameters:

  • name (String)

    Required. The name of the CSS product input resource to delete. Format: accounts/account/cssProductInputs/css_product_input

  • supplemental_feed_id (Fixnum) (defaults to: nil)

    The Content API Supplemental Feed ID. The field must not be set if the action applies to a primary feed. If the field is set, then product action applies to a supplemental feed instead of primary Content API feed.

  • 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



198
199
200
201
202
203
204
205
206
207
# File 'lib/google/apis/css_v1/service.rb', line 198

def (name, supplemental_feed_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CssV1::Empty::Representation
  command.response_class = Google::Apis::CssV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['supplementalFeedId'] = supplemental_feed_id unless supplemental_feed_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

#delete_account_label(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::Empty

Deletes a label and removes it from all accounts to which it was assigned.

Parameters:

  • name (String)

    Required. The name of the label to delete. Format: accounts/account/labels/ label

  • 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



384
385
386
387
388
389
390
391
392
# File 'lib/google/apis/css_v1/service.rb', line 384

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CssV1::Empty::Representation
  command.response_class = Google::Apis::CssV1::Empty
  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_account(name, parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::Account

Retrieves a single CSS/MC account by ID.

Parameters:

  • name (String)

    Required. The name of the managed CSS/MC account. Format: accounts/account

  • parent (String) (defaults to: nil)

    Optional. Only required when retrieving MC account information. The CSS domain that is the parent resource of the MC account. Format: accounts/account

  • 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



78
79
80
81
82
83
84
85
86
87
# File 'lib/google/apis/css_v1/service.rb', line 78

def (name, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CssV1::Account::Representation
  command.response_class = Google::Apis::CssV1::Account
  command.params['name'] = name unless name.nil?
  command.query['parent'] = parent unless parent.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_account_css_product(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::CssProduct

Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or deleting a product input, it may take several minutes before the updated final product can be retrieved.

Parameters:

  • name (String)

    Required. The name of the CSS product to retrieve.

  • 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



275
276
277
278
279
280
281
282
283
# File 'lib/google/apis/css_v1/service.rb', line 275

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CssV1::CssProduct::Representation
  command.response_class = Google::Apis::CssV1::CssProduct
  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

#insert_account_css_product_input(parent, css_product_input_object = nil, feed_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::CssProductInput

Uploads a CssProductInput to your CSS Center account. If an input with the same contentLanguage, identity, feedLabel and feedId already exists, this method replaces that entry. After inserting, updating, or deleting a CSS Product input, it may take several minutes before the processed CSS Product can be retrieved.

Parameters:

  • parent (String)

    Required. The account where this CSS Product will be inserted. Format: accounts/account

  • css_product_input_object (Google::Apis::CssV1::CssProductInput) (defaults to: nil)
  • feed_id (Fixnum) (defaults to: nil)

    Required. The primary or supplemental feed id. If CSS Product already exists and feed id provided is different, then the CSS Product will be moved to a new feed. Note: For now, CSSs do not need to provide feed ids as we create feeds on the fly. We do not have supplemental feed support for CSS Products yet.

  • 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



240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/google/apis/css_v1/service.rb', line 240

def (parent, css_product_input_object = nil, feed_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/cssProductInputs:insert', options)
  command.request_representation = Google::Apis::CssV1::CssProductInput::Representation
  command.request_object = css_product_input_object
  command.response_representation = Google::Apis::CssV1::CssProductInput::Representation
  command.response_class = Google::Apis::CssV1::CssProductInput
  command.params['parent'] = parent unless parent.nil?
  command.query['feedId'] = feed_id unless feed_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

#list_account_child_accounts(parent, full_name: nil, label_id: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::ListChildAccountsResponse

Lists all the accounts under the specified CSS account ID, and optionally filters by label ID and account name.

Parameters:

  • parent (String)

    Required. The parent account. Must be a CSS group or domain. Format: accounts/ account

  • full_name (String) (defaults to: nil)

    If set, only the MC accounts with the given name (case sensitive) will be returned.

  • label_id (Fixnum) (defaults to: nil)

    If set, only the MC accounts with the given label ID will be returned.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of accounts to return. The service may return fewer than this value. If unspecified, at most 50 accounts will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListChildAccounts call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListChildAccounts must match the call that provided the page token.

  • 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



125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/google/apis/css_v1/service.rb', line 125

def (parent, full_name: nil, label_id: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}:listChildAccounts', options)
  command.response_representation = Google::Apis::CssV1::ListChildAccountsResponse::Representation
  command.response_class = Google::Apis::CssV1::ListChildAccountsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fullName'] = full_name unless full_name.nil?
  command.query['labelId'] = label_id unless label_id.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_account_css_products(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::ListCssProductsResponse

Lists the processed CSS Products in your CSS Center account. The response might contain fewer items than specified by pageSize. Rely on pageToken to determine if there are more items to be requested. After inserting, updating, or deleting a CSS product input, it may take several minutes before the updated processed CSS product can be retrieved.

Parameters:

  • parent (String)

    Required. The account/domain to list processed CSS Products for. Format: accounts/account

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of CSS Products to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of CSS products will be returned.

  • page_token (String) (defaults to: nil)

    A page token, received from a previous ListCssProducts call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListCssProducts must match the call that provided the page token.

  • 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



318
319
320
321
322
323
324
325
326
327
328
# File 'lib/google/apis/css_v1/service.rb', line 318

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/cssProducts', options)
  command.response_representation = Google::Apis::CssV1::ListCssProductsResponse::Representation
  command.response_class = Google::Apis::CssV1::ListCssProductsResponse
  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_account_labels(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::ListAccountLabelsResponse

Lists the labels assigned to an account.

Parameters:

  • parent (String)

    Required. The parent account. Format: accounts/account

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of labels to return. The service may return fewer than this value. If unspecified, at most 50 labels will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

  • page_token (String) (defaults to: nil)

    A page token, received from a previous ListAccountLabels call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAccountLabels must match the call that provided the page token.

  • 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



423
424
425
426
427
428
429
430
431
432
433
# File 'lib/google/apis/css_v1/service.rb', line 423

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/labels', options)
  command.response_representation = Google::Apis::CssV1::ListAccountLabelsResponse::Representation
  command.response_class = Google::Apis::CssV1::ListAccountLabelsResponse
  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

#patch_account_label(name, account_label_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::AccountLabel

Updates a label.

Parameters:

  • name (String)

    The resource name of the label. Format: accounts/account/labels/label

  • account_label_object (Google::Apis::CssV1::AccountLabel) (defaults to: nil)
  • 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



456
457
458
459
460
461
462
463
464
465
466
# File 'lib/google/apis/css_v1/service.rb', line 456

def (name,  = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::CssV1::AccountLabel::Representation
  command.request_object = 
  command.response_representation = Google::Apis::CssV1::AccountLabel::Representation
  command.response_class = Google::Apis::CssV1::AccountLabel
  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

#update_account_labels(name, update_account_labels_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CssV1::Account

Updates labels assigned to CSS/MC accounts by a CSS domain.

Parameters:

  • name (String)

    Required. The label resource name. Format: accounts/account

  • update_account_labels_request_object (Google::Apis::CssV1::UpdateAccountLabelsRequest) (defaults to: nil)
  • 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



160
161
162
163
164
165
166
167
168
169
170
# File 'lib/google/apis/css_v1/service.rb', line 160

def (name,  = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:updateLabels', options)
  command.request_representation = Google::Apis::CssV1::UpdateAccountLabelsRequest::Representation
  command.request_object = 
  command.response_representation = Google::Apis::CssV1::Account::Representation
  command.response_class = Google::Apis::CssV1::Account
  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