class Google::Cloud::Dataplex::V1::MetadataService::Rest::ServiceStub


including transcoding, making the REST call, and deserialing the response.
Service stub contains baseline method implementations
REST service stub for the MetadataService service.
#

def self.transcode_create_entity_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::CreateEntityRequest) --

Other tags:
    Private: -
def self.transcode_create_entity_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :post,
                                            uri_template: "/v1/{parent}/entities",
                                            body: "entity",
                                            matches: [
                                              ["parent", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_create_partition_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::CreatePartitionRequest) --

Other tags:
    Private: -
def self.transcode_create_partition_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :post,
                                            uri_template: "/v1/{parent}/partitions",
                                            body: "partition",
                                            matches: [
                                              ["parent", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/entities/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_delete_entity_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::DeleteEntityRequest) --

Other tags:
    Private: -
def self.transcode_delete_entity_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :delete,
                                            uri_template: "/v1/{name}",
                                            matches: [
                                              ["name", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/entities/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_delete_partition_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::DeletePartitionRequest) --

Other tags:
    Private: -
def self.transcode_delete_partition_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :delete,
                                            uri_template: "/v1/{name}",
                                            matches: [
                                              ["name", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/entities/[^/]+/partitions(?:/.*)?$}, true]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_get_entity_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::GetEntityRequest) --

Other tags:
    Private: -
def self.transcode_get_entity_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :get,
                                            uri_template: "/v1/{name}",
                                            matches: [
                                              ["name", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/entities/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_get_partition_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::GetPartitionRequest) --

Other tags:
    Private: -
def self.transcode_get_partition_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :get,
                                            uri_template: "/v1/{name}",
                                            matches: [
                                              ["name", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/entities/[^/]+/partitions(?:/.*)?$}, true]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_list_entities_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::ListEntitiesRequest) --

Other tags:
    Private: -
def self.transcode_list_entities_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :get,
                                            uri_template: "/v1/{parent}/entities",
                                            matches: [
                                              ["parent", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_list_partitions_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::ListPartitionsRequest) --

Other tags:
    Private: -
def self.transcode_list_partitions_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :get,
                                            uri_template: "/v1/{parent}/partitions",
                                            matches: [
                                              ["parent", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/entities/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_update_entity_request request_pb

Returns:
  • (Array(String, [String, nil], Hash{String => String})) -

Parameters:
  • request_pb (::Google::Cloud::Dataplex::V1::UpdateEntityRequest) --

Other tags:
    Private: -
def self.transcode_update_entity_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :put,
                                            uri_template: "/v1/{entity.name}",
                                            body: "entity",
                                            matches: [
                                              ["entity.name", %r{^projects/[^/]+/locations/[^/]+/lakes/[^/]+/zones/[^/]+/entities/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def create_entity request_pb, options = nil

Returns:
  • (::Google::Cloud::Dataplex::V1::Entity) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::CreateEntityRequest) --
def create_entity request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_create_entity_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::Cloud::Dataplex::V1::Entity.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def create_partition request_pb, options = nil

Returns:
  • (::Google::Cloud::Dataplex::V1::Partition) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::CreatePartitionRequest) --
def create_partition request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_create_partition_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::Cloud::Dataplex::V1::Partition.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def delete_entity request_pb, options = nil

Returns:
  • (::Google::Protobuf::Empty) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::DeleteEntityRequest) --
def delete_entity request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_entity_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::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def delete_partition request_pb, options = nil

Returns:
  • (::Google::Protobuf::Empty) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::DeletePartitionRequest) --
def delete_partition request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_partition_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::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def get_entity request_pb, options = nil

Returns:
  • (::Google::Cloud::Dataplex::V1::Entity) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::GetEntityRequest) --
def get_entity request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_get_entity_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::Cloud::Dataplex::V1::Entity.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def get_partition request_pb, options = nil

Returns:
  • (::Google::Cloud::Dataplex::V1::Partition) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::GetPartitionRequest) --
def get_partition request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_get_partition_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::Cloud::Dataplex::V1::Partition.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def initialize endpoint:, credentials:

def initialize endpoint:, 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, credentials: credentials,
                                               numeric_enums: true,
                                               raise_faraday_errors: false
end

def list_entities request_pb, options = nil

Returns:
  • (::Google::Cloud::Dataplex::V1::ListEntitiesResponse) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::ListEntitiesRequest) --
def list_entities request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_list_entities_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::Cloud::Dataplex::V1::ListEntitiesResponse.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def list_partitions request_pb, options = nil

Returns:
  • (::Google::Cloud::Dataplex::V1::ListPartitionsResponse) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::ListPartitionsRequest) --
def list_partitions request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_list_partitions_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::Cloud::Dataplex::V1::ListPartitionsResponse.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def update_entity request_pb, options = nil

Returns:
  • (::Google::Cloud::Dataplex::V1::Entity) -

Other tags:
    Yieldparam: operation -
    Yieldparam: result -

Other tags:
    Yield: - Access the result along with the TransportOperation object

Parameters:
  • options (::Gapic::CallOptions) --
  • request_pb (::Google::Cloud::Dataplex::V1::UpdateEntityRequest) --
def update_entity request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_update_entity_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::Cloud::Dataplex::V1::Entity.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end