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


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

def self.transcode_create_data_scan_request request_pb

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

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

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

def self.transcode_delete_data_scan_request request_pb

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

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

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

def self.transcode_get_data_scan_job_request request_pb

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

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

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

def self.transcode_get_data_scan_request request_pb

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

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

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

def self.transcode_list_data_scan_jobs_request request_pb

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

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

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

def self.transcode_list_data_scans_request request_pb

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

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

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

def self.transcode_run_data_scan_request request_pb

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

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

Other tags:
    Private: -
def self.transcode_run_data_scan_request request_pb
  transcoder = Gapic::Rest::GrpcTranscoder.new
                                          .with_bindings(
                                            uri_method: :post,
                                            uri_template: "/v1/{name}:run",
                                            body: "*",
                                            matches: [
                                              ["name", %r{^projects/[^/]+/locations/[^/]+/dataScans/[^/]+/?$}, false]
                                            ]
                                          )
  transcoder.transcode request_pb
end

def self.transcode_update_data_scan_request request_pb

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

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

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

def create_data_scan request_pb, options = nil

Returns:
  • (::Google::Longrunning::Operation) -

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::CreateDataScanRequest) --
def create_data_scan request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_create_data_scan_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::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def delete_data_scan request_pb, options = nil

Returns:
  • (::Google::Longrunning::Operation) -

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::DeleteDataScanRequest) --
def delete_data_scan request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_data_scan_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::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def get_data_scan request_pb, options = nil

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

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::GetDataScanRequest) --
def get_data_scan request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_get_data_scan_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::DataScan.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def get_data_scan_job request_pb, options = nil

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

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::GetDataScanJobRequest) --
def get_data_scan_job request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_get_data_scan_job_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::DataScanJob.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_data_scan_jobs request_pb, options = nil

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

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::ListDataScanJobsRequest) --
def list_data_scan_jobs request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_list_data_scan_jobs_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::ListDataScanJobsResponse.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def list_data_scans request_pb, options = nil

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

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::ListDataScansRequest) --
def list_data_scans request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_list_data_scans_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::ListDataScansResponse.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def run_data_scan request_pb, options = nil

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

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::RunDataScanRequest) --
def run_data_scan request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_run_data_scan_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::RunDataScanResponse.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end

def update_data_scan request_pb, options = nil

Returns:
  • (::Google::Longrunning::Operation) -

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::UpdateDataScanRequest) --
def update_data_scan request_pb, options = nil
  raise ::ArgumentError, "request must be provided" if request_pb.nil?
  verb, uri, query_string_params, body = ServiceStub.transcode_update_data_scan_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::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
  yield result, operation if block_given?
  result
end