/*
 * Selling Partner API for Notifications
 * The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more.  For more information, see the [Notifications Use Case Guide](doc:notifications-api-v1-use-case-guide).
 *
 * OpenAPI spec version: v1
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 *
 * Swagger Codegen version: 2.4.9
 *
 * Do not edit the class manually.
 *
 */

import { ApiClient } from "../ApiClient.js";
import { CreateDestinationRequest } from "../js-client.notifications.model/CreateDestinationRequest.js";
import { CreateDestinationResponse } from "../js-client.notifications.model/CreateDestinationResponse.js";
import { CreateSubscriptionRequest } from "../js-client.notifications.model/CreateSubscriptionRequest.js";
import { CreateSubscriptionResponse } from "../js-client.notifications.model/CreateSubscriptionResponse.js";
import { DeleteDestinationResponse } from "../js-client.notifications.model/DeleteDestinationResponse.js";
import { DeleteSubscriptionByIdResponse } from "../js-client.notifications.model/DeleteSubscriptionByIdResponse.js";
import { GetDestinationResponse } from "../js-client.notifications.model/GetDestinationResponse.js";
import { GetDestinationsResponse } from "../js-client.notifications.model/GetDestinationsResponse.js";
import { GetSubscriptionByIdResponse } from "../js-client.notifications.model/GetSubscriptionByIdResponse.js";
import { GetSubscriptionResponse } from "../js-client.notifications.model/GetSubscriptionResponse.js";
import { HEADER_DATA } from "../../constants/global";

/**
 * Notifications service.
 * @module notifications/js-client.notifications.api/NotificationsApi
 * @version v1
 */
export class NotificationsApi {
  /**
   * Constructs a new NotificationsApi.
   * @alias module:notifications/js-client.notifications.api/NotificationsApi
   * @class
   * @param {module:notifications/ApiClient} [apiClient] Optional API client implementation to use,
   * default to {@link module:notifications/ApiClient#instance} if unspecified.
   */
  constructor(apiClient) {
    this.apiClient = apiClient || ApiClient.instance;
  }

  /**
   * Creates a destination resource to receive notifications. The createDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {module:notifications/js-client.notifications.model/CreateDestinationRequest} body
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/CreateDestinationResponse} and HTTP response
   */
  createDestinationWithHttpInfo(body) {
    let postBody = body;

    // verify the required parameter 'body' is set
    if (body === undefined || body === null) {
      throw new Error(
        "Missing the required parameter 'body' when calling createDestination",
      );
    }

    let pathParams = {};
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = CreateDestinationResponse;

    return this.apiClient.callApi(
      "/notifications/v1/destinations",
      "POST",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Creates a destination resource to receive notifications. The createDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {module:notifications/js-client.notifications.model/CreateDestinationRequest} body
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/CreateDestinationResponse}
   */
  createDestination(body) {
    return this.createDestinationWithHttpInfo(body).then(
      function (response_and_data) {
        return response_and_data.data;
      },
    );
  }

  /**
   * Creates a subscription for the specified notification type to be delivered to the specified destination. Before you can subscribe, you must first create the destination by calling the createDestination operation.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {module:notifications/js-client.notifications.model/CreateSubscriptionRequest} body
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/CreateSubscriptionResponse} and HTTP response
   */
  createSubscriptionWithHttpInfo(body, notificationType) {
    let postBody = body;

    // verify the required parameter 'body' is set
    if (body === undefined || body === null) {
      throw new Error(
        "Missing the required parameter 'body' when calling createSubscription",
      );
    }

    // verify the required parameter 'notificationType' is set
    if (notificationType === undefined || notificationType === null) {
      throw new Error(
        "Missing the required parameter 'notificationType' when calling createSubscription",
      );
    }

    let pathParams = {
      notificationType: notificationType,
    };
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = CreateSubscriptionResponse;

    return this.apiClient.callApi(
      "/notifications/v1/subscriptions/{notificationType}",
      "POST",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Creates a subscription for the specified notification type to be delivered to the specified destination. Before you can subscribe, you must first create the destination by calling the createDestination operation.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {module:notifications/js-client.notifications.model/CreateSubscriptionRequest} body
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/CreateSubscriptionResponse}
   */
  createSubscription(body, notificationType) {
    return this.createSubscriptionWithHttpInfo(body, notificationType).then(
      function (response_and_data) {
        return response_and_data.data;
      },
    );
  }

  /**
   * Deletes the destination that you specify. The deleteDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} destinationId The identifier for the destination that you want to delete.
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/DeleteDestinationResponse} and HTTP response
   */
  deleteDestinationWithHttpInfo(destinationId) {
    let postBody = null;

    // verify the required parameter 'destinationId' is set
    if (destinationId === undefined || destinationId === null) {
      throw new Error(
        "Missing the required parameter 'destinationId' when calling deleteDestination",
      );
    }

    let pathParams = {
      destinationId: destinationId,
    };
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = DeleteDestinationResponse;

    return this.apiClient.callApi(
      "/notifications/v1/destinations/{destinationId}",
      "DELETE",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Deletes the destination that you specify. The deleteDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} destinationId The identifier for the destination that you want to delete.
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/DeleteDestinationResponse}
   */
  deleteDestination(destinationId) {
    return this.deleteDestinationWithHttpInfo(destinationId).then(
      function (response_and_data) {
        return response_and_data.data;
      },
    );
  }

  /**
   * Deletes the subscription indicated by the subscription identifier and notification type that you specify. The subscription identifier can be for any subscription associated with your application. After you successfully call this operation, notifications will stop being sent for the associated subscription. The deleteSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} subscriptionId The identifier for the subscription that you want to delete.
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/DeleteSubscriptionByIdResponse} and HTTP response
   */
  deleteSubscriptionByIdWithHttpInfo(subscriptionId, notificationType) {
    let postBody = null;

    // verify the required parameter 'subscriptionId' is set
    if (subscriptionId === undefined || subscriptionId === null) {
      throw new Error(
        "Missing the required parameter 'subscriptionId' when calling deleteSubscriptionById",
      );
    }

    // verify the required parameter 'notificationType' is set
    if (notificationType === undefined || notificationType === null) {
      throw new Error(
        "Missing the required parameter 'notificationType' when calling deleteSubscriptionById",
      );
    }

    let pathParams = {
      subscriptionId: subscriptionId,
      notificationType: notificationType,
    };
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = DeleteSubscriptionByIdResponse;

    return this.apiClient.callApi(
      "/notifications/v1/subscriptions/{notificationType}/{subscriptionId}",
      "DELETE",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Deletes the subscription indicated by the subscription identifier and notification type that you specify. The subscription identifier can be for any subscription associated with your application. After you successfully call this operation, notifications will stop being sent for the associated subscription. The deleteSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} subscriptionId The identifier for the subscription that you want to delete.
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/DeleteSubscriptionByIdResponse}
   */
  deleteSubscriptionById(subscriptionId, notificationType) {
    return this.deleteSubscriptionByIdWithHttpInfo(
      subscriptionId,
      notificationType,
    ).then(function (response_and_data) {
      return response_and_data.data;
    });
  }

  /**
   * Returns information about the destination that you specify. The getDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} destinationId The identifier generated when you created the destination.
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/GetDestinationResponse} and HTTP response
   */
  getDestinationWithHttpInfo(destinationId) {
    let postBody = null;

    // verify the required parameter 'destinationId' is set
    if (destinationId === undefined || destinationId === null) {
      throw new Error(
        "Missing the required parameter 'destinationId' when calling getDestination",
      );
    }

    let pathParams = {
      destinationId: destinationId,
    };
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = GetDestinationResponse;

    return this.apiClient.callApi(
      "/notifications/v1/destinations/{destinationId}",
      "GET",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Returns information about the destination that you specify. The getDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} destinationId The identifier generated when you created the destination.
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/GetDestinationResponse}
   */
  getDestination(destinationId) {
    return this.getDestinationWithHttpInfo(destinationId).then(
      function (response_and_data) {
        return response_and_data.data;
      },
    );
  }

  /**
   * Returns information about all destinations. The getDestinations API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/GetDestinationsResponse} and HTTP response
   */
  getDestinationsWithHttpInfo() {
    let postBody = null;

    let pathParams = {};
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = GetDestinationsResponse;

    return this.apiClient.callApi(
      "/notifications/v1/destinations",
      "GET",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Returns information about all destinations. The getDestinations API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/GetDestinationsResponse}
   */
  getDestinations() {
    return this.getDestinationsWithHttpInfo().then(
      function (response_and_data) {
        return response_and_data.data;
      },
    );
  }

  /**
   * Returns information about subscriptions of the specified notification type. You can use this API to get subscription information when you do not have a subscription identifier.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/GetSubscriptionResponse} and HTTP response
   */
  getSubscriptionWithHttpInfo(notificationType) {
    let postBody = null;

    // verify the required parameter 'notificationType' is set
    if (notificationType === undefined || notificationType === null) {
      throw new Error(
        "Missing the required parameter 'notificationType' when calling getSubscription",
      );
    }

    let pathParams = {
      notificationType: notificationType,
    };
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = GetSubscriptionResponse;

    return this.apiClient.callApi(
      "/notifications/v1/subscriptions/{notificationType}",
      "GET",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Returns information about subscriptions of the specified notification type. You can use this API to get subscription information when you do not have a subscription identifier.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/GetSubscriptionResponse}
   */
  getSubscription(notificationType) {
    return this.getSubscriptionWithHttpInfo(notificationType).then(
      function (response_and_data) {
        return response_and_data.data;
      },
    );
  }

  /**
   * Returns information about a subscription for the specified notification type. The getSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} subscriptionId The identifier for the subscription that you want to get.
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:notifications/js-client.notifications.model/GetSubscriptionByIdResponse} and HTTP response
   */
  getSubscriptionByIdWithHttpInfo(subscriptionId, notificationType) {
    let postBody = null;

    // verify the required parameter 'subscriptionId' is set
    if (subscriptionId === undefined || subscriptionId === null) {
      throw new Error(
        "Missing the required parameter 'subscriptionId' when calling getSubscriptionById",
      );
    }

    // verify the required parameter 'notificationType' is set
    if (notificationType === undefined || notificationType === null) {
      throw new Error(
        "Missing the required parameter 'notificationType' when calling getSubscriptionById",
      );
    }

    let pathParams = {
      subscriptionId: subscriptionId,
      notificationType: notificationType,
    };
    let queryParams = {};
    let headerParams = HEADER_DATA;
    let formParams = {};

    let contentTypes = ["application/json"];
    let accepts = ["application/json"];
    let returnType = GetSubscriptionByIdResponse;

    return this.apiClient.callApi(
      "/notifications/v1/subscriptions/{notificationType}/{subscriptionId}",
      "GET",
      pathParams,
      queryParams,
      headerParams,
      formParams,
      postBody,
      contentTypes,
      accepts,
      returnType,
    );
  }

  /**
   * Returns information about a subscription for the specified notification type. The getSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide.  **Usage Plan:**  | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 |  The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
   * @param {String} subscriptionId The identifier for the subscription that you want to get.
   * @param {String} notificationType The type of notification.   For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:notifications/js-client.notifications.model/GetSubscriptionByIdResponse}
   */
  getSubscriptionById(subscriptionId, notificationType) {
    return this.getSubscriptionByIdWithHttpInfo(
      subscriptionId,
      notificationType,
    ).then(function (response_and_data) {
      return response_and_data.data;
    });
  }
}
