Skip to content

Latest commit

 

History

History
451 lines (337 loc) · 29.1 KB

README.md

File metadata and controls

451 lines (337 loc) · 29.1 KB

Badge

(badge)

Overview

Any request that is related to steam badges, mostly badge search/tagging related.

Available Operations

getTags

Example Usage

import { SteamSets } from "@steamsets/client-ts";

const steamSets = new SteamSets({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await steamSets.badge.getTags();

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SteamSetsCore } from "@steamsets/client-ts/core.js";
import { badgeGetTags } from "@steamsets/client-ts/funcs/badgeGetTags.js";

// Use `SteamSetsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const steamSets = new SteamSetsCore({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await badgeGetTags(steamSets);

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.BadgeV1TagsResponse>

Errors

Error Type Status Code Content Type
errors.ErrorModel 403, 404 application/problem+json
errors.ErrorModel 500 application/problem+json
errors.SDKError 4XX, 5XX */*

search

Example Usage

import { SteamSets } from "@steamsets/client-ts";

const steamSets = new SteamSets({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await steamSets.badge.search({
    filter: "<value>",
    query: "<value>",
    sort: [
      "price:asc",
      "author:desc",
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SteamSetsCore } from "@steamsets/client-ts/core.js";
import { badgeSearch } from "@steamsets/client-ts/funcs/badgeSearch.js";

// Use `SteamSetsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const steamSets = new SteamSetsCore({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await badgeSearch(steamSets, {
    filter: "<value>",
    query: "<value>",
    sort: [
      "price:asc",
      "author:desc",
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request components.V1SearchRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.BadgeV1SearchResponse>

Errors

Error Type Status Code Content Type
errors.ErrorModel 403, 404, 422 application/problem+json
errors.ErrorModel 500 application/problem+json
errors.SDKError 4XX, 5XX */*

suggest

Example Usage

import { SteamSets } from "@steamsets/client-ts";

const steamSets = new SteamSets({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await steamSets.badge.suggest({
    query: "<value>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SteamSetsCore } from "@steamsets/client-ts/core.js";
import { badgeSuggest } from "@steamsets/client-ts/funcs/badgeSuggest.js";

// Use `SteamSetsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const steamSets = new SteamSetsCore({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await badgeSuggest(steamSets, {
    query: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request components.V1BadgeSearchSuggesttRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.BadgeV1SearchSuggestResponse>

Errors

Error Type Status Code Content Type
errors.ErrorModel 403, 404, 422 application/problem+json
errors.ErrorModel 500 application/problem+json
errors.SDKError 4XX, 5XX */*

suggestTags

Example Usage

import { SteamSets } from "@steamsets/client-ts";

const steamSets = new SteamSets({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await steamSets.badge.suggestTags({
    badgeId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SteamSetsCore } from "@steamsets/client-ts/core.js";
import { badgeSuggestTags } from "@steamsets/client-ts/funcs/badgeSuggestTags.js";

// Use `SteamSetsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const steamSets = new SteamSetsCore({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await badgeSuggestTags(steamSets, {
    badgeId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request components.V1BadgeTagsSuggestRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.BadgeV1TagsSuggestResponse>

Errors

Error Type Status Code Content Type
errors.ErrorModel 403, 404, 422 application/problem+json
errors.ErrorModel 500 application/problem+json
errors.SDKError 4XX, 5XX */*

tag

Example Usage

import { SteamSets } from "@steamsets/client-ts";

const steamSets = new SteamSets({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await steamSets.badge.tag({
    badgeId: "bdg_123",
    colors: [
      {
        id: "bdg_col_2r2pqaIpB1zllfZIvUE3OWadIOS",
        remove: true,
      },
      {
        id: "bdg_col_2r2pqaIpB1zllfZIvUE3OWadIOS",
        remove: true,
      },
      {
        id: "bdg_col_2r2pqaIpB1zllfZIvUE3OWadIOS",
        remove: true,
      },
    ],
    designs: [
      {
        id: "bdg_des_2r3yFWjSJzH89FKbYgpkJxF24ZL",
        name: "cat",
        remove: true,
      },
      {
        id: "bdg_des_2r3yFWjSJzH89FKbYgpkJxF24ZL",
        name: "cat",
        remove: true,
      },
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SteamSetsCore } from "@steamsets/client-ts/core.js";
import { badgeTag } from "@steamsets/client-ts/funcs/badgeTag.js";

// Use `SteamSetsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const steamSets = new SteamSetsCore({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await badgeTag(steamSets, {
    badgeId: "bdg_123",
    colors: [
      {
        id: "bdg_col_2r2pqaIpB1zllfZIvUE3OWadIOS",
        remove: true,
      },
      {
        id: "bdg_col_2r2pqaIpB1zllfZIvUE3OWadIOS",
        remove: true,
      },
      {
        id: "bdg_col_2r2pqaIpB1zllfZIvUE3OWadIOS",
        remove: true,
      },
    ],
    designs: [
      {
        id: "bdg_des_2r3yFWjSJzH89FKbYgpkJxF24ZL",
        name: "cat",
        remove: true,
      },
      {
        id: "bdg_des_2r3yFWjSJzH89FKbYgpkJxF24ZL",
        name: "cat",
        remove: true,
      },
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request components.V1BadgeTagRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.BadgeV1TagResponse>

Errors

Error Type Status Code Content Type
errors.ErrorModel 403, 404, 422 application/problem+json
errors.ErrorModel 500 application/problem+json
errors.SDKError 4XX, 5XX */*