Skip to content

Latest commit

 

History

History
367 lines (264 loc) · 28 KB

README.md

File metadata and controls

367 lines (264 loc) · 28 KB

OzoneModeration

(ozoneModeration)

Overview

Available Operations

  • emitEvent - This endpoint is part of the Ozone moderation service APIs. Requests usually require authentication, are directed to the user's PDS intance, and proxied to the Ozone instance indicated by the DID in the service proxying header. Admin authenentication may also be possible, with request sent directly to the Ozone instance.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Take a moderation action on an actor.

  • getRecord - This endpoint is part of the Ozone moderation service APIs. Requests usually require authentication, are directed to the user's PDS intance, and proxied to the Ozone instance indicated by the DID in the service proxying header. Admin authenentication may also be possible, with request sent directly to the Ozone instance.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get details about a record.

  • get - This endpoint is part of the Ozone moderation service APIs. Requests usually require authentication, are directed to the user's PDS intance, and proxied to the Ozone instance indicated by the DID in the service proxying header. Admin authenentication may also be possible, with request sent directly to the Ozone instance.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get details about a repository.

emitEvent

This endpoint is part of the Ozone moderation service APIs. Requests usually require authentication, are directed to the user's PDS intance, and proxied to the Ozone instance indicated by the DID in the service proxying header. Admin authenentication may also be possible, with request sent directly to the Ozone instance.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Take a moderation action on an actor.

Example Usage

import { Bluesky } from "@speakeasy-api/bluesky";

const bluesky = new Bluesky({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const result = await bluesky.ozoneModeration.emitEvent({
    event: {},
    subject: {
      did: "<id>",
    },
    createdBy: "<id>",
  });

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

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-api/bluesky/core.js";
import { ozoneModerationEmitEvent } from "@speakeasy-api/bluesky/funcs/ozoneModerationEmitEvent.js";

// Use `BlueskyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const bluesky = new BlueskyCore({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const res = await ozoneModerationEmitEvent(bluesky, {
    event: {},
    subject: {
      did: "<id>",
    },
    createdBy: "<id>",
  });

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

  const { value: result } = res;

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

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Mutation hook for triggering the API call.
  useOzoneModerationEmitEventMutation
} from "@speakeasy-api/bluesky/react-query/ozoneModerationEmitEvent.js";

Parameters

Parameter Type Required Description
request operations.ToolsOzoneModerationEmitEventRequestBody ✔️ 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<components.ToolsOzoneModerationDefsModEventView>

Errors

Error Type Status Code Content Type
errors.ToolsOzoneModerationEmitEventResponseBody 400 application/json
errors.ToolsOzoneModerationEmitEventOzoneModerationResponseBody 401 application/json
errors.Unauthorized 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.BadRequest 413, 414, 415, 422, 431, 510 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

getRecord

This endpoint is part of the Ozone moderation service APIs. Requests usually require authentication, are directed to the user's PDS intance, and proxied to the Ozone instance indicated by the DID in the service proxying header. Admin authenentication may also be possible, with request sent directly to the Ozone instance.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get details about a record.

Example Usage

import { Bluesky } from "@speakeasy-api/bluesky";

const bluesky = new Bluesky({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const result = await bluesky.ozoneModeration.getRecord({
    uri: "https://dependent-fax.info",
  });

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

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-api/bluesky/core.js";
import { ozoneModerationGetRecord } from "@speakeasy-api/bluesky/funcs/ozoneModerationGetRecord.js";

// Use `BlueskyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const bluesky = new BlueskyCore({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const res = await ozoneModerationGetRecord(bluesky, {
    uri: "https://dependent-fax.info",
  });

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

  const { value: result } = res;

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

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Query hooks for fetching data.
  useOzoneModerationGetRecord,
  useOzoneModerationGetRecordSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchOzoneModerationGetRecord,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateOzoneModerationGetRecord,
  invalidateAllOzoneModerationGetRecord,
} from "@speakeasy-api/bluesky/react-query/ozoneModerationGetRecord.js";

Parameters

Parameter Type Required Description
request operations.ToolsOzoneModerationGetRecordRequest ✔️ 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<components.ToolsOzoneModerationDefsRecordViewDetail>

Errors

Error Type Status Code Content Type
errors.ToolsOzoneModerationGetRecordResponseBody 400 application/json
errors.ToolsOzoneModerationGetRecordOzoneModerationResponseBody 401 application/json
errors.Unauthorized 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.BadRequest 413, 414, 415, 422, 431, 510 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*

get

This endpoint is part of the Ozone moderation service APIs. Requests usually require authentication, are directed to the user's PDS intance, and proxied to the Ozone instance indicated by the DID in the service proxying header. Admin authenentication may also be possible, with request sent directly to the Ozone instance.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get details about a repository.

Example Usage

import { Bluesky } from "@speakeasy-api/bluesky";

const bluesky = new Bluesky({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const result = await bluesky.ozoneModeration.get({
    did: "<id>",
  });

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

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-api/bluesky/core.js";
import { ozoneModerationGet } from "@speakeasy-api/bluesky/funcs/ozoneModerationGet.js";

// Use `BlueskyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const bluesky = new BlueskyCore({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const res = await ozoneModerationGet(bluesky, {
    did: "<id>",
  });

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

  const { value: result } = res;

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

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Query hooks for fetching data.
  useOzoneModerationGet,
  useOzoneModerationGetSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchOzoneModerationGet,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateOzoneModerationGet,
  invalidateAllOzoneModerationGet,
} from "@speakeasy-api/bluesky/react-query/ozoneModerationGet.js";

Parameters

Parameter Type Required Description
request operations.ToolsOzoneModerationGetRepoRequest ✔️ 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<components.ToolsOzoneModerationDefsRepoViewDetail>

Errors

Error Type Status Code Content Type
errors.ToolsOzoneModerationGetRepoResponseBody 400 application/json
errors.ToolsOzoneModerationGetRepoOzoneModerationResponseBody 401 application/json
errors.Unauthorized 403, 407, 511 application/json
errors.NotFound 404, 501, 505 application/json
errors.Timeout 408, 504 application/json
errors.BadRequest 413, 414, 415, 422, 431, 510 application/json
errors.RateLimited 429 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.APIError 4XX, 5XX */*