class Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Rest::ServiceStub
including transcoding, making the REST call, and deserialing the response.
Service stub contains baseline method implementations
REST service stub for the ProgramsService service.
#
def self.transcode_disable_program_request request_pb
-
(Array(String, [String, nil], Hash{String => String}))-
Parameters:
-
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::DisableProgramRequest) --
Other tags:
- Private: -
def self.transcode_disable_program_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/accounts/v1beta/{name}:disable", body: "*", matches: [ ["name", %r{^accounts/[^/]+/programs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end
def self.transcode_enable_program_request request_pb
-
(Array(String, [String, nil], Hash{String => String}))-
Parameters:
-
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::EnableProgramRequest) --
Other tags:
- Private: -
def self.transcode_enable_program_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/accounts/v1beta/{name}:enable", body: "*", matches: [ ["name", %r{^accounts/[^/]+/programs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end
def self.transcode_get_program_request request_pb
-
(Array(String, [String, nil], Hash{String => String}))-
Parameters:
-
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::GetProgramRequest) --
Other tags:
- Private: -
def self.transcode_get_program_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/accounts/v1beta/{name}", matches: [ ["name", %r{^accounts/[^/]+/programs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end
def self.transcode_list_programs_request request_pb
-
(Array(String, [String, nil], Hash{String => String}))-
Parameters:
-
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::ListProgramsRequest) --
Other tags:
- Private: -
def self.transcode_list_programs_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/accounts/v1beta/{parent}/programs", matches: [ ["parent", %r{^accounts/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end
def disable_program request_pb, options = nil
-
(::Google::Shopping::Merchant::Accounts::V1beta::Program)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
Parameters:
-
options(::Gapic::CallOptions) -- -
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::DisableProgramRequest) --
def disable_program request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_disable_program_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Shopping::Merchant::Accounts::V1beta::Program.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end
def enable_program request_pb, options = nil
-
(::Google::Shopping::Merchant::Accounts::V1beta::Program)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
Parameters:
-
options(::Gapic::CallOptions) -- -
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::EnableProgramRequest) --
def enable_program request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_enable_program_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Shopping::Merchant::Accounts::V1beta::Program.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end
def endpoint
-
(String)-
def endpoint @client_stub.endpoint end
def get_program request_pb, options = nil
-
(::Google::Shopping::Merchant::Accounts::V1beta::Program)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
Parameters:
-
options(::Gapic::CallOptions) -- -
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::GetProgramRequest) --
def get_program request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_get_program_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Shopping::Merchant::Accounts::V1beta::Program.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
def initialize endpoint:, endpoint_template:, universe_domain:, credentials: # These require statements are intentionally placed here to initialize # the REST modules only when it's required. require "gapic/rest" @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, endpoint_template: endpoint_template, universe_domain: universe_domain, credentials: credentials, numeric_enums: true, raise_faraday_errors: false end
def list_programs request_pb, options = nil
-
(::Google::Shopping::Merchant::Accounts::V1beta::ListProgramsResponse)-
Other tags:
- Yieldparam: operation -
Yieldparam: result -
Other tags:
- Yield: - Access the result along with the TransportOperation object
Parameters:
-
options(::Gapic::CallOptions) -- -
request_pb(::Google::Shopping::Merchant::Accounts::V1beta::ListProgramsRequest) --
def list_programs request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_list_programs_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Shopping::Merchant::Accounts::V1beta::ListProgramsResponse.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end
def universe_domain
-
(String)-
def universe_domain @client_stub.universe_domain end