Class v1beta.FileUploadsServiceClient (0.3.0)

Service to manage data source file uploads. v1beta

Package

@google-shopping/datasources

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of FileUploadsServiceClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new FileUploadsServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

fileUploadsServiceStub

fileUploadsServiceStub?: Promise<{
        [name: string]: Function;
    }>;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type Description
Promise<void>

{Promise} A promise that resolves when the client is closed.

dataSourcePath(account, datasource)

dataSourcePath(account: string, datasource: string): string;

Return a fully-qualified dataSource resource name string.

Parameters
Name Description
account string
datasource string
Returns
Type Description
string

{string} Resource name string.

fileUploadPath(account, datasource, fileupload)

fileUploadPath(account: string, datasource: string, fileupload: string): string;

Return a fully-qualified fileUpload resource name string.

Parameters
Name Description
account string
datasource string
fileupload string
Returns
Type Description
string

{string} Resource name string.

getFileUpload(request, options)

getFileUpload(request?: protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest, options?: CallOptions): Promise<[
        protos.google.shopping.merchant.datasources.v1beta.IFileUpload,
        (protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest | undefined),
        {} | undefined
    ]>;

Gets the latest data source file upload. Only the latest alias is accepted for a file upload.

Parameters
Name Description
request IGetFileUploadRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.shopping.merchant.datasources.v1beta.IFileUpload, (protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the data source file upload to retrieve.
   *  Format:
   *  `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
   */
  // const name = 'abc123'

  // Imports the Datasources library
  const {FileUploadsServiceClient} = require('@google-shopping/datasources').v1beta;

  // Instantiates a client
  const datasourcesClient = new FileUploadsServiceClient();

  async function callGetFileUpload() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await datasourcesClient.getFileUpload(request);
    console.log(response);
  }

  callGetFileUpload();

getFileUpload(request, options, callback)

getFileUpload(request: protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest, options: CallOptions, callback: Callback<protos.google.shopping.merchant.datasources.v1beta.IFileUpload, protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFileUploadRequest
options CallOptions
callback Callback<protos.google.shopping.merchant.datasources.v1beta.IFileUpload, protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getFileUpload(request, callback)

getFileUpload(request: protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest, callback: Callback<protos.google.shopping.merchant.datasources.v1beta.IFileUpload, protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFileUploadRequest
callback Callback<protos.google.shopping.merchant.datasources.v1beta.IFileUpload, protos.google.shopping.merchant.datasources.v1beta.IGetFileUploadRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
Type Description
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

matchAccountFromDataSourceName(dataSourceName)

matchAccountFromDataSourceName(dataSourceName: string): string | number;

Parse the account from DataSource resource.

Parameter
Name Description
dataSourceName string

A fully-qualified path representing DataSource resource.

Returns
Type Description
string | number

{string} A string representing the account.

matchAccountFromFileUploadName(fileUploadName)

matchAccountFromFileUploadName(fileUploadName: string): string | number;

Parse the account from FileUpload resource.

Parameter
Name Description
fileUploadName string

A fully-qualified path representing FileUpload resource.

Returns
Type Description
string | number

{string} A string representing the account.

matchDatasourceFromDataSourceName(dataSourceName)

matchDatasourceFromDataSourceName(dataSourceName: string): string | number;

Parse the datasource from DataSource resource.

Parameter
Name Description
dataSourceName string

A fully-qualified path representing DataSource resource.

Returns
Type Description
string | number

{string} A string representing the datasource.

matchDatasourceFromFileUploadName(fileUploadName)

matchDatasourceFromFileUploadName(fileUploadName: string): string | number;

Parse the datasource from FileUpload resource.

Parameter
Name Description
fileUploadName string

A fully-qualified path representing FileUpload resource.

Returns
Type Description
string | number

{string} A string representing the datasource.

matchFileuploadFromFileUploadName(fileUploadName)

matchFileuploadFromFileUploadName(fileUploadName: string): string | number;

Parse the fileupload from FileUpload resource.

Parameter
Name Description
fileUploadName string

A fully-qualified path representing FileUpload resource.

Returns
Type Description
string | number

{string} A string representing the fileupload.