当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript googleapis-common.createAPIRequest函数代码示例

本文整理汇总了TypeScript中googleapis-common.createAPIRequest函数的典型用法代码示例。如果您正苦于以下问题:TypeScript createAPIRequest函数的具体用法?TypeScript createAPIRequest怎么用?TypeScript createAPIRequest使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了createAPIRequest函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: get

    get(
      paramsOrCallback?:
        | Params$Resource$Purchases$Get
        | BodyResponseCallback<Schema$SubscriptionPurchase>,
      optionsOrCallback?:
        | MethodOptions
        | BodyResponseCallback<Schema$SubscriptionPurchase>,
      callback?: BodyResponseCallback<Schema$SubscriptionPurchase>
    ): void | GaxiosPromise<Schema$SubscriptionPurchase> {
      let params = (paramsOrCallback || {}) as Params$Resource$Purchases$Get;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Purchases$Get;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (
              rootUrl +
              '/androidpublisher/v1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}'
            ).replace(/([^:]\/)\/+/g, '$1'),
            method: 'GET',
          },
          options
        ),
        params,
        requiredParams: ['packageName', 'subscriptionId', 'token'],
        pathParams: ['packageName', 'subscriptionId', 'token'],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$SubscriptionPurchase>(parameters, callback);
      } else {
        return createAPIRequest<Schema$SubscriptionPurchase>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:v1.ts

示例2: createOffline

    createOffline(
      paramsOrCallback?:
        | Params$Resource$Projects$Profiles$Createoffline
        | BodyResponseCallback<Schema$Profile>,
      optionsOrCallback?: MethodOptions | BodyResponseCallback<Schema$Profile>,
      callback?: BodyResponseCallback<Schema$Profile>
    ): void | GaxiosPromise<Schema$Profile> {
      let params = (paramsOrCallback ||
        {}) as Params$Resource$Projects$Profiles$Createoffline;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Projects$Profiles$Createoffline;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl =
        options.rootUrl || 'https://cloudprofiler.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/v2/{+parent}/profiles:createOffline').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'POST',
          },
          options
        ),
        params,
        requiredParams: ['parent'],
        pathParams: ['parent'],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$Profile>(parameters, callback);
      } else {
        return createAPIRequest<Schema$Profile>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:v2.ts

示例3: synthesize

    synthesize(
      paramsOrCallback?:
        | Params$Resource$Text$Synthesize
        | BodyResponseCallback<Schema$SynthesizeSpeechResponse>,
      optionsOrCallback?:
        | MethodOptions
        | BodyResponseCallback<Schema$SynthesizeSpeechResponse>,
      callback?: BodyResponseCallback<Schema$SynthesizeSpeechResponse>
    ): void | GaxiosPromise<Schema$SynthesizeSpeechResponse> {
      let params = (paramsOrCallback || {}) as Params$Resource$Text$Synthesize;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Text$Synthesize;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl = options.rootUrl || 'https://texttospeech.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/v1/text:synthesize').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'POST',
          },
          options
        ),
        params,
        requiredParams: [],
        pathParams: [],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$SynthesizeSpeechResponse>(parameters, callback);
      } else {
        return createAPIRequest<Schema$SynthesizeSpeechResponse>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:v1.ts

示例4: get

    get(
      paramsOrCallback?:
        | Params$Resource$Userusagereport$Get
        | BodyResponseCallback<Schema$UsageReports>,
      optionsOrCallback?:
        | MethodOptions
        | BodyResponseCallback<Schema$UsageReports>,
      callback?: BodyResponseCallback<Schema$UsageReports>
    ): void | GaxiosPromise<Schema$UsageReports> {
      let params = (paramsOrCallback ||
        {}) as Params$Resource$Userusagereport$Get;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Userusagereport$Get;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (
              rootUrl + '/admin/reports/v1/usage/users/{userKey}/dates/{date}'
            ).replace(/([^:]\/)\/+/g, '$1'),
            method: 'GET',
          },
          options
        ),
        params,
        requiredParams: ['userKey', 'date'],
        pathParams: ['date', 'userKey'],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$UsageReports>(parameters, callback);
      } else {
        return createAPIRequest<Schema$UsageReports>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:reports_v1.ts

示例5: update

    update(
      paramsOrCallback?:
        | Params$Resource$Accounts$Products$Update
        | BodyResponseCallback<Schema$Empty>,
      optionsOrCallback?: MethodOptions | BodyResponseCallback<Schema$Empty>,
      callback?: BodyResponseCallback<Schema$Empty>
    ): void | GaxiosPromise<Schema$Empty> {
      let params = (paramsOrCallback ||
        {}) as Params$Resource$Accounts$Products$Update;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Accounts$Products$Update;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl =
        options.rootUrl || 'https://manufacturers.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/v1/{+parent}/products/{+name}').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'PUT',
          },
          options
        ),
        params,
        requiredParams: ['parent', 'name'],
        pathParams: ['name', 'parent'],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$Empty>(parameters, callback);
      } else {
        return createAPIRequest<Schema$Empty>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:v1.ts

示例6: list

    list(
      paramsOrCallback?:
        | Params$Resource$Groups$List
        | BodyResponseCallback<Schema$GroupListResponse>,
      optionsOrCallback?:
        | MethodOptions
        | BodyResponseCallback<Schema$GroupListResponse>,
      callback?: BodyResponseCallback<Schema$GroupListResponse>
    ): void | GaxiosPromise<Schema$GroupListResponse> {
      let params = (paramsOrCallback || {}) as Params$Resource$Groups$List;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Groups$List;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/youtube/analytics/v1beta1/groups').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'GET',
          },
          options
        ),
        params,
        requiredParams: [],
        pathParams: [],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$GroupListResponse>(parameters, callback);
      } else {
        return createAPIRequest<Schema$GroupListResponse>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:v1beta1.ts

示例7: uploadlineitems

    uploadlineitems(
      paramsOrCallback?:
        | Params$Resource$Lineitems$Uploadlineitems
        | BodyResponseCallback<Schema$UploadLineItemsResponse>,
      optionsOrCallback?:
        | MethodOptions
        | BodyResponseCallback<Schema$UploadLineItemsResponse>,
      callback?: BodyResponseCallback<Schema$UploadLineItemsResponse>
    ): void | GaxiosPromise<Schema$UploadLineItemsResponse> {
      let params = (paramsOrCallback ||
        {}) as Params$Resource$Lineitems$Uploadlineitems;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Lineitems$Uploadlineitems;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (
              rootUrl + '/doubleclickbidmanager/v1/lineitems/uploadlineitems'
            ).replace(/([^:]\/)\/+/g, '$1'),
            method: 'POST',
          },
          options
        ),
        params,
        requiredParams: [],
        pathParams: [],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$UploadLineItemsResponse>(parameters, callback);
      } else {
        return createAPIRequest<Schema$UploadLineItemsResponse>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:v1.ts

示例8: stop

    stop(
      paramsOrCallback?:
        | Params$Resource$Surveys$Stop
        | BodyResponseCallback<Schema$SurveysStopResponse>,
      optionsOrCallback?:
        | MethodOptions
        | BodyResponseCallback<Schema$SurveysStopResponse>,
      callback?: BodyResponseCallback<Schema$SurveysStopResponse>
    ): void | GaxiosPromise<Schema$SurveysStopResponse> {
      let params = (paramsOrCallback || {}) as Params$Resource$Surveys$Stop;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Surveys$Stop;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/surveys/v2/surveys/{resourceId}/stop').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'POST',
          },
          options
        ),
        params,
        requiredParams: ['resourceId'],
        pathParams: ['resourceId'],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$SurveysStopResponse>(parameters, callback);
      } else {
        return createAPIRequest<Schema$SurveysStopResponse>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:46,代码来源:v2.ts

示例9: setIamPolicy

    setIamPolicy(
      paramsOrCallback?:
        | Params$Resource$V1beta1$Setiampolicy
        | BodyResponseCallback<Schema$Policy>,
      optionsOrCallback?: MethodOptions | BodyResponseCallback<Schema$Policy>,
      callback?: BodyResponseCallback<Schema$Policy>
    ): void | GaxiosPromise<Schema$Policy> {
      let params = (paramsOrCallback ||
        {}) as Params$Resource$V1beta1$Setiampolicy;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$V1beta1$Setiampolicy;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl = options.rootUrl || 'https://iap.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/v1beta1/{+resource}:setIamPolicy').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'POST',
          },
          options
        ),
        params,
        requiredParams: ['resource'],
        pathParams: ['resource'],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$Policy>(parameters, callback);
      } else {
        return createAPIRequest<Schema$Policy>(parameters);
      }
    }
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:45,代码来源:v1beta1.ts


注:本文中的googleapis-common.createAPIRequest函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。