Skip to content

Latest commit

 

History

History
executable file
·
154 lines (104 loc) · 7.02 KB

README.md

File metadata and controls

executable file
·
154 lines (104 loc) · 7.02 KB

Card

(card)

Available Operations

  • create - Create card
  • delete - Delete a card by cardId
  • get - Get card by cardId
  • update - Update card by cardId

create

Create card

Example Usage

import { Wingspan } from "wingspan";
import { CreateCardResponse } from "wingspan/dist/sdk/models/operations";

const sdk = new Wingspan();

sdk.card.create({
  requestPhysicalCard: "bluetooth",
  shippingAddress: {
    addressLine1: "innovative blue",
    addressLine2: "grey technology East",
    city: "West Astridcester",
    postalCode: "88558-7496",
    state: "Durham after",
  },
}).then((res: CreateCardResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
request shared.CardCreateRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.CreateCardResponse>

delete

Delete a card by cardId

Example Usage

import { Wingspan } from "wingspan";
import { DeleteCardRequest, DeleteCardResponse } from "wingspan/dist/sdk/models/operations";

const sdk = new Wingspan();
const id: string = "program";

sdk.card.delete(id).then((res: DeleteCardResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
id string ✔️ Unique identifier
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeleteCardResponse>

get

Get card by cardId

Example Usage

import { Wingspan } from "wingspan";
import { GetCardRequest, GetCardResponse } from "wingspan/dist/sdk/models/operations";

const sdk = new Wingspan();
const id: string = "female";

sdk.card.get(id).then((res: GetCardResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
id string ✔️ Unique identifier
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetCardResponse>

update

Update card by cardId

Example Usage

import { Wingspan } from "wingspan";
import { UpdateCardRequest, UpdateCardResponse } from "wingspan/dist/sdk/models/operations";
import { CardUpdateRequest, PropertiesCardUpdateRequest } from "wingspan/dist/sdk/models/shared";

const sdk = new Wingspan();
const id: string = "Van";
const cardUpdateRequest: CardUpdateRequest = {
  status: PropertiesCardUpdateRequest.Active,
};

sdk.card.update(id, cardUpdateRequest).then((res: UpdateCardResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
id string ✔️ Unique identifier
cardUpdateRequest shared.CardUpdateRequest N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpdateCardResponse>