diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsCreate.g.cs index e91d4e7..b642b18 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsCreate.g.cs @@ -59,12 +59,10 @@ partial void ProcessActionsCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.actions.create({
- /// body: {
- /// key: "suspend-24h",
- /// name: "Suspend for 24 hours",
- /// type: "AUTHOR_BLOCK_TEMP",
- /// queueBehaviour: "REMOVE",
- /// },
+ /// key: "suspend-24h",
+ /// name: "Suspend for 24 hours",
+ /// type: "AUTHOR_BLOCK_TEMP",
+ /// queueBehaviour: "REMOVE",
/// });
/// console.log(result);
/// }
@@ -103,12 +101,10 @@ partial void ProcessActionsCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.actions.create({
- /// body: {
- /// key: "suspend-24h",
- /// name: "Suspend for 24 hours",
- /// type: "AUTHOR_BLOCK_TEMP",
- /// queueBehaviour: "REMOVE",
- /// },
+ /// key: "suspend-24h",
+ /// name: "Suspend for 24 hours",
+ /// type: "AUTHOR_BLOCK_TEMP",
+ /// queueBehaviour: "REMOVE",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsDelete.g.cs index 8f77868..3f1aa57 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsDelete.g.cs @@ -60,9 +60,7 @@ partial void ProcessActionsDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessActionsDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsExecute.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsExecute.g.cs index bec3412..fbfd0ef 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsExecute.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsExecute.g.cs @@ -59,12 +59,10 @@ partial void ProcessActionsExecuteResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.actions.execute({
- /// body: {
- /// actionKey: "suspend-24h",
- /// authorIds: [
- /// "user-1092",
- /// ],
- /// },
+ /// actionKey: "suspend-24h",
+ /// authorIds: [
+ /// "user-1092",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -103,12 +101,10 @@ partial void ProcessActionsExecuteResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.actions.execute({
- /// body: {
- /// actionKey: "suspend-24h",
- /// authorIds: [
- /// "user-1092",
- /// ],
- /// },
+ /// actionKey: "suspend-24h",
+ /// authorIds: [
+ /// "user-1092",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -655,6 +651,12 @@ partial void ProcessActionsExecuteResponseContent( /// /// Optional duration in milliseconds for actions with timeouts /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -666,6 +668,8 @@ partial void ProcessActionsExecuteResponseContent( string? value = default, string? queueId = default, double? duration = default, + string? moderator = default, + bool? createCasebookCase = default, global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -677,6 +681,8 @@ partial void ProcessActionsExecuteResponseContent( Value = value, QueueId = queueId, Duration = duration, + Moderator = moderator, + CreateCasebookCase = createCasebookCase, }; return await ActionsExecuteAsync( diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsGet.g.cs index f307f6e..c8b5d05 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsGet.g.cs @@ -60,9 +60,7 @@ partial void ProcessActionsGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessActionsGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsList.g.cs index c62d369..bdf083e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsList.g.cs @@ -70,7 +70,7 @@ partial void ProcessActionsListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.list({});
+ /// const result = await moderationApi.actions.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -119,7 +119,7 @@ partial void ProcessActionsListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.list({});
+ /// const result = await moderationApi.actions.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsUpdate.g.cs index 520f2df..ee07656 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ActionsClient.ActionsUpdate.g.cs @@ -63,10 +63,7 @@ partial void ProcessActionsUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.actions.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -108,10 +105,7 @@ partial void ProcessActionsUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.actions.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Authors.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Authors.g.cs index 2a18cf5..7365d6e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Authors.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Authors.g.cs @@ -72,7 +72,7 @@ partial void ProcessAuthorsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.authors({});
+ /// const result = await moderationApi.analytics.authors();
/// console.log(result);
/// }
/// run(); @@ -121,7 +121,7 @@ partial void ProcessAuthorsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.authors({});
+ /// const result = await moderationApi.analytics.authors();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Automation.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Automation.g.cs index d58676b..a34c787 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Automation.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Automation.g.cs @@ -66,7 +66,7 @@ partial void ProcessAutomationResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.automation({});
+ /// const result = await moderationApi.analytics.automation();
/// console.log(result);
/// }
/// run(); @@ -109,7 +109,7 @@ partial void ProcessAutomationResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.automation({});
+ /// const result = await moderationApi.analytics.automation();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Channels.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Channels.g.cs index d6a0015..840de4c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Channels.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Channels.g.cs @@ -61,7 +61,7 @@ partial void ProcessChannelsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.channels({});
+ /// const result = await moderationApi.analytics.channels();
/// console.log(result);
/// }
/// run(); @@ -99,7 +99,7 @@ partial void ProcessChannelsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.channels({});
+ /// const result = await moderationApi.analytics.channels();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Policies.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Policies.g.cs index ef1a655..5857f39 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Policies.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Policies.g.cs @@ -72,7 +72,7 @@ partial void ProcessPoliciesResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.policies({});
+ /// const result = await moderationApi.analytics.policies();
/// console.log(result);
/// }
/// run(); @@ -121,7 +121,7 @@ partial void ProcessPoliciesResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.policies({});
+ /// const result = await moderationApi.analytics.policies();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Summary.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Summary.g.cs index 9512cba..acd634b 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Summary.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Summary.g.cs @@ -66,7 +66,7 @@ partial void ProcessSummaryResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.summary({});
+ /// const result = await moderationApi.analytics.summary();
/// console.log(result);
/// }
/// run(); @@ -109,7 +109,7 @@ partial void ProcessSummaryResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.summary({});
+ /// const result = await moderationApi.analytics.summary();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Volumes.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Volumes.g.cs index f6e3038..f2db72c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Volumes.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnalyticsClient.Volumes.g.cs @@ -66,7 +66,7 @@ partial void ProcessVolumesResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.volumes({});
+ /// const result = await moderationApi.analytics.volumes();
/// console.log(result);
/// }
/// run(); @@ -109,7 +109,7 @@ partial void ProcessVolumesResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.volumes({});
+ /// const result = await moderationApi.analytics.volumes();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs index 715c6ed..f4c8a76 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs @@ -60,9 +60,7 @@ partial void ProcessAuthorDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessAuthorDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenCreate.g.cs index 445bd55..edf3fab 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenCreate.g.cs @@ -59,15 +59,13 @@ partial void ProcessAuthorOpenCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.authors.create({
- /// body: {
- /// name: "Jamie Rivera",
- /// email: "jamie@example.com",
- /// metadata: {
- /// emailVerified: true,
- /// isPayingCustomer: false,
- /// },
- /// externalId: "user-1092",
+ /// name: "Jamie Rivera",
+ /// email: "jamie@example.com",
+ /// metadata: {
+ /// emailVerified: true,
+ /// isPayingCustomer: false,
/// },
+ /// externalId: "user-1092",
/// });
/// console.log(result);
/// }
@@ -106,15 +104,13 @@ partial void ProcessAuthorOpenCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.authors.create({
- /// body: {
- /// name: "Jamie Rivera",
- /// email: "jamie@example.com",
- /// metadata: {
- /// emailVerified: true,
- /// isPayingCustomer: false,
- /// },
- /// externalId: "user-1092",
+ /// name: "Jamie Rivera",
+ /// email: "jamie@example.com",
+ /// metadata: {
+ /// emailVerified: true,
+ /// isPayingCustomer: false,
/// },
+ /// externalId: "user-1092",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenGetAuthorDetails.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenGetAuthorDetails.g.cs index b06cca6..783ce59 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenGetAuthorDetails.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenGetAuthorDetails.g.cs @@ -60,9 +60,7 @@ partial void ProcessAuthorOpenGetAuthorDetailsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessAuthorOpenGetAuthorDetailsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenUpdate.g.cs index 36b01c8..78ff9a6 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorOpenUpdate.g.cs @@ -63,14 +63,11 @@ partial void ProcessAuthorOpenUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.update({
- /// id: "<id>",
- /// body: {
- /// metadata: {
- /// identityVerified: true,
- /// },
- /// manualTrustLevel: 2,
+ /// const result = await moderationApi.authors.update("<id>", {
+ /// metadata: {
+ /// identityVerified: true,
/// },
+ /// manualTrustLevel: 2,
/// });
/// console.log(result);
/// }
@@ -113,14 +110,11 @@ partial void ProcessAuthorOpenUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.update({
- /// id: "<id>",
- /// body: {
- /// metadata: {
- /// identityVerified: true,
- /// },
- /// manualTrustLevel: 2,
+ /// const result = await moderationApi.authors.update("<id>", {
+ /// metadata: {
+ /// identityVerified: true,
/// },
+ /// manualTrustLevel: 2,
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..6c58cb7 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class AuthorsClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::ModerationAPI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Block.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Block.g.cs new file mode 100644 index 0000000..1162085 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Block.g.cs @@ -0,0 +1,668 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class AuthorsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_BlockSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_BlockSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_BlockSecurityRequirement0, + }; + partial void PrepareBlockArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref string? projectId, + global::ModerationAPI.BlockAuthorRequest request); + partial void PrepareBlockRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + string? projectId, + global::ModerationAPI.BlockAuthorRequest request); + partial void ProcessBlockResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessBlockResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Block author
+ /// Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.block("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task BlockAsync( + string id, + + global::ModerationAPI.BlockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BlockAsResponseAsync( + id: id, + + request: request, + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Block author
+ /// Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.block("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task> BlockAsResponseAsync( + string id, + + global::ModerationAPI.BlockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareBlockArguments( + httpClient: HttpClient, + id: ref id, + projectId: ref projectId, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BlockSecurityRequirements, + operationName: "BlockAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/authors/{id}/block", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (projectId != default) + { + __httpRequest.Headers.TryAddWithoutValidation("projectId", projectId.ToString()); + } + + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBlockRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + projectId: projectId, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Block", + methodName: "BlockAsync", + pathTemplate: "$\"/authors/{id}/block\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Block", + methodName: "BlockAsync", + pathTemplate: "$\"/authors/{id}/block\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Block", + methodName: "BlockAsync", + pathTemplate: "$\"/authors/{id}/block\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessBlockResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Block", + methodName: "BlockAsync", + pathTemplate: "$\"/authors/{id}/block\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Block", + methodName: "BlockAsync", + pathTemplate: "$\"/authors/{id}/block\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.BadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.AuthenticationError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.NotFoundError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. Retry after the number of seconds in the `Retry-After` header. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::ModerationAPI.RateLimitError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessBlockResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.BlockAuthorResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.BlockAuthorResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Block author
+ /// Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BlockAsync( + string id, + string? projectId = default, + string? reason = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.BlockAuthorRequest + { + Reason = reason, + }; + + return await BlockAsync( + id: id, + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Constructors.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..9e14356 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class AuthorsClient + { + /// + + public AuthorsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Suspend.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Suspend.g.cs new file mode 100644 index 0000000..50ad40a --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Suspend.g.cs @@ -0,0 +1,679 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class AuthorsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_SuspendSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_SuspendSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_SuspendSecurityRequirement0, + }; + partial void PrepareSuspendArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref string? projectId, + global::ModerationAPI.SuspendAuthorRequest request); + partial void PrepareSuspendRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + string? projectId, + global::ModerationAPI.SuspendAuthorRequest request); + partial void ProcessSuspendResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSuspendResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Suspend author
+ /// Block an author for a limited time with the built-in suspend action. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.suspend("<id>", {
+ /// reason: "Violation of community guidelines",
+ /// duration: 604800000,
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task SuspendAsync( + string id, + + global::ModerationAPI.SuspendAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SuspendAsResponseAsync( + id: id, + + request: request, + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Suspend author
+ /// Block an author for a limited time with the built-in suspend action. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.suspend("<id>", {
+ /// reason: "Violation of community guidelines",
+ /// duration: 604800000,
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task> SuspendAsResponseAsync( + string id, + + global::ModerationAPI.SuspendAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareSuspendArguments( + httpClient: HttpClient, + id: ref id, + projectId: ref projectId, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SuspendSecurityRequirements, + operationName: "SuspendAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/authors/{id}/suspend", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (projectId != default) + { + __httpRequest.Headers.TryAddWithoutValidation("projectId", projectId.ToString()); + } + + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSuspendRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + projectId: projectId, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Suspend", + methodName: "SuspendAsync", + pathTemplate: "$\"/authors/{id}/suspend\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Suspend", + methodName: "SuspendAsync", + pathTemplate: "$\"/authors/{id}/suspend\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Suspend", + methodName: "SuspendAsync", + pathTemplate: "$\"/authors/{id}/suspend\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessSuspendResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Suspend", + methodName: "SuspendAsync", + pathTemplate: "$\"/authors/{id}/suspend\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Suspend", + methodName: "SuspendAsync", + pathTemplate: "$\"/authors/{id}/suspend\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.BadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.AuthenticationError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.NotFoundError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. Retry after the number of seconds in the `Retry-After` header. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::ModerationAPI.RateLimitError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessSuspendResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.SuspendAuthorResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.SuspendAuthorResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Suspend author
+ /// Block an author for a limited time with the built-in suspend action. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// How long the suspension lasts, in milliseconds. Defaults to 24 hours. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task SuspendAsync( + string id, + string? projectId = default, + string? reason = default, + double? duration = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.SuspendAuthorRequest + { + Reason = reason, + Duration = duration, + }; + + return await SuspendAsync( + id: id, + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Unblock.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Unblock.g.cs new file mode 100644 index 0000000..c0a6631 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.Unblock.g.cs @@ -0,0 +1,668 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class AuthorsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_UnblockSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_UnblockSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_UnblockSecurityRequirement0, + }; + partial void PrepareUnblockArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref string? projectId, + global::ModerationAPI.UnblockAuthorRequest request); + partial void PrepareUnblockRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + string? projectId, + global::ModerationAPI.UnblockAuthorRequest request); + partial void ProcessUnblockResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUnblockResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Unblock author
+ /// Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.unblock("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task UnblockAsync( + string id, + + global::ModerationAPI.UnblockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UnblockAsResponseAsync( + id: id, + + request: request, + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Unblock author
+ /// Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.unblock("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task> UnblockAsResponseAsync( + string id, + + global::ModerationAPI.UnblockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUnblockArguments( + httpClient: HttpClient, + id: ref id, + projectId: ref projectId, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UnblockSecurityRequirements, + operationName: "UnblockAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/authors/{id}/unblock", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (projectId != default) + { + __httpRequest.Headers.TryAddWithoutValidation("projectId", projectId.ToString()); + } + + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUnblockRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + projectId: projectId, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Unblock", + methodName: "UnblockAsync", + pathTemplate: "$\"/authors/{id}/unblock\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Unblock", + methodName: "UnblockAsync", + pathTemplate: "$\"/authors/{id}/unblock\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Unblock", + methodName: "UnblockAsync", + pathTemplate: "$\"/authors/{id}/unblock\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUnblockResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Unblock", + methodName: "UnblockAsync", + pathTemplate: "$\"/authors/{id}/unblock\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Unblock", + methodName: "UnblockAsync", + pathTemplate: "$\"/authors/{id}/unblock\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.BadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.AuthenticationError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.NotFoundError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. Retry after the number of seconds in the `Retry-After` header. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::ModerationAPI.RateLimitError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUnblockResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.UnblockAuthorResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.UnblockAuthorResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Unblock author
+ /// Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UnblockAsync( + string id, + string? projectId = default, + string? reason = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.UnblockAuthorRequest + { + Reason = reason, + }; + + return await UnblockAsync( + id: id, + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.g.cs new file mode 100644 index 0000000..c7d2621 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorsClient.g.cs @@ -0,0 +1,143 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AuthorsClient : global::ModerationAPI.IAuthorsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.moderationapi.com/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::ModerationAPI.SourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the AuthorsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthorsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AuthorsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthorsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AuthorsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthorsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::ModerationAPI.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsCreate.g.cs index 40ef7db..65a5040 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsCreate.g.cs @@ -60,11 +60,8 @@ partial void ProcessManagementChannelsCreateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.create({
- /// projectId: "<id>",
- /// body: {
- /// name: "<value>",
- /// },
+ /// const result = await moderationApi.channels.create("<id>", {
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
@@ -104,11 +101,8 @@ partial void ProcessManagementChannelsCreateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.create({
- /// projectId: "<id>",
- /// body: {
- /// name: "<value>",
- /// },
+ /// const result = await moderationApi.channels.create("<id>", {
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDelete.g.cs index 013cb58..84b13ff 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDelete.g.cs @@ -57,9 +57,7 @@ partial void ProcessManagementChannelsDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -93,9 +91,7 @@ partial void ProcessManagementChannelsDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDuplicate.g.cs index 144f920..b3f9709 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDuplicate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDuplicate.g.cs @@ -60,10 +60,7 @@ partial void ProcessManagementChannelsDuplicateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -102,10 +99,7 @@ partial void ProcessManagementChannelsDuplicateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsGet.g.cs index 7bbec05..4edd974 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsGet.g.cs @@ -57,9 +57,7 @@ partial void ProcessManagementChannelsGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -93,9 +91,7 @@ partial void ProcessManagementChannelsGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsList.g.cs index 09f2d0b..2dd8403 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsList.g.cs @@ -69,9 +69,7 @@ partial void ProcessManagementChannelsListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.list({
- /// projectId: "<id>",
- /// });
+ /// const result = await moderationApi.channels.list("<id>");
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -119,9 +117,7 @@ partial void ProcessManagementChannelsListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.list({
- /// projectId: "<id>",
- /// });
+ /// const result = await moderationApi.channels.list("<id>");
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsUpdate.g.cs index 7fb6bec..73a9d34 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsUpdate.g.cs @@ -60,10 +60,7 @@ partial void ProcessManagementChannelsUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -102,10 +99,7 @@ partial void ProcessManagementChannelsUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Allow.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Allow.g.cs new file mode 100644 index 0000000..d8bb774 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Allow.g.cs @@ -0,0 +1,683 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ContentClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_AllowSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_AllowSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_AllowSecurityRequirement0, + }; + partial void PrepareAllowArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref string? projectId, + global::ModerationAPI.AllowContentRequest request); + partial void PrepareAllowRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + string? projectId, + global::ModerationAPI.AllowContentRequest request); + partial void ProcessAllowResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAllowResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Allow content
+ /// Allow a content item with the built-in allow action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.allow("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task AllowAsync( + string id, + + global::ModerationAPI.AllowContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AllowAsResponseAsync( + id: id, + + request: request, + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Allow content
+ /// Allow a content item with the built-in allow action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.allow("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task> AllowAsResponseAsync( + string id, + + global::ModerationAPI.AllowContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAllowArguments( + httpClient: HttpClient, + id: ref id, + projectId: ref projectId, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AllowSecurityRequirements, + operationName: "AllowAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/content/{id}/allow", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (projectId != default) + { + __httpRequest.Headers.TryAddWithoutValidation("projectId", projectId.ToString()); + } + + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAllowRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + projectId: projectId, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Allow", + methodName: "AllowAsync", + pathTemplate: "$\"/content/{id}/allow\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Allow", + methodName: "AllowAsync", + pathTemplate: "$\"/content/{id}/allow\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Allow", + methodName: "AllowAsync", + pathTemplate: "$\"/content/{id}/allow\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAllowResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Allow", + methodName: "AllowAsync", + pathTemplate: "$\"/content/{id}/allow\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Allow", + methodName: "AllowAsync", + pathTemplate: "$\"/content/{id}/allow\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.BadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.AuthenticationError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.NotFoundError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. Retry after the number of seconds in the `Retry-After` header. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::ModerationAPI.RateLimitError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAllowResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.AllowContentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.AllowContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Allow content
+ /// Allow a content item with the built-in allow action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AllowAsync( + string id, + string? projectId = default, + string? reason = default, + string? queueId = default, + string? moderator = default, + bool? createCasebookCase = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.AllowContentRequest + { + Reason = reason, + QueueId = queueId, + Moderator = moderator, + CreateCasebookCase = createCasebookCase, + }; + + return await AllowAsync( + id: id, + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..574c1cd --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class ContentClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::ModerationAPI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Constructors.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..29e895f --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class ContentClient + { + /// + + public ContentClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Reject.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Reject.g.cs new file mode 100644 index 0000000..e35399c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.Reject.g.cs @@ -0,0 +1,687 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ContentClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_RejectSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_RejectSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_RejectSecurityRequirement0, + }; + partial void PrepareRejectArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref string? projectId, + global::ModerationAPI.RejectContentRequest request); + partial void PrepareRejectRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + string? projectId, + global::ModerationAPI.RejectContentRequest request); + partial void ProcessRejectResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRejectResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Reject content
+ /// Reject a content item with the built-in reject action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.reject("<id>", {
+ /// reason: "Spam",
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task RejectAsync( + string id, + + global::ModerationAPI.RejectContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RejectAsResponseAsync( + id: id, + + request: request, + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reject content
+ /// Reject a content item with the built-in reject action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.reject("<id>", {
+ /// reason: "Spam",
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ public async global::System.Threading.Tasks.Task> RejectAsResponseAsync( + string id, + + global::ModerationAPI.RejectContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRejectArguments( + httpClient: HttpClient, + id: ref id, + projectId: ref projectId, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RejectSecurityRequirements, + operationName: "RejectAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/content/{id}/reject", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (projectId != default) + { + __httpRequest.Headers.TryAddWithoutValidation("projectId", projectId.ToString()); + } + + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRejectRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + projectId: projectId, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Reject", + methodName: "RejectAsync", + pathTemplate: "$\"/content/{id}/reject\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Reject", + methodName: "RejectAsync", + pathTemplate: "$\"/content/{id}/reject\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Reject", + methodName: "RejectAsync", + pathTemplate: "$\"/content/{id}/reject\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessRejectResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Reject", + methodName: "RejectAsync", + pathTemplate: "$\"/content/{id}/reject\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Reject", + methodName: "RejectAsync", + pathTemplate: "$\"/content/{id}/reject\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.BadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.BadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.AuthenticationError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.AuthenticationError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.NotFoundError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.NotFoundError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. Retry after the number of seconds in the `Retry-After` header. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::ModerationAPI.RateLimitError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::ModerationAPI.RateLimitError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessRejectResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.RejectContentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.RejectContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reject content
+ /// Reject a content item with the built-in reject action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RejectAsync( + string id, + string? projectId = default, + string? reason = default, + string? queueId = default, + string? moderator = default, + bool? createCasebookCase = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.RejectContentRequest + { + Reason = reason, + QueueId = queueId, + Moderator = moderator, + CreateCasebookCase = createCasebookCase, + }; + + return await RejectAsync( + id: id, + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.g.cs new file mode 100644 index 0000000..11165c1 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ContentClient.g.cs @@ -0,0 +1,143 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ContentClient : global::ModerationAPI.IContentClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.moderationapi.com/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::ModerationAPI.SourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the ContentClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ContentClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ContentClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ContentClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ContentClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ContentClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::ModerationAPI.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.FeedbackClient.Create.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.FeedbackClient.Create.g.cs index d97f164..4b30789 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.FeedbackClient.Create.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.FeedbackClient.Create.g.cs @@ -59,11 +59,9 @@ partial void ProcessCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.feedback.create({
- /// body: {
- /// title: "Filter queue items by author trust level",
- /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
- /// source: "mcp",
- /// },
+ /// title: "Filter queue items by author trust level",
+ /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
+ /// source: "mcp",
/// });
/// console.log(result);
/// }
@@ -102,11 +100,9 @@ partial void ProcessCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.feedback.create({
- /// body: {
- /// title: "Filter queue items by author trust level",
- /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
- /// source: "mcp",
- /// },
+ /// title: "Filter queue items by author trust level",
+ /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
+ /// source: "mcp",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsCreate.g.cs index 09aa27e..3670802 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsCreate.g.cs @@ -20,12 +20,10 @@ public partial interface IActionsClient /// });
/// async function run() {
/// const result = await moderationApi.actions.create({
- /// body: {
- /// key: "suspend-24h",
- /// name: "Suspend for 24 hours",
- /// type: "AUTHOR_BLOCK_TEMP",
- /// queueBehaviour: "REMOVE",
- /// },
+ /// key: "suspend-24h",
+ /// name: "Suspend for 24 hours",
+ /// type: "AUTHOR_BLOCK_TEMP",
+ /// queueBehaviour: "REMOVE",
/// });
/// console.log(result);
/// }
@@ -53,12 +51,10 @@ public partial interface IActionsClient /// });
/// async function run() {
/// const result = await moderationApi.actions.create({
- /// body: {
- /// key: "suspend-24h",
- /// name: "Suspend for 24 hours",
- /// type: "AUTHOR_BLOCK_TEMP",
- /// queueBehaviour: "REMOVE",
- /// },
+ /// key: "suspend-24h",
+ /// name: "Suspend for 24 hours",
+ /// type: "AUTHOR_BLOCK_TEMP",
+ /// queueBehaviour: "REMOVE",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsDelete.g.cs index f987f61..37f2a42 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsDelete.g.cs @@ -21,9 +21,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsExecute.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsExecute.g.cs index 800456c..dfc8933 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsExecute.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsExecute.g.cs @@ -20,12 +20,10 @@ public partial interface IActionsClient /// });
/// async function run() {
/// const result = await moderationApi.actions.execute({
- /// body: {
- /// actionKey: "suspend-24h",
- /// authorIds: [
- /// "user-1092",
- /// ],
- /// },
+ /// actionKey: "suspend-24h",
+ /// authorIds: [
+ /// "user-1092",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -53,12 +51,10 @@ public partial interface IActionsClient /// });
/// async function run() {
/// const result = await moderationApi.actions.execute({
- /// body: {
- /// actionKey: "suspend-24h",
- /// authorIds: [
- /// "user-1092",
- /// ],
- /// },
+ /// actionKey: "suspend-24h",
+ /// authorIds: [
+ /// "user-1092",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -93,6 +89,12 @@ public partial interface IActionsClient /// /// Optional duration in milliseconds for actions with timeouts /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -104,6 +106,8 @@ public partial interface IActionsClient string? value = default, string? queueId = default, double? duration = default, + string? moderator = default, + bool? createCasebookCase = default, global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsGet.g.cs index b208f4e..65c5706 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsGet.g.cs @@ -21,9 +21,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.actions.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsList.g.cs index 6d59a2b..1e1dca6 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsList.g.cs @@ -27,7 +27,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.list({});
+ /// const result = await moderationApi.actions.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -64,7 +64,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.list({});
+ /// const result = await moderationApi.actions.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsUpdate.g.cs index 3f6ed07..d202ff2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IActionsClient.ActionsUpdate.g.cs @@ -22,10 +22,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.actions.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -55,10 +52,7 @@ public partial interface IActionsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.actions.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.actions.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Authors.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Authors.g.cs index b575877..f6a6b24 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Authors.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Authors.g.cs @@ -29,7 +29,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.authors({});
+ /// const result = await moderationApi.analytics.authors();
/// console.log(result);
/// }
/// run(); @@ -66,7 +66,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.authors({});
+ /// const result = await moderationApi.analytics.authors();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Automation.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Automation.g.cs index b057336..bbadcaf 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Automation.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Automation.g.cs @@ -25,7 +25,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.automation({});
+ /// const result = await moderationApi.analytics.automation();
/// console.log(result);
/// }
/// run(); @@ -57,7 +57,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.automation({});
+ /// const result = await moderationApi.analytics.automation();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Channels.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Channels.g.cs index af0c2e7..4550039 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Channels.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Channels.g.cs @@ -22,7 +22,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.channels({});
+ /// const result = await moderationApi.analytics.channels();
/// console.log(result);
/// }
/// run(); @@ -50,7 +50,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.channels({});
+ /// const result = await moderationApi.analytics.channels();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Policies.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Policies.g.cs index 040dd56..89492f1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Policies.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Policies.g.cs @@ -29,7 +29,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.policies({});
+ /// const result = await moderationApi.analytics.policies();
/// console.log(result);
/// }
/// run(); @@ -66,7 +66,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.policies({});
+ /// const result = await moderationApi.analytics.policies();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Summary.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Summary.g.cs index 120d6a3..2afa21f 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Summary.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Summary.g.cs @@ -25,7 +25,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.summary({});
+ /// const result = await moderationApi.analytics.summary();
/// console.log(result);
/// }
/// run(); @@ -57,7 +57,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.summary({});
+ /// const result = await moderationApi.analytics.summary();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Volumes.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Volumes.g.cs index 71b756b..9892a74 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Volumes.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAnalyticsClient.Volumes.g.cs @@ -25,7 +25,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.volumes({});
+ /// const result = await moderationApi.analytics.volumes();
/// console.log(result);
/// }
/// run(); @@ -57,7 +57,7 @@ public partial interface IAnalyticsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.analytics.volumes({});
+ /// const result = await moderationApi.analytics.volumes();
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs index b1b1816..e26daf2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs @@ -21,9 +21,7 @@ public partial interface IAuthorClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IAuthorClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenCreate.g.cs index 08658ac..114f945 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenCreate.g.cs @@ -20,15 +20,13 @@ public partial interface IAuthorClient /// });
/// async function run() {
/// const result = await moderationApi.authors.create({
- /// body: {
- /// name: "Jamie Rivera",
- /// email: "jamie@example.com",
- /// metadata: {
- /// emailVerified: true,
- /// isPayingCustomer: false,
- /// },
- /// externalId: "user-1092",
+ /// name: "Jamie Rivera",
+ /// email: "jamie@example.com",
+ /// metadata: {
+ /// emailVerified: true,
+ /// isPayingCustomer: false,
/// },
+ /// externalId: "user-1092",
/// });
/// console.log(result);
/// }
@@ -56,15 +54,13 @@ public partial interface IAuthorClient /// });
/// async function run() {
/// const result = await moderationApi.authors.create({
- /// body: {
- /// name: "Jamie Rivera",
- /// email: "jamie@example.com",
- /// metadata: {
- /// emailVerified: true,
- /// isPayingCustomer: false,
- /// },
- /// externalId: "user-1092",
+ /// name: "Jamie Rivera",
+ /// email: "jamie@example.com",
+ /// metadata: {
+ /// emailVerified: true,
+ /// isPayingCustomer: false,
/// },
+ /// externalId: "user-1092",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenGetAuthorDetails.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenGetAuthorDetails.g.cs index 169b99b..8161352 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenGetAuthorDetails.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenGetAuthorDetails.g.cs @@ -21,9 +21,7 @@ public partial interface IAuthorClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IAuthorClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.authors.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenUpdate.g.cs index 293bb23..4cd060a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorOpenUpdate.g.cs @@ -22,14 +22,11 @@ public partial interface IAuthorClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.update({
- /// id: "<id>",
- /// body: {
- /// metadata: {
- /// identityVerified: true,
- /// },
- /// manualTrustLevel: 2,
+ /// const result = await moderationApi.authors.update("<id>", {
+ /// metadata: {
+ /// identityVerified: true,
/// },
+ /// manualTrustLevel: 2,
/// });
/// console.log(result);
/// }
@@ -60,14 +57,11 @@ public partial interface IAuthorClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.authors.update({
- /// id: "<id>",
- /// body: {
- /// metadata: {
- /// identityVerified: true,
- /// },
- /// manualTrustLevel: 2,
+ /// const result = await moderationApi.authors.update("<id>", {
+ /// metadata: {
+ /// identityVerified: true,
/// },
+ /// manualTrustLevel: 2,
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..76369b1 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial interface IAuthorsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Block.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Block.g.cs new file mode 100644 index 0000000..f5656d4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Block.g.cs @@ -0,0 +1,88 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IAuthorsClient + { + /// + /// Block author
+ /// Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.block("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task BlockAsync( + string id, + + global::ModerationAPI.BlockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Block author
+ /// Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.block("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task> BlockAsResponseAsync( + string id, + + global::ModerationAPI.BlockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Block author
+ /// Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BlockAsync( + string id, + string? projectId = default, + string? reason = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Suspend.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Suspend.g.cs new file mode 100644 index 0000000..f84f3b4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Suspend.g.cs @@ -0,0 +1,98 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IAuthorsClient + { + /// + /// Suspend author
+ /// Block an author for a limited time with the built-in suspend action. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.suspend("<id>", {
+ /// reason: "Violation of community guidelines",
+ /// duration: 604800000,
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task SuspendAsync( + string id, + + global::ModerationAPI.SuspendAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Suspend author
+ /// Block an author for a limited time with the built-in suspend action. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.suspend("<id>", {
+ /// reason: "Violation of community guidelines",
+ /// duration: 604800000,
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task> SuspendAsResponseAsync( + string id, + + global::ModerationAPI.SuspendAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Suspend author
+ /// Block an author for a limited time with the built-in suspend action. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// How long the suspension lasts, in milliseconds. Defaults to 24 hours. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SuspendAsync( + string id, + string? projectId = default, + string? reason = default, + double? duration = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Unblock.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Unblock.g.cs new file mode 100644 index 0000000..0b5de99 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.Unblock.g.cs @@ -0,0 +1,88 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IAuthorsClient + { + /// + /// Unblock author
+ /// Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.unblock("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task UnblockAsync( + string id, + + global::ModerationAPI.UnblockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unblock author
+ /// Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.authors.unblock("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task> UnblockAsResponseAsync( + string id, + + global::ModerationAPI.UnblockAuthorRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unblock author
+ /// Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + ///
+ /// + /// Either external ID or the ID assigned by moderation API. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UnblockAsync( + string id, + string? projectId = default, + string? reason = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.g.cs new file mode 100644 index 0000000..843c44a --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorsClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAuthorsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsCreate.g.cs index 3c5749c..664f417 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsCreate.g.cs @@ -21,11 +21,8 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.create({
- /// projectId: "<id>",
- /// body: {
- /// name: "<value>",
- /// },
+ /// const result = await moderationApi.channels.create("<id>", {
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
@@ -54,11 +51,8 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.create({
- /// projectId: "<id>",
- /// body: {
- /// name: "<value>",
- /// },
+ /// const result = await moderationApi.channels.create("<id>", {
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDelete.g.cs index 943df95..32e64dd 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDelete.g.cs @@ -20,9 +20,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -47,9 +45,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDuplicate.g.cs index a4bc776..5bbac69 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDuplicate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDuplicate.g.cs @@ -21,10 +21,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -52,10 +49,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsGet.g.cs index 391448c..c7581ca 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsGet.g.cs @@ -20,9 +20,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -47,9 +45,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.channels.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsList.g.cs index c23f30f..480f0e2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsList.g.cs @@ -28,9 +28,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.list({
- /// projectId: "<id>",
- /// });
+ /// const result = await moderationApi.channels.list("<id>");
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -67,9 +65,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.list({
- /// projectId: "<id>",
- /// });
+ /// const result = await moderationApi.channels.list("<id>");
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsUpdate.g.cs index 0018f72..8278fa1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsUpdate.g.cs @@ -21,10 +21,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -52,10 +49,7 @@ public partial interface IChannelsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.channels.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.channels.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Allow.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Allow.g.cs new file mode 100644 index 0000000..2a02132 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Allow.g.cs @@ -0,0 +1,100 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IContentClient + { + /// + /// Allow content
+ /// Allow a content item with the built-in allow action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.allow("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task AllowAsync( + string id, + + global::ModerationAPI.AllowContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Allow content
+ /// Allow a content item with the built-in allow action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.allow("<id>", {});
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task> AllowAsResponseAsync( + string id, + + global::ModerationAPI.AllowContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Allow content
+ /// Allow a content item with the built-in allow action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AllowAsync( + string id, + string? projectId = default, + string? reason = default, + string? queueId = default, + string? moderator = default, + bool? createCasebookCase = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..2e0c94d --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial interface IContentClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Reject.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Reject.g.cs new file mode 100644 index 0000000..7f0eaa4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.Reject.g.cs @@ -0,0 +1,104 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IContentClient + { + /// + /// Reject content
+ /// Reject a content item with the built-in reject action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.reject("<id>", {
+ /// reason: "Spam",
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task RejectAsync( + string id, + + global::ModerationAPI.RejectContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reject content
+ /// Reject a content item with the built-in reject action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// import { ModerationApi } from "@moderation-api/sdk";
+ /// const moderationApi = new ModerationApi({
+ /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
+ /// });
+ /// async function run() {
+ /// const result = await moderationApi.content.reject("<id>", {
+ /// reason: "Spam",
+ /// });
+ /// console.log(result);
+ /// }
+ /// run(); + ///
+ global::System.Threading.Tasks.Task> RejectAsResponseAsync( + string id, + + global::ModerationAPI.RejectContentRequest request, + string? projectId = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reject content
+ /// Reject a content item with the built-in reject action, and resolve it in the review queue. + ///
+ /// + /// The content ID you sent when you submitted the content, or the ID Moderation API assigned. + /// + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RejectAsync( + string id, + string? projectId = default, + string? reason = default, + string? queueId = default, + string? moderator = default, + bool? createCasebookCase = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.g.cs new file mode 100644 index 0000000..c76d331 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IContentClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IContentClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IFeedbackClient.Create.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IFeedbackClient.Create.g.cs index d45efaf..3c48578 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IFeedbackClient.Create.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IFeedbackClient.Create.g.cs @@ -20,11 +20,9 @@ public partial interface IFeedbackClient /// });
/// async function run() {
/// const result = await moderationApi.feedback.create({
- /// body: {
- /// title: "Filter queue items by author trust level",
- /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
- /// source: "mcp",
- /// },
+ /// title: "Filter queue items by author trust level",
+ /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
+ /// source: "mcp",
/// });
/// console.log(result);
/// }
@@ -52,11 +50,9 @@ public partial interface IFeedbackClient /// });
/// async function run() {
/// const result = await moderationApi.feedback.create({
- /// body: {
- /// title: "Filter queue items by author trust level",
- /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
- /// source: "mcp",
- /// },
+ /// title: "Filter queue items by author trust level",
+ /// description: "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.",
+ /// source: "mcp",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs index 8449283..abfd5ff 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs @@ -19,17 +19,15 @@ public partial interface IModerationAPIClient /// });
/// async function run() {
/// const result = await moderationApi.content.submit({
- /// body: {
- /// content: {
- /// type: "text",
- /// text: "Hey, check out my profile for a deal!",
- /// },
- /// contentId: "message-48213",
- /// authorId: "user-1092",
- /// conversationId: "room-general",
- /// metadata: {
- /// "platform": "ios",
- /// },
+ /// content: {
+ /// type: "text",
+ /// text: "Hey, check out my profile for a deal!",
+ /// },
+ /// contentId: "message-48213",
+ /// authorId: "user-1092",
+ /// conversationId: "room-general",
+ /// metadata: {
+ /// "platform": "ios",
/// },
/// });
/// console.log(result);
@@ -57,17 +55,15 @@ public partial interface IModerationAPIClient /// });
/// async function run() {
/// const result = await moderationApi.content.submit({
- /// body: {
- /// content: {
- /// type: "text",
- /// text: "Hey, check out my profile for a deal!",
- /// },
- /// contentId: "message-48213",
- /// authorId: "user-1092",
- /// conversationId: "room-general",
- /// metadata: {
- /// "platform": "ios",
- /// },
+ /// content: {
+ /// type: "text",
+ /// text: "Hey, check out my profile for a deal!",
+ /// },
+ /// contentId: "message-48213",
+ /// authorId: "user-1092",
+ /// conversationId: "room-general",
+ /// metadata: {
+ /// "platform": "ios",
/// },
/// });
/// console.log(result);
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs index 26e8f24..1ad41c4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs @@ -65,11 +65,21 @@ public partial interface IModerationAPIClient : global::System.IDisposable /// public AuthorClient Author { get; } + /// + /// + /// + public AuthorsClient Authors { get; } + /// /// Channels in a project. Needs an organization key. /// public ChannelsClient Channels { get; } + /// + /// + /// + public ContentClient Content { get; } + /// /// /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsApiKeysClient.Create.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsApiKeysClient.Create.g.cs index 587f4c8..d02aeeb 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsApiKeysClient.Create.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsApiKeysClient.Create.g.cs @@ -21,10 +21,7 @@ public partial interface IProjectsApiKeysClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.apiKeys.create({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.apiKeys.create("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -52,10 +49,7 @@ public partial interface IProjectsApiKeysClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.apiKeys.create({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.apiKeys.create("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDelete.g.cs index 2062483..79ff387 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDelete.g.cs @@ -20,9 +20,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -47,9 +45,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDuplicate.g.cs index 10b0a76..981ef60 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDuplicate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDuplicate.g.cs @@ -21,10 +21,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -52,10 +49,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsGet.g.cs index 3ab55db..46e1566 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsGet.g.cs @@ -20,9 +20,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -47,9 +45,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsList.g.cs index f466aa5..4aabc78 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsList.g.cs @@ -25,7 +25,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.list({});
+ /// const result = await moderationApi.projects.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -58,7 +58,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.list({});
+ /// const result = await moderationApi.projects.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsUpdate.g.cs index 8bc7de9..69b17de 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsUpdate.g.cs @@ -21,10 +21,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -52,10 +49,7 @@ public partial interface IProjectsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueClient.List.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueClient.List.g.cs index 77f9ff9..b040a86 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueClient.List.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueClient.List.g.cs @@ -26,7 +26,7 @@ public partial interface IQueueClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.list({});
+ /// const result = await moderationApi.queue.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -61,7 +61,7 @@ public partial interface IQueueClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.list({});
+ /// const result = await moderationApi.queue.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueItemsClient.ResolveMany.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueItemsClient.ResolveMany.g.cs index dd9acf7..5a96d9f 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueItemsClient.ResolveMany.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IQueueItemsClient.ResolveMany.g.cs @@ -22,14 +22,11 @@ public partial interface IQueueItemsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolveMany({
- /// id: "<id>",
- /// body: {
- /// itemIds: [
- /// "clx8k2v0e000108l4a9bz3f7q",
- /// "clx8k2v0e000208l4h2mc6d1r",
- /// ],
- /// },
+ /// const result = await moderationApi.queue.items.resolveMany("<id>", {
+ /// itemIds: [
+ /// "clx8k2v0e000108l4a9bz3f7q",
+ /// "clx8k2v0e000208l4h2mc6d1r",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -60,14 +57,11 @@ public partial interface IQueueItemsClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolveMany({
- /// id: "<id>",
- /// body: {
- /// itemIds: [
- /// "clx8k2v0e000108l4a9bz3f7q",
- /// "clx8k2v0e000208l4h2mc6d1r",
- /// ],
- /// },
+ /// const result = await moderationApi.queue.items.resolveMany("<id>", {
+ /// itemIds: [
+ /// "clx8k2v0e000108l4a9bz3f7q",
+ /// "clx8k2v0e000208l4h2mc6d1r",
+ /// ],
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetQueue.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetQueue.g.cs index f4ca1c3..226e642 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetQueue.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetQueue.g.cs @@ -21,9 +21,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetStats.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetStats.g.cs index b924baf..47d5e46 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetStats.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenGetStats.g.cs @@ -25,9 +25,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.getStats({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.getStats("<id>");
/// console.log(result);
/// }
/// run(); @@ -59,9 +57,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.getStats({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.getStats("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenResolveItem.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenResolveItem.g.cs index 4a93720..bd458b4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenResolveItem.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenResolveItem.g.cs @@ -24,10 +24,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.resolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); @@ -58,10 +55,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.resolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs index 510471d..f1cf516 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs @@ -24,10 +24,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.unresolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.unresolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); @@ -58,10 +55,7 @@ public partial interface IReviewQueuesClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.unresolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.unresolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicCreate.g.cs index 18d6e00..2bd9343 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicCreate.g.cs @@ -20,14 +20,12 @@ public partial interface IWebhooksClient /// });
/// async function run() {
/// const result = await moderationApi.webhooks.create({
- /// body: {
- /// name: "Moderation events",
- /// url: "https://example.com/webhooks/moderation",
- /// eventTypes: [
- /// "QUEUE_ITEM_REJECTED",
- /// "AUTHOR_BLOCKED",
- /// ],
- /// },
+ /// name: "Moderation events",
+ /// url: "https://example.com/webhooks/moderation",
+ /// eventTypes: [
+ /// "QUEUE_ITEM_REJECTED",
+ /// "AUTHOR_BLOCKED",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -55,14 +53,12 @@ public partial interface IWebhooksClient /// });
/// async function run() {
/// const result = await moderationApi.webhooks.create({
- /// body: {
- /// name: "Moderation events",
- /// url: "https://example.com/webhooks/moderation",
- /// eventTypes: [
- /// "QUEUE_ITEM_REJECTED",
- /// "AUTHOR_BLOCKED",
- /// ],
- /// },
+ /// name: "Moderation events",
+ /// url: "https://example.com/webhooks/moderation",
+ /// eventTypes: [
+ /// "QUEUE_ITEM_REJECTED",
+ /// "AUTHOR_BLOCKED",
+ /// ],
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicDelete.g.cs index 5e2f84a..185907c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicDelete.g.cs @@ -21,9 +21,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGet.g.cs index 0488ced..e7c08d1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGet.g.cs @@ -21,9 +21,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicList.g.cs index 35c1be1..bc459b6 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicList.g.cs @@ -26,7 +26,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.list({});
+ /// const result = await moderationApi.webhooks.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -61,7 +61,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.list({});
+ /// const result = await moderationApi.webhooks.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicUpdate.g.cs index 91f4cd5..1fbee6a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicUpdate.g.cs @@ -22,10 +22,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.webhooks.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -55,10 +52,7 @@ public partial interface IWebhooksClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.webhooks.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.Create.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.Create.g.cs index 6c8da34..4a25acd 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.Create.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.Create.g.cs @@ -20,9 +20,7 @@ public partial interface IWordlistClient /// });
/// async function run() {
/// const result = await moderationApi.wordlist.create({
- /// body: {
- /// name: "<value>",
- /// },
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
@@ -50,9 +48,7 @@ public partial interface IWordlistClient /// });
/// async function run() {
/// const result = await moderationApi.wordlist.create({
- /// body: {
- /// name: "<value>",
- /// },
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistAddWords.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistAddWords.g.cs index e1c245b..af787d9 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistAddWords.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistAddWords.g.cs @@ -22,14 +22,11 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.add({
- /// id: "<id>",
- /// body: {
- /// words: [
- /// "free money",
- /// "click here",
- /// ],
- /// },
+ /// const result = await moderationApi.wordlist.words.add("<id>", {
+ /// words: [
+ /// "free money",
+ /// "click here",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -60,14 +57,11 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.add({
- /// id: "<id>",
- /// body: {
- /// words: [
- /// "free money",
- /// "click here",
- /// ],
- /// },
+ /// const result = await moderationApi.wordlist.words.add("<id>", {
+ /// words: [
+ /// "free money",
+ /// "click here",
+ /// ],
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistGetWordlistPublic.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistGetWordlistPublic.g.cs index d92d4a9..5f72613 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistGetWordlistPublic.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistGetWordlistPublic.g.cs @@ -21,9 +21,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistList.g.cs index 137fbc3..8a01b19 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistList.g.cs @@ -26,7 +26,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.list({});
+ /// const result = await moderationApi.wordlist.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -61,7 +61,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.list({});
+ /// const result = await moderationApi.wordlist.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistRemoveWords.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistRemoveWords.g.cs index 010ba65..9f8c69c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistRemoveWords.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistRemoveWords.g.cs @@ -24,14 +24,11 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.remove({
- /// id: "<id>",
- /// words: [
- /// "<value 1>",
- /// "<value 2>",
- /// "<value 3>",
- /// ],
- /// });
+ /// const result = await moderationApi.wordlist.words.remove("<id>", [
+ /// "<value 1>",
+ /// "<value 2>",
+ /// "<value 3>",
+ /// ]);
/// console.log(result);
/// }
/// run(); @@ -62,14 +59,11 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.remove({
- /// id: "<id>",
- /// words: [
- /// "<value 1>",
- /// "<value 2>",
- /// "<value 3>",
- /// ],
- /// });
+ /// const result = await moderationApi.wordlist.words.remove("<id>", [
+ /// "<value 1>",
+ /// "<value 2>",
+ /// "<value 3>",
+ /// ]);
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistUpdate.g.cs index 50b9eba..bed2de4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistUpdate.g.cs @@ -22,10 +22,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.wordlist.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -55,10 +52,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.wordlist.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistWordlistEmbeddingStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistWordlistEmbeddingStatus.g.cs index 590dd3c..39c5a84 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistWordlistEmbeddingStatus.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWordlistClient.WordlistWordlistEmbeddingStatus.g.cs @@ -21,9 +21,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.getEmbeddingStatus({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.getEmbeddingStatus("<id>");
/// console.log(result);
/// }
/// run(); @@ -50,9 +48,7 @@ public partial interface IWordlistClient /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.getEmbeddingStatus({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.getEmbeddingStatus("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs index dd30d37..f8ae3ed 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs @@ -617,6 +617,11 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsUpdateRequestPossibleValue))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsExecuteRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.RejectContentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AllowContentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.BlockAuthorRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.SuspendAuthorRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.UnblockAuthorRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType), TypeInfoPropertyName = "WebhooksPublicCreateRequestEventType2")] @@ -787,6 +792,11 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsUpdateResponsePossibleValue))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsDeleteResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsExecuteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.RejectContentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AllowContentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.BlockAuthorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.SuspendAuthorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.UnblockAuthorResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseDataItem))] diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs index 6ccb534..318eb92 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs @@ -674,1027 +674,1067 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::ModerationAPI.WebhooksPublicCreateRequest? Type159 { get; set; } + public global::ModerationAPI.RejectContentRequest? Type159 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type160 { get; set; } + public global::ModerationAPI.AllowContentRequest? Type160 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicCreateRequestEventType? Type161 { get; set; } + public global::ModerationAPI.BlockAuthorRequest? Type161 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicUpdateRequest? Type162 { get; set; } + public global::ModerationAPI.SuspendAuthorRequest? Type162 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type163 { get; set; } + public global::ModerationAPI.UnblockAuthorRequest? Type163 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicUpdateRequestEventType? Type164 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateRequest? Type164 { get; set; } /// /// /// - public global::ModerationAPI.CreateWordlistRequest? Type165 { get; set; } + public global::System.Collections.Generic.IList? Type165 { get; set; } /// /// /// - public global::ModerationAPI.WordlistUpdateRequest? Type166 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateRequestEventType? Type166 { get; set; } /// /// /// - public global::ModerationAPI.WordlistAddWordsRequest? Type167 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateRequest? Type167 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequest? Type168 { get; set; } + public global::System.Collections.Generic.IList? Type168 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentText? Type169 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateRequestEventType? Type169 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentImage? Type170 { get; set; } + public global::ModerationAPI.CreateWordlistRequest? Type170 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentVideo? Type171 { get; set; } + public global::ModerationAPI.WordlistUpdateRequest? Type171 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentAudio? Type172 { get; set; } + public global::ModerationAPI.WordlistAddWordsRequest? Type172 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObject? Type173 { get; set; } + public global::ModerationAPI.NewModerateModerateRequest? Type173 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataText? Type174 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentText? Type174 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataImage? Type175 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentImage? Type175 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataVideo? Type176 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentVideo? Type176 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataAudio? Type177 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentAudio? Type177 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestMetaType? Type178 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObject? Type178 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestClientAction? Type179 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataText? Type179 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestClientActionAction? Type180 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataImage? Type180 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestClientActionBehavior? Type181 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataVideo? Type181 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieToxicity? Type182 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataAudio? Type182 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePersonalInformation? Type183 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestMetaType? Type183 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieHate? Type184 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestClientAction? Type184 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicit? Type185 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestClientActionAction? Type185 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitDrugs? Type186 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestClientActionBehavior? Type186 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitAlcohol? Type187 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieToxicity? Type187 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitFirearms? Type188 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePersonalInformation? Type188 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitTobacco? Type189 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieHate? Type189 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitGambling? Type190 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicit? Type190 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieCannabis? Type191 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitDrugs? Type191 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieAdult? Type192 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitAlcohol? Type192 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieCrypto? Type193 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitFirearms? Type193 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSexual? Type194 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitTobacco? Type194 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors? Type195 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitGambling? Type195 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieProfanity? Type196 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCannabis? Type196 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieViolence? Type197 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieAdult? Type197 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSelfHarm? Type198 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCrypto? Type198 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSpam? Type199 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSexual? Type199 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieLowQualityContent? Type200 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors? Type200 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetection? Type201 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieProfanity? Type201 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetectionComparator? Type202 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieViolence? Type202 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSelfPromotion? Type203 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSelfHarm? Type203 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePolitical? Type204 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSpam? Type204 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieReligion? Type205 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieLowQualityContent? Type205 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieThreat? Type206 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetection? Type206 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSexualSolicitation? Type207 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetectionComparator? Type207 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieChannelCircumvention? Type208 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSelfPromotion? Type208 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllegalTrade? Type209 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePolitical? Type209 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieAlcohol? Type210 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieReligion? Type210 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieDrugs? Type211 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieThreat? Type211 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieGambling? Type212 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSexualSolicitation? Type212 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieTobacco? Type213 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieChannelCircumvention? Type213 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieWeapons? Type214 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllegalTrade? Type214 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePromotion? Type215 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieAlcohol? Type215 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieExtremism? Type216 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieDrugs? Type216 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieCodeAbuse? Type217 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieGambling? Type217 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing? Type218 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieTobacco? Type218 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type219 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieWeapons? Type219 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2? Type220 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePromotion? Type220 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMasking? Type221 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieExtremism? Type221 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type222 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCodeAbuse? Type222 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities2? Type223 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing? Type223 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMasking? Type224 { get; set; } + public global::System.Collections.Generic.Dictionary? Type224 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type225 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2? Type225 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2? Type226 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMasking? Type226 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlRisk? Type227 { get; set; } + public global::System.Collections.Generic.Dictionary? Type227 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieGuideline? Type228 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities2? Type228 { get; set; } /// /// /// - public global::ModerationAPI.ManagementProjectsCreateRequest? Type229 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMasking? Type229 { get; set; } /// /// /// - public global::ModerationAPI.ManagementProjectsUpdateRequest? Type230 { get; set; } + public global::System.Collections.Generic.Dictionary? Type230 { get; set; } /// /// /// - public global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? Type231 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2? Type231 { get; set; } /// /// /// - public global::ModerationAPI.ManagementProjectsDuplicateRequest? Type232 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlRisk? Type232 { get; set; } /// /// /// - public global::ModerationAPI.CreateProjectApiKeyRequest? Type233 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieGuideline? Type233 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsCreateRequest? Type234 { get; set; } + public global::ModerationAPI.ManagementProjectsCreateRequest? Type234 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsCreateRequestContentType? Type235 { get; set; } + public global::ModerationAPI.ManagementProjectsUpdateRequest? Type235 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsUpdateRequest? Type236 { get; set; } + public global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? Type236 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsUpdateRequestContentType? Type237 { get; set; } + public global::ModerationAPI.ManagementProjectsDuplicateRequest? Type237 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? Type238 { get; set; } + public global::ModerationAPI.CreateProjectApiKeyRequest? Type238 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? Type239 { get; set; } + public global::ModerationAPI.ManagementChannelsCreateRequest? Type239 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsDuplicateRequest? Type240 { get; set; } + public global::ModerationAPI.ManagementChannelsCreateRequestContentType? Type240 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsSummaryRange? Type241 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequest? Type241 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsPoliciesRange? Type242 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequestContentType? Type242 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAuthorsRange? Type243 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? Type243 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsChannelsRange? Type244 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? Type244 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsVolumesRange? Type245 { get; set; } + public global::ModerationAPI.ManagementChannelsDuplicateRequest? Type245 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAutomationRange? Type246 { get; set; } + public global::ModerationAPI.GetAnalyticsSummaryRange? Type246 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenListAuthorsSortBy? Type247 { get; set; } + public global::ModerationAPI.GetAnalyticsPoliciesRange? Type247 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenListAuthorsSortDirection? Type248 { get; set; } + public global::ModerationAPI.GetAnalyticsAuthorsRange? Type248 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsSort? Type249 { get; set; } + public global::ModerationAPI.GetAnalyticsChannelsRange? Type249 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsSummaryResponse? Type250 { get; set; } + public global::ModerationAPI.GetAnalyticsVolumesRange? Type250 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsSummaryResponseRange? Type251 { get; set; } + public global::ModerationAPI.GetAnalyticsAutomationRange? Type251 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsSummaryResponseTotals? Type252 { get; set; } + public global::ModerationAPI.AuthorOpenListAuthorsSortBy? Type252 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsSummaryResponsePreviousPeriod? Type253 { get; set; } + public global::ModerationAPI.AuthorOpenListAuthorsSortDirection? Type253 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsSummaryResponseFlagRateSpike? Type254 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsSort? Type254 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsPoliciesResponse? Type255 { get; set; } + public global::ModerationAPI.GetAnalyticsSummaryResponse? Type255 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsPoliciesResponseRange? Type256 { get; set; } + public global::ModerationAPI.GetAnalyticsSummaryResponseRange? Type256 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type257 { get; set; } + public global::ModerationAPI.GetAnalyticsSummaryResponseTotals? Type257 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsPoliciesResponsePolicie? Type258 { get; set; } + public global::ModerationAPI.GetAnalyticsSummaryResponsePreviousPeriod? Type258 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAuthorsResponse? Type259 { get; set; } + public global::ModerationAPI.GetAnalyticsSummaryResponseFlagRateSpike? Type259 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAuthorsResponseRange? Type260 { get; set; } + public global::ModerationAPI.GetAnalyticsPoliciesResponse? Type260 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type261 { get; set; } + public global::ModerationAPI.GetAnalyticsPoliciesResponseRange? Type261 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAuthorsResponseAuthor? Type262 { get; set; } + public global::System.Collections.Generic.IList? Type262 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsChannelsResponse? Type263 { get; set; } + public global::ModerationAPI.GetAnalyticsPoliciesResponsePolicie? Type263 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsChannelsResponseRange? Type264 { get; set; } + public global::ModerationAPI.GetAnalyticsAuthorsResponse? Type264 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type265 { get; set; } + public global::ModerationAPI.GetAnalyticsAuthorsResponseRange? Type265 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsChannelsResponseChannel? Type266 { get; set; } + public global::System.Collections.Generic.IList? Type266 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsVolumesResponse? Type267 { get; set; } + public global::ModerationAPI.GetAnalyticsAuthorsResponseAuthor? Type267 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsVolumesResponseRange? Type268 { get; set; } + public global::ModerationAPI.GetAnalyticsChannelsResponse? Type268 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsVolumesResponseBucket? Type269 { get; set; } + public global::ModerationAPI.GetAnalyticsChannelsResponseRange? Type269 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type270 { get; set; } + public global::System.Collections.Generic.IList? Type270 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsVolumesResponseVolume? Type271 { get; set; } + public global::ModerationAPI.GetAnalyticsChannelsResponseChannel? Type271 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAutomationResponse? Type272 { get; set; } + public global::ModerationAPI.GetAnalyticsVolumesResponse? Type272 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAutomationResponseRange? Type273 { get; set; } + public global::ModerationAPI.GetAnalyticsVolumesResponseRange? Type273 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type274 { get; set; } + public global::ModerationAPI.GetAnalyticsVolumesResponseBucket? Type274 { get; set; } /// /// /// - public global::ModerationAPI.GetAnalyticsAutomationResponseRule? Type275 { get; set; } + public global::System.Collections.Generic.IList? Type275 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenListAuthorsResponse? Type276 { get; set; } + public global::ModerationAPI.GetAnalyticsVolumesResponseVolume? Type276 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type277 { get; set; } + public global::ModerationAPI.GetAnalyticsAutomationResponse? Type277 { get; set; } /// /// /// - public global::ModerationAPI.AuthorDeleteResponse? Type278 { get; set; } + public global::ModerationAPI.GetAnalyticsAutomationResponseRange? Type278 { get; set; } /// /// /// - public global::ModerationAPI.CreateFeedbackResponse? Type279 { get; set; } + public global::System.Collections.Generic.IList? Type279 { get; set; } /// /// /// - public global::ModerationAPI.ListQueuesResponse? Type280 { get; set; } + public global::ModerationAPI.GetAnalyticsAutomationResponseRule? Type280 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type281 { get; set; } + public global::ModerationAPI.AuthorOpenListAuthorsResponse? Type281 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetQueueResponse? Type282 { get; set; } + public global::System.Collections.Generic.IList? Type282 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponse? Type283 { get; set; } + public global::ModerationAPI.AuthorDeleteResponse? Type283 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseReviewStats? Type284 { get; set; } + public global::ModerationAPI.CreateFeedbackResponse? Type284 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type285 { get; set; } + public global::ModerationAPI.ListQueuesResponse? Type285 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTopReviewer? Type286 { get; set; } + public global::System.Collections.Generic.IList? Type286 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTrends? Type287 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponse? Type287 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type288 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponse? Type288 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTrendsDailyReviewCount? Type289 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseReviewStats? Type289 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsResponse? Type290 { get; set; } + public global::System.Collections.Generic.IList? Type290 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type291 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTopReviewer? Type291 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenResolveItemResponse? Type292 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTrends? Type292 { get; set; } /// /// /// - public global::ModerationAPI.ResolveQueueItemsResponse? Type293 { get; set; } + public global::System.Collections.Generic.IList? Type293 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenUnresolveItemResponse? Type294 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTrendsDailyReviewCount? Type294 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenUnresolveItemResponseStatus? Type295 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsResponse? Type295 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponse? Type296 { get; set; } + public global::System.Collections.Generic.IList? Type296 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type297 { get; set; } + public global::ModerationAPI.QueueViewOpenResolveItemResponse? Type297 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseDataItem? Type298 { get; set; } + public global::ModerationAPI.ResolveQueueItemsResponse? Type298 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseDataItemType? Type299 { get; set; } + public global::ModerationAPI.QueueViewOpenUnresolveItemResponse? Type299 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseDataItemQueueBehaviour? Type300 { get; set; } + public global::ModerationAPI.QueueViewOpenUnresolveItemResponseStatus? Type300 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseDataItemPosition? Type301 { get; set; } + public global::ModerationAPI.ActionsListResponse? Type301 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type302 { get; set; } + public global::System.Collections.Generic.IList? Type302 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseDataItemPossibleValue? Type303 { get; set; } + public global::ModerationAPI.ActionsListResponseDataItem? Type303 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponse? Type304 { get; set; } + public global::ModerationAPI.ActionsListResponseDataItemType? Type304 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponseType? Type305 { get; set; } + public global::ModerationAPI.ActionsListResponseDataItemQueueBehaviour? Type305 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponseQueueBehaviour? Type306 { get; set; } + public global::ModerationAPI.ActionsListResponseDataItemPosition? Type306 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponsePosition? Type307 { get; set; } + public global::System.Collections.Generic.IList? Type307 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type308 { get; set; } + public global::ModerationAPI.ActionsListResponseDataItemPossibleValue? Type308 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponsePossibleValue? Type309 { get; set; } + public global::ModerationAPI.ActionsCreateResponse? Type309 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponse? Type310 { get; set; } + public global::ModerationAPI.ActionsCreateResponseType? Type310 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponseType? Type311 { get; set; } + public global::ModerationAPI.ActionsCreateResponseQueueBehaviour? Type311 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponseQueueBehaviour? Type312 { get; set; } + public global::ModerationAPI.ActionsCreateResponsePosition? Type312 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponsePosition? Type313 { get; set; } + public global::System.Collections.Generic.IList? Type313 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type314 { get; set; } + public global::ModerationAPI.ActionsCreateResponsePossibleValue? Type314 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponsePossibleValue? Type315 { get; set; } + public global::ModerationAPI.ActionsGetResponse? Type315 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponse? Type316 { get; set; } + public global::ModerationAPI.ActionsGetResponseType? Type316 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponseType? Type317 { get; set; } + public global::ModerationAPI.ActionsGetResponseQueueBehaviour? Type317 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponseQueueBehaviour? Type318 { get; set; } + public global::ModerationAPI.ActionsGetResponsePosition? Type318 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponsePosition? Type319 { get; set; } + public global::System.Collections.Generic.IList? Type319 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type320 { get; set; } + public global::ModerationAPI.ActionsGetResponsePossibleValue? Type320 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponsePossibleValue? Type321 { get; set; } + public global::ModerationAPI.ActionsUpdateResponse? Type321 { get; set; } /// /// /// - public global::ModerationAPI.ActionsDeleteResponse? Type322 { get; set; } + public global::ModerationAPI.ActionsUpdateResponseType? Type322 { get; set; } /// /// /// - public global::ModerationAPI.ActionsExecuteResponse? Type323 { get; set; } + public global::ModerationAPI.ActionsUpdateResponseQueueBehaviour? Type323 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicListResponse? Type324 { get; set; } + public global::ModerationAPI.ActionsUpdateResponsePosition? Type324 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type325 { get; set; } + public global::System.Collections.Generic.IList? Type325 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicListResponseDataItem? Type326 { get; set; } + public global::ModerationAPI.ActionsUpdateResponsePossibleValue? Type326 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type327 { get; set; } + public global::ModerationAPI.ActionsDeleteResponse? Type327 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicListResponseDataItemEventType? Type328 { get; set; } + public global::ModerationAPI.ActionsExecuteResponse? Type328 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicListResponseDataItemPayloadVersion? Type329 { get; set; } + public global::ModerationAPI.RejectContentResponse? Type329 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicCreateResponse? Type330 { get; set; } + public global::ModerationAPI.AllowContentResponse? Type330 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type331 { get; set; } + public global::ModerationAPI.BlockAuthorResponse? Type331 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicCreateResponseEventType? Type332 { get; set; } + public global::ModerationAPI.SuspendAuthorResponse? Type332 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion? Type333 { get; set; } + public global::ModerationAPI.UnblockAuthorResponse? Type333 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicGetResponse? Type334 { get; set; } + public global::ModerationAPI.WebhooksPublicListResponse? Type334 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type335 { get; set; } + public global::System.Collections.Generic.IList? Type335 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicGetResponseEventType? Type336 { get; set; } + public global::ModerationAPI.WebhooksPublicListResponseDataItem? Type336 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion? Type337 { get; set; } + public global::System.Collections.Generic.IList? Type337 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicUpdateResponse? Type338 { get; set; } + public global::ModerationAPI.WebhooksPublicListResponseDataItemEventType? Type338 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type339 { get; set; } + public global::ModerationAPI.WebhooksPublicListResponseDataItemPayloadVersion? Type339 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicUpdateResponseEventType? Type340 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateResponse? Type340 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion? Type341 { get; set; } + public global::System.Collections.Generic.IList? Type341 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicDeleteResponse? Type342 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateResponseEventType? Type342 { get; set; } /// /// /// - public global::ModerationAPI.WebhooksPublicGetSecretResponse? Type343 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion? Type343 { get; set; } /// /// /// - public global::ModerationAPI.AccountGetResponse? Type344 { get; set; } + public global::ModerationAPI.WebhooksPublicGetResponse? Type344 { get; set; } /// /// /// - public global::ModerationAPI.AccountGetResponseCurrentProject? Type345 { get; set; } + public global::System.Collections.Generic.IList? Type345 { get; set; } /// /// /// - public global::ModerationAPI.WordlistListResponse? Type346 { get; set; } + public global::ModerationAPI.WebhooksPublicGetResponseEventType? Type346 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type347 { get; set; } + public global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion? Type347 { get; set; } /// /// /// - public global::ModerationAPI.WordlistListResponseDataItem? Type348 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateResponse? Type348 { get; set; } /// /// /// - public global::ModerationAPI.CreateWordlistResponse? Type349 { get; set; } + public global::System.Collections.Generic.IList? Type349 { get; set; } /// /// /// - public global::ModerationAPI.WordlistGetWordlistPublicResponse? Type350 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateResponseEventType? Type350 { get; set; } /// /// /// - public global::ModerationAPI.WordlistUpdateResponse? Type351 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion? Type351 { get; set; } /// /// /// - public global::ModerationAPI.WordlistWordlistEmbeddingStatusResponse? Type352 { get; set; } + public global::ModerationAPI.WebhooksPublicDeleteResponse? Type352 { get; set; } /// /// /// - public global::ModerationAPI.WordlistAddWordsResponse? Type353 { get; set; } + public global::ModerationAPI.WebhooksPublicGetSecretResponse? Type353 { get; set; } /// /// /// - public global::ModerationAPI.WordlistRemoveWordsResponse? Type354 { get; set; } + public global::ModerationAPI.AccountGetResponse? Type354 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponse? Type355 { get; set; } + public global::ModerationAPI.AccountGetResponseCurrentProject? Type355 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContent? Type356 { get; set; } + public global::ModerationAPI.WordlistListResponse? Type356 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText? Type357 { get; set; } + public global::System.Collections.Generic.IList? Type357 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage? Type358 { get; set; } + public global::ModerationAPI.WordlistListResponseDataItem? Type358 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo? Type359 { get; set; } + public global::ModerationAPI.CreateWordlistResponse? Type359 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio? Type360 { get; set; } + public global::ModerationAPI.WordlistGetWordlistPublicResponse? Type360 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthor? Type361 { get; set; } + public global::ModerationAPI.WordlistUpdateResponse? Type361 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthorBlock? Type362 { get; set; } + public global::ModerationAPI.WordlistWordlistEmbeddingStatusResponse? Type362 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthorStatus? Type363 { get; set; } + public global::ModerationAPI.WordlistAddWordsResponse? Type363 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthorTrustLevel? Type364 { get; set; } + public global::ModerationAPI.WordlistRemoveWordsResponse? Type364 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseEvaluation? Type365 { get; set; } + public global::ModerationAPI.NewModerateModerateResponse? Type365 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendation? Type366 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContent? Type366 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendationAction? Type367 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText? Type367 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type368 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage? Type368 { get; set; } /// /// /// - public global::ModerationAPI.AnyOf? Type369 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo? Type369 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendationReasonCode? Type370 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio? Type370 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type371 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthor? Type371 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendationMatchedRule? Type372 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthorBlock? Type372 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseCasebook? Type373 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthorStatus? Type373 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseCasebookVerdict? Type374 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthorTrustLevel? Type374 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseCasebookTopic? Type375 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseEvaluation? Type375 { get; set; } /// /// /// - public global::ModerationAPI.OneOf? Type376 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendation? Type376 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutput? Type377 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendationAction? Type377 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type378 { get; set; } + public global::System.Collections.Generic.IList>? Type378 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutputLabel? Type379 { get; set; } + public global::ModerationAPI.AnyOf? Type379 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutput? Type380 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendationReasonCode? Type380 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type381 { get; set; } + public global::System.Collections.Generic.IList? Type381 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatche? Type382 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendationMatchedRule? Type382 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type383 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseCasebook? Type383 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignals? Type384 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseCasebookVerdict? Type384 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonation? Type385 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseCasebookTopic? Type385 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethod? Type386 { get; set; } + public global::ModerationAPI.OneOf? Type386 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsight? Type387 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutput? Type387 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsightValue? Type388 { get; set; } + public global::System.Collections.Generic.IList? Type388 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsightScores? Type389 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutputLabel? Type389 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightLanguageInsight? Type390 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutput? Type390 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightCuriosityInsight? Type391 { get; set; } + public global::System.Collections.Generic.IList? Type391 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightRespectInsight? Type392 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatche? Type392 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightPersonalStoryInsight? Type393 { get; set; } + public global::System.Collections.Generic.IList? Type393 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightCompassionInsight? Type394 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignals? Type394 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseMeta? Type395 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonation? Type395 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseMetaStatus? Type396 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethod? Type396 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type397 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsight? Type397 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseError? Type398 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsightValue? Type398 { get; set; } /// /// /// - public global::ModerationAPI.ManagementProjectsListResponse? Type399 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsightScores? Type399 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type400 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightLanguageInsight? Type400 { get; set; } /// /// /// - public global::ModerationAPI.ManagementProjectsDeleteResponse? Type401 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightCuriosityInsight? Type401 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsListResponse? Type402 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightRespectInsight? Type402 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type403 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightPersonalStoryInsight? Type403 { get; set; } /// /// /// - public global::ModerationAPI.ManagementChannelsDeleteResponse? Type404 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightCompassionInsight? Type404 { get; set; } /// /// /// - public global::ModerationAPI.AuthorBlockedWebhookVersion? Type405 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseMeta? Type405 { get; set; } /// /// /// - public global::ModerationAPI.AuthorUnblockedWebhookVersion? Type406 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseMetaStatus? Type406 { get; set; } /// /// /// - public global::ModerationAPI.AuthorSuspendedWebhookVersion? Type407 { get; set; } + public global::System.Collections.Generic.IList? Type407 { get; set; } /// /// /// - public global::ModerationAPI.AuthorUpdatedWebhookVersion? Type408 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseError? Type408 { get; set; } /// /// /// - public global::ModerationAPI.AuthorTrustLevelChangedWebhookVersion? Type409 { get; set; } + public global::ModerationAPI.ManagementProjectsListResponse? Type409 { get; set; } /// /// /// - public global::ModerationAPI.AuthorActionWebhookVersion? Type410 { get; set; } + public global::System.Collections.Generic.IList? Type410 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemResolvedWebhookVersion? Type411 { get; set; } + public global::ModerationAPI.ManagementProjectsDeleteResponse? Type411 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemActionWebhookVersion? Type412 { get; set; } + public global::ModerationAPI.ManagementChannelsListResponse? Type412 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemRejectedWebhookVersion? Type413 { get; set; } + public global::System.Collections.Generic.IList? Type413 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemAllowedWebhookVersion? Type414 { get; set; } + public global::ModerationAPI.ManagementChannelsDeleteResponse? Type414 { get; set; } + /// + /// + /// + public global::ModerationAPI.AuthorBlockedWebhookVersion? Type415 { get; set; } + /// + /// + /// + public global::ModerationAPI.AuthorUnblockedWebhookVersion? Type416 { get; set; } + /// + /// + /// + public global::ModerationAPI.AuthorSuspendedWebhookVersion? Type417 { get; set; } + /// + /// + /// + public global::ModerationAPI.AuthorUpdatedWebhookVersion? Type418 { get; set; } + /// + /// + /// + public global::ModerationAPI.AuthorTrustLevelChangedWebhookVersion? Type419 { get; set; } + /// + /// + /// + public global::ModerationAPI.AuthorActionWebhookVersion? Type420 { get; set; } + /// + /// + /// + public global::ModerationAPI.QueueItemResolvedWebhookVersion? Type421 { get; set; } + /// + /// + /// + public global::ModerationAPI.QueueItemActionWebhookVersion? Type422 { get; set; } + /// + /// + /// + public global::ModerationAPI.QueueItemRejectedWebhookVersion? Type423 { get; set; } + /// + /// + /// + public global::ModerationAPI.QueueItemAllowedWebhookVersion? Type424 { get; set; } /// /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ActionsExecuteRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ActionsExecuteRequest.g.cs index a4f8d71..ef352d0 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ActionsExecuteRequest.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ActionsExecuteRequest.g.cs @@ -45,6 +45,18 @@ public sealed partial class ActionsExecuteRequest [global::System.Text.Json.Serialization.JsonPropertyName("duration")] public double? Duration { get; set; } + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("moderator")] + public string? Moderator { get; set; } + + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createCasebookCase")] + public bool? CreateCasebookCase { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -72,6 +84,12 @@ public sealed partial class ActionsExecuteRequest /// /// Optional duration in milliseconds for actions with timeouts /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -81,7 +99,9 @@ public ActionsExecuteRequest( global::System.Collections.Generic.IList? authorIds, string? value, string? queueId, - double? duration) + double? duration, + string? moderator, + bool? createCasebookCase) { this.ActionKey = actionKey ?? throw new global::System.ArgumentNullException(nameof(actionKey)); this.ContentIds = contentIds; @@ -89,6 +109,8 @@ public ActionsExecuteRequest( this.Value = value; this.QueueId = queueId; this.Duration = duration; + this.Moderator = moderator; + this.CreateCasebookCase = createCasebookCase; } /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentRequest.Json.g.cs new file mode 100644 index 0000000..9e205c4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class AllowContentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.AllowContentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.AllowContentRequest), + jsonSerializerContext) as global::ModerationAPI.AllowContentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.AllowContentRequest? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.AllowContentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.AllowContentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.AllowContentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentRequest.g.cs new file mode 100644 index 0000000..d761d3b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentRequest.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class AllowContentRequest + { + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("queueId")] + public string? QueueId { get; set; } + + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("moderator")] + public string? Moderator { get; set; } + + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createCasebookCase")] + public bool? CreateCasebookCase { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AllowContentRequest( + string? reason, + string? queueId, + string? moderator, + bool? createCasebookCase) + { + this.Reason = reason; + this.QueueId = queueId; + this.Moderator = moderator; + this.CreateCasebookCase = createCasebookCase; + } + + /// + /// Initializes a new instance of the class. + /// + public AllowContentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentResponse.Json.g.cs new file mode 100644 index 0000000..510431a --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class AllowContentResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.AllowContentResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.AllowContentResponse), + jsonSerializerContext) as global::ModerationAPI.AllowContentResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.AllowContentResponse? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.AllowContentResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.AllowContentResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.AllowContentResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentResponse.g.cs new file mode 100644 index 0000000..2a3e4f1 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AllowContentResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Execution result + /// + public sealed partial class AllowContentResponse + { + /// + /// Whether the action was executed successfully + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Success { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the action was executed successfully + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AllowContentResponse( + bool success) + { + this.Success = success; + } + + /// + /// Initializes a new instance of the class. + /// + public AllowContentResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorRequest.Json.g.cs new file mode 100644 index 0000000..948f869 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class BlockAuthorRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.BlockAuthorRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.BlockAuthorRequest), + jsonSerializerContext) as global::ModerationAPI.BlockAuthorRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.BlockAuthorRequest? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.BlockAuthorRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.BlockAuthorRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.BlockAuthorRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorRequest.g.cs new file mode 100644 index 0000000..08ea9af --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class BlockAuthorRequest + { + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BlockAuthorRequest( + string? reason) + { + this.Reason = reason; + } + + /// + /// Initializes a new instance of the class. + /// + public BlockAuthorRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorResponse.Json.g.cs new file mode 100644 index 0000000..d7996dc --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class BlockAuthorResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.BlockAuthorResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.BlockAuthorResponse), + jsonSerializerContext) as global::ModerationAPI.BlockAuthorResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.BlockAuthorResponse? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.BlockAuthorResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.BlockAuthorResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.BlockAuthorResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorResponse.g.cs new file mode 100644 index 0000000..f175347 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.BlockAuthorResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Execution result + /// + public sealed partial class BlockAuthorResponse + { + /// + /// Whether the action was executed successfully + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Success { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the action was executed successfully + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BlockAuthorResponse( + bool success) + { + this.Success = success; + } + + /// + /// Initializes a new instance of the class. + /// + public BlockAuthorResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.g.cs index 8a0d98c..b9ed347 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.g.cs @@ -29,7 +29,7 @@ public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofing public string Id { get; set; } = "unicode_spoofing"; /// - /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. + /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled. /// [global::System.Text.Json.Serialization.JsonPropertyName("signals")] public global::System.Collections.Generic.Dictionary? Signals { get; set; } @@ -46,7 +46,7 @@ public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofing /// /// /// - /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. + /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled. /// /// #if NET7_0_OR_GREATER diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.g.cs index b1bbddd..f6e1183 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. + /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled. /// public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofingSignals { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentRequest.Json.g.cs new file mode 100644 index 0000000..ccf51ce --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class RejectContentRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.RejectContentRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.RejectContentRequest), + jsonSerializerContext) as global::ModerationAPI.RejectContentRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.RejectContentRequest? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.RejectContentRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.RejectContentRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.RejectContentRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentRequest.g.cs new file mode 100644 index 0000000..b60b5be --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentRequest.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class RejectContentRequest + { + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("queueId")] + public string? QueueId { get; set; } + + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("moderator")] + public string? Moderator { get; set; } + + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createCasebookCase")] + public bool? CreateCasebookCase { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// The queue the content is reviewed in. Defaults to the project's default queue. + /// + /// + /// The user ID or email of the organization member who made the decision. The action is recorded as theirs. + /// + /// + /// Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RejectContentRequest( + string? reason, + string? queueId, + string? moderator, + bool? createCasebookCase) + { + this.Reason = reason; + this.QueueId = queueId; + this.Moderator = moderator; + this.CreateCasebookCase = createCasebookCase; + } + + /// + /// Initializes a new instance of the class. + /// + public RejectContentRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentResponse.Json.g.cs new file mode 100644 index 0000000..d8d2008 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class RejectContentResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.RejectContentResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.RejectContentResponse), + jsonSerializerContext) as global::ModerationAPI.RejectContentResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.RejectContentResponse? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.RejectContentResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.RejectContentResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.RejectContentResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentResponse.g.cs new file mode 100644 index 0000000..e7dbc27 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.RejectContentResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Execution result + /// + public sealed partial class RejectContentResponse + { + /// + /// Whether the action was executed successfully + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Success { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the action was executed successfully + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RejectContentResponse( + bool success) + { + this.Success = success; + } + + /// + /// Initializes a new instance of the class. + /// + public RejectContentResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorRequest.Json.g.cs new file mode 100644 index 0000000..e47328f --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class SuspendAuthorRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.SuspendAuthorRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.SuspendAuthorRequest), + jsonSerializerContext) as global::ModerationAPI.SuspendAuthorRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.SuspendAuthorRequest? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.SuspendAuthorRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.SuspendAuthorRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.SuspendAuthorRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorRequest.g.cs new file mode 100644 index 0000000..5b9f6e2 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorRequest.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class SuspendAuthorRequest + { + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// How long the suspension lasts, in milliseconds. Defaults to 24 hours. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public double? Duration { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + /// + /// How long the suspension lasts, in milliseconds. Defaults to 24 hours. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SuspendAuthorRequest( + string? reason, + double? duration) + { + this.Reason = reason; + this.Duration = duration; + } + + /// + /// Initializes a new instance of the class. + /// + public SuspendAuthorRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorResponse.Json.g.cs new file mode 100644 index 0000000..ca3a9a5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class SuspendAuthorResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.SuspendAuthorResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.SuspendAuthorResponse), + jsonSerializerContext) as global::ModerationAPI.SuspendAuthorResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.SuspendAuthorResponse? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.SuspendAuthorResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.SuspendAuthorResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.SuspendAuthorResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorResponse.g.cs new file mode 100644 index 0000000..ff927a1 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.SuspendAuthorResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Execution result + /// + public sealed partial class SuspendAuthorResponse + { + /// + /// Whether the action was executed successfully + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Success { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the action was executed successfully + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SuspendAuthorResponse( + bool success) + { + this.Success = success; + } + + /// + /// Initializes a new instance of the class. + /// + public SuspendAuthorResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorRequest.Json.g.cs new file mode 100644 index 0000000..d40f9ce --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class UnblockAuthorRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.UnblockAuthorRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.UnblockAuthorRequest), + jsonSerializerContext) as global::ModerationAPI.UnblockAuthorRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.UnblockAuthorRequest? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.UnblockAuthorRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.UnblockAuthorRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.UnblockAuthorRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorRequest.g.cs new file mode 100644 index 0000000..a5228ca --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class UnblockAuthorRequest + { + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Why the action was taken. Saved with the action and sent in the webhook event. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UnblockAuthorRequest( + string? reason) + { + this.Reason = reason; + } + + /// + /// Initializes a new instance of the class. + /// + public UnblockAuthorRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorResponse.Json.g.cs new file mode 100644 index 0000000..e184752 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class UnblockAuthorResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.UnblockAuthorResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.UnblockAuthorResponse), + jsonSerializerContext) as global::ModerationAPI.UnblockAuthorResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.UnblockAuthorResponse? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.UnblockAuthorResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.UnblockAuthorResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.UnblockAuthorResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorResponse.g.cs new file mode 100644 index 0000000..218f17e --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.UnblockAuthorResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Execution result + /// + public sealed partial class UnblockAuthorResponse + { + /// + /// Whether the action was executed successfully + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Success { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Whether the action was executed successfully + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UnblockAuthorResponse( + bool success) + { + this.Success = success; + } + + /// + /// Initializes a new instance of the class. + /// + public UnblockAuthorResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs index 5589edb..791edee 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs @@ -58,17 +58,15 @@ partial void ProcessNewModerateModerateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.content.submit({
- /// body: {
- /// content: {
- /// type: "text",
- /// text: "Hey, check out my profile for a deal!",
- /// },
- /// contentId: "message-48213",
- /// authorId: "user-1092",
- /// conversationId: "room-general",
- /// metadata: {
- /// "platform": "ios",
- /// },
+ /// content: {
+ /// type: "text",
+ /// text: "Hey, check out my profile for a deal!",
+ /// },
+ /// contentId: "message-48213",
+ /// authorId: "user-1092",
+ /// conversationId: "room-general",
+ /// metadata: {
+ /// "platform": "ios",
/// },
/// });
/// console.log(result);
@@ -107,17 +105,15 @@ partial void ProcessNewModerateModerateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.content.submit({
- /// body: {
- /// content: {
- /// type: "text",
- /// text: "Hey, check out my profile for a deal!",
- /// },
- /// contentId: "message-48213",
- /// authorId: "user-1092",
- /// conversationId: "room-general",
- /// metadata: {
- /// "platform": "ios",
- /// },
+ /// content: {
+ /// type: "text",
+ /// text: "Hey, check out my profile for a deal!",
+ /// },
+ /// contentId: "message-48213",
+ /// authorId: "user-1092",
+ /// conversationId: "room-general",
+ /// metadata: {
+ /// "platform": "ios",
/// },
/// });
/// console.log(result);
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs index 153e04e..81849ec 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs @@ -83,6 +83,15 @@ public sealed partial class ModerationAPIClient : global::ModerationAPI.IModerat JsonSerializerContextProvider = JsonSerializerContextProvider, }; + /// + /// + /// + public AuthorsClient Authors => new AuthorsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + /// /// Channels in a project. Needs an organization key. /// @@ -92,6 +101,15 @@ public sealed partial class ModerationAPIClient : global::ModerationAPI.IModerat JsonSerializerContextProvider = JsonSerializerContextProvider, }; + /// + /// + /// + public ContentClient Content => new ContentClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + /// /// /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsApiKeysClient.Create.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsApiKeysClient.Create.g.cs index 01ad4a9..ebe043d 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsApiKeysClient.Create.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsApiKeysClient.Create.g.cs @@ -60,10 +60,7 @@ partial void ProcessCreateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.apiKeys.create({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.apiKeys.create("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -102,10 +99,7 @@ partial void ProcessCreateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.apiKeys.create({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.apiKeys.create("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDelete.g.cs index c9e28b3..0605ac4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDelete.g.cs @@ -57,9 +57,7 @@ partial void ProcessManagementProjectsDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -93,9 +91,7 @@ partial void ProcessManagementProjectsDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDuplicate.g.cs index 23b97b1..b9582ba 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDuplicate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDuplicate.g.cs @@ -60,10 +60,7 @@ partial void ProcessManagementProjectsDuplicateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -102,10 +99,7 @@ partial void ProcessManagementProjectsDuplicateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.duplicate({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.duplicate("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsGet.g.cs index 70299c1..0ee41bb 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsGet.g.cs @@ -57,9 +57,7 @@ partial void ProcessManagementProjectsGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -93,9 +91,7 @@ partial void ProcessManagementProjectsGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.projects.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsList.g.cs index 632439c..8a9d8d8 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsList.g.cs @@ -64,7 +64,7 @@ partial void ProcessManagementProjectsListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.list({});
+ /// const result = await moderationApi.projects.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -107,7 +107,7 @@ partial void ProcessManagementProjectsListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.list({});
+ /// const result = await moderationApi.projects.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsUpdate.g.cs index 33931cc..06af632 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsUpdate.g.cs @@ -60,10 +60,7 @@ partial void ProcessManagementProjectsUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -102,10 +99,7 @@ partial void ProcessManagementProjectsUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.projects.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.projects.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.QueueClient.List.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.QueueClient.List.g.cs index d3ca6b5..8b4e4e1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.QueueClient.List.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.QueueClient.List.g.cs @@ -67,7 +67,7 @@ partial void ProcessListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.list({});
+ /// const result = await moderationApi.queue.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -113,7 +113,7 @@ partial void ProcessListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.list({});
+ /// const result = await moderationApi.queue.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.QueueItemsClient.ResolveMany.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.QueueItemsClient.ResolveMany.g.cs index 882ca3a..a3f767e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.QueueItemsClient.ResolveMany.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.QueueItemsClient.ResolveMany.g.cs @@ -63,14 +63,11 @@ partial void ProcessResolveManyResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolveMany({
- /// id: "<id>",
- /// body: {
- /// itemIds: [
- /// "clx8k2v0e000108l4a9bz3f7q",
- /// "clx8k2v0e000208l4h2mc6d1r",
- /// ],
- /// },
+ /// const result = await moderationApi.queue.items.resolveMany("<id>", {
+ /// itemIds: [
+ /// "clx8k2v0e000108l4a9bz3f7q",
+ /// "clx8k2v0e000208l4h2mc6d1r",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -113,14 +110,11 @@ partial void ProcessResolveManyResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolveMany({
- /// id: "<id>",
- /// body: {
- /// itemIds: [
- /// "clx8k2v0e000108l4a9bz3f7q",
- /// "clx8k2v0e000208l4h2mc6d1r",
- /// ],
- /// },
+ /// const result = await moderationApi.queue.items.resolveMany("<id>", {
+ /// itemIds: [
+ /// "clx8k2v0e000108l4a9bz3f7q",
+ /// "clx8k2v0e000208l4h2mc6d1r",
+ /// ],
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetQueue.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetQueue.g.cs index 0492e4f..cfee54e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetQueue.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetQueue.g.cs @@ -60,9 +60,7 @@ partial void ProcessQueueViewOpenGetQueueResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessQueueViewOpenGetQueueResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetStats.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetStats.g.cs index c6b1a91..d6602d1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetStats.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenGetStats.g.cs @@ -66,9 +66,7 @@ partial void ProcessQueueViewOpenGetStatsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.getStats({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.getStats("<id>");
/// console.log(result);
/// }
/// run(); @@ -111,9 +109,7 @@ partial void ProcessQueueViewOpenGetStatsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.getStats({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.queue.getStats("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenResolveItem.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenResolveItem.g.cs index 4fdc73b..621fef0 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenResolveItem.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenResolveItem.g.cs @@ -65,10 +65,7 @@ partial void ProcessQueueViewOpenResolveItemResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.resolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); @@ -110,10 +107,7 @@ partial void ProcessQueueViewOpenResolveItemResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.resolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.resolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs index 891c5d3..de5ac3e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueuesClient.QueueViewOpenUnresolveItem.g.cs @@ -65,10 +65,7 @@ partial void ProcessQueueViewOpenUnresolveItemResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.unresolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.unresolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); @@ -110,10 +107,7 @@ partial void ProcessQueueViewOpenUnresolveItemResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.queue.items.unresolve({
- /// id: "<id>",
- /// itemId: "<id>",
- /// });
+ /// const result = await moderationApi.queue.items.unresolve("<id>", "<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicCreate.g.cs index a832f99..08ce9ac 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicCreate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicCreate.g.cs @@ -59,14 +59,12 @@ partial void ProcessWebhooksPublicCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.webhooks.create({
- /// body: {
- /// name: "Moderation events",
- /// url: "https://example.com/webhooks/moderation",
- /// eventTypes: [
- /// "QUEUE_ITEM_REJECTED",
- /// "AUTHOR_BLOCKED",
- /// ],
- /// },
+ /// name: "Moderation events",
+ /// url: "https://example.com/webhooks/moderation",
+ /// eventTypes: [
+ /// "QUEUE_ITEM_REJECTED",
+ /// "AUTHOR_BLOCKED",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -105,14 +103,12 @@ partial void ProcessWebhooksPublicCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.webhooks.create({
- /// body: {
- /// name: "Moderation events",
- /// url: "https://example.com/webhooks/moderation",
- /// eventTypes: [
- /// "QUEUE_ITEM_REJECTED",
- /// "AUTHOR_BLOCKED",
- /// ],
- /// },
+ /// name: "Moderation events",
+ /// url: "https://example.com/webhooks/moderation",
+ /// eventTypes: [
+ /// "QUEUE_ITEM_REJECTED",
+ /// "AUTHOR_BLOCKED",
+ /// ],
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicDelete.g.cs index 8dc63e8..7b622a2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicDelete.g.cs @@ -60,9 +60,7 @@ partial void ProcessWebhooksPublicDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.delete("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessWebhooksPublicDeleteResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.delete({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.delete("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGet.g.cs index e57cc1a..e0fa457 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGet.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGet.g.cs @@ -60,9 +60,7 @@ partial void ProcessWebhooksPublicGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessWebhooksPublicGetResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.webhooks.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicList.g.cs index a696cc8..ea12299 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicList.g.cs @@ -67,7 +67,7 @@ partial void ProcessWebhooksPublicListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.list({});
+ /// const result = await moderationApi.webhooks.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -113,7 +113,7 @@ partial void ProcessWebhooksPublicListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.list({});
+ /// const result = await moderationApi.webhooks.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicUpdate.g.cs index d167cfb..74ee5d0 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicUpdate.g.cs @@ -63,10 +63,7 @@ partial void ProcessWebhooksPublicUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.webhooks.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -108,10 +105,7 @@ partial void ProcessWebhooksPublicUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.webhooks.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.webhooks.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.Create.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.Create.g.cs index df77b00..a5e8627 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.Create.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.Create.g.cs @@ -59,9 +59,7 @@ partial void ProcessCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.wordlist.create({
- /// body: {
- /// name: "<value>",
- /// },
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
@@ -100,9 +98,7 @@ partial void ProcessCreateResponseContent( /// });
/// async function run() {
/// const result = await moderationApi.wordlist.create({
- /// body: {
- /// name: "<value>",
- /// },
+ /// name: "<value>",
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistAddWords.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistAddWords.g.cs index c090170..a8f6845 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistAddWords.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistAddWords.g.cs @@ -63,14 +63,11 @@ partial void ProcessWordlistAddWordsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.add({
- /// id: "<id>",
- /// body: {
- /// words: [
- /// "free money",
- /// "click here",
- /// ],
- /// },
+ /// const result = await moderationApi.wordlist.words.add("<id>", {
+ /// words: [
+ /// "free money",
+ /// "click here",
+ /// ],
/// });
/// console.log(result);
/// }
@@ -113,14 +110,11 @@ partial void ProcessWordlistAddWordsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.add({
- /// id: "<id>",
- /// body: {
- /// words: [
- /// "free money",
- /// "click here",
- /// ],
- /// },
+ /// const result = await moderationApi.wordlist.words.add("<id>", {
+ /// words: [
+ /// "free money",
+ /// "click here",
+ /// ],
/// });
/// console.log(result);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistGetWordlistPublic.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistGetWordlistPublic.g.cs index 79b8dd3..3c64c64 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistGetWordlistPublic.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistGetWordlistPublic.g.cs @@ -60,9 +60,7 @@ partial void ProcessWordlistGetWordlistPublicResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.retrieve("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessWordlistGetWordlistPublicResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.retrieve({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.retrieve("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistList.g.cs index e7db817..2394a9c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistList.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistList.g.cs @@ -67,7 +67,7 @@ partial void ProcessWordlistListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.list({});
+ /// const result = await moderationApi.wordlist.list();
/// for await (const page of result) {
/// console.log(page);
/// }
@@ -113,7 +113,7 @@ partial void ProcessWordlistListResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.list({});
+ /// const result = await moderationApi.wordlist.list();
/// for await (const page of result) {
/// console.log(page);
/// }
diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistRemoveWords.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistRemoveWords.g.cs index 8875421..4d16a99 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistRemoveWords.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistRemoveWords.g.cs @@ -65,14 +65,11 @@ partial void ProcessWordlistRemoveWordsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.remove({
- /// id: "<id>",
- /// words: [
- /// "<value 1>",
- /// "<value 2>",
- /// "<value 3>",
- /// ],
- /// });
+ /// const result = await moderationApi.wordlist.words.remove("<id>", [
+ /// "<value 1>",
+ /// "<value 2>",
+ /// "<value 3>",
+ /// ]);
/// console.log(result);
/// }
/// run(); @@ -114,14 +111,11 @@ partial void ProcessWordlistRemoveWordsResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.words.remove({
- /// id: "<id>",
- /// words: [
- /// "<value 1>",
- /// "<value 2>",
- /// "<value 3>",
- /// ],
- /// });
+ /// const result = await moderationApi.wordlist.words.remove("<id>", [
+ /// "<value 1>",
+ /// "<value 2>",
+ /// "<value 3>",
+ /// ]);
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistUpdate.g.cs index 2caa1a0..8397a5d 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistUpdate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistUpdate.g.cs @@ -63,10 +63,7 @@ partial void ProcessWordlistUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.wordlist.update("<id>", {});
/// console.log(result);
/// }
/// run(); @@ -108,10 +105,7 @@ partial void ProcessWordlistUpdateResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.update({
- /// id: "<id>",
- /// body: {},
- /// });
+ /// const result = await moderationApi.wordlist.update("<id>", {});
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistWordlistEmbeddingStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistWordlistEmbeddingStatus.g.cs index 3aceab6..36260ca 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistWordlistEmbeddingStatus.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WordlistClient.WordlistWordlistEmbeddingStatus.g.cs @@ -60,9 +60,7 @@ partial void ProcessWordlistWordlistEmbeddingStatusResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.getEmbeddingStatus({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.getEmbeddingStatus("<id>");
/// console.log(result);
/// }
/// run(); @@ -99,9 +97,7 @@ partial void ProcessWordlistWordlistEmbeddingStatusResponseContent( /// secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
/// });
/// async function run() {
- /// const result = await moderationApi.wordlist.getEmbeddingStatus({
- /// id: "<id>",
- /// });
+ /// const result = await moderationApi.wordlist.getEmbeddingStatus("<id>");
/// console.log(result);
/// }
/// run(); diff --git a/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json b/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json index 33f8895..412b705 100644 --- a/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json +++ b/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json @@ -57,6 +57,28 @@ }, { "Order": 6, + "Title": "Suspend author", + "Slug": "suspendauthor", + "Description": "Block an author for a limited time with the built-in suspend action.", + "Language": "http", + "Code": "### Suspend author\n# @name suspendAuthor\nPOST {{host}}/authors/{{id}}/suspend\nAuthorization: Bearer {{token}}\nProject-Id: {{Project-Id}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022reason\u0022: \u0022Violation of community guidelines\u0022,\n \u0022duration\u0022: 604800000\n}\n\n## Responses\n# 200\n# Description: Action executed successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json\n# 429\n# Description: Too many requests. Retry after the number of seconds in the \u0060Retry-After\u0060 header.\n# Content-Type: application/json", + "Format": "http", + "OperationId": "suspendAuthor", + "Setup": null + }, + { + "Order": 7, + "Title": "Reject content", + "Slug": "rejectcontent", + "Description": "Reject a content item with the built-in reject action, and resolve it in the review queue.", + "Language": "http", + "Code": "### Reject content\n# @name rejectContent\nPOST {{host}}/content/{{id}}/reject\nAuthorization: Bearer {{token}}\nProject-Id: {{Project-Id}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022reason\u0022: \u0022Spam\u0022\n}\n\n## Responses\n# 200\n# Description: Action executed successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json\n# 429\n# Description: Too many requests. Retry after the number of seconds in the \u0060Retry-After\u0060 header.\n# Content-Type: application/json", + "Format": "http", + "OperationId": "rejectContent", + "Setup": null + }, + { + "Order": 8, "Title": "Send feedback", "Slug": "createfeedback", "Description": "Sends a feature request, bug report or other feedback to the Moderation API team. The team reads every request and can reply by email. Limited to 5 requests per minute per organization.", @@ -67,7 +89,7 @@ "Setup": "This example assumes \u0060using ModerationAPI;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 7, + "Order": 9, "Title": "Resolve queue items", "Slug": "resolvequeueitems", "Description": "Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with \u0060POST /queue/{id}/items/{itemId}/resolve\u0060. IDs that do not exist in the project are skipped and returned in \u0060notFoundIds\u0060.", @@ -78,7 +100,7 @@ "Setup": null }, { - "Order": 8, + "Order": 10, "Title": "Create a webhook", "Slug": "webhooks-publiccreate", "Description": "Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint).", @@ -89,7 +111,7 @@ "Setup": "This example assumes \u0060using ModerationAPI;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 9, + "Order": 11, "Title": "Add words to wordlist", "Slug": "wordlist-addwords", "Description": "Add words to an existing wordlist", diff --git a/src/libs/ModerationAPI/openapi.yaml b/src/libs/ModerationAPI/openapi.yaml index 0339cd1..b645479 100644 --- a/src/libs/ModerationAPI/openapi.yaml +++ b/src/libs/ModerationAPI/openapi.yaml @@ -408,7 +408,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.summary({});\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.summary();\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -640,7 +640,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.policies({});\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.policies();\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -874,7 +874,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.authors({});\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.authors();\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -1091,7 +1091,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.channels({});\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.channels();\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -1333,7 +1333,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.volumes({});\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.volumes();\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -1622,7 +1622,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.automation({});\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.analytics.automation();\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -2129,7 +2129,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.create({\n body: {\n name: \"Jamie Rivera\",\n email: \"jamie@example.com\",\n metadata: {\n emailVerified: true,\n isPayingCustomer: false,\n },\n externalId: \"user-1092\",\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.create({\n name: \"Jamie Rivera\",\n email: \"jamie@example.com\",\n metadata: {\n emailVerified: true,\n isPayingCustomer: false,\n },\n externalId: \"user-1092\",\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -2281,7 +2281,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.retrieve({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.retrieve(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -2555,7 +2555,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.update({\n id: \"\",\n body: {\n metadata: {\n identityVerified: true,\n },\n manualTrustLevel: 2,\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.update(\"\", {\n metadata: {\n identityVerified: true,\n },\n manualTrustLevel: 2,\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -2714,7 +2714,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.delete({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.delete(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -2899,7 +2899,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.feedback.create({\n body: {\n title: \"Filter queue items by author trust level\",\n description: \"We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.\",\n source: \"mcp\",\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.feedback.create({\n title: \"Filter queue items by author trust level\",\n description: \"We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.\",\n source: \"mcp\",\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -3101,7 +3101,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.list({});\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.list();\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" }, { "lang": "python", @@ -3262,7 +3262,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.retrieve({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.retrieve(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -3515,7 +3515,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.getStats({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.getStats(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -3962,7 +3962,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.items.resolve({\n id: \"\",\n itemId: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.items.resolve(\"\", \"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -4154,7 +4154,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.items.resolveMany({\n id: \"\",\n body: {\n itemIds: [\n \"clx8k2v0e000108l4a9bz3f7q\",\n \"clx8k2v0e000208l4h2mc6d1r\",\n ],\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.items.resolveMany(\"\", {\n itemIds: [\n \"clx8k2v0e000108l4a9bz3f7q\",\n \"clx8k2v0e000208l4h2mc6d1r\",\n ],\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -4329,7 +4329,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.items.unresolve({\n id: \"\",\n itemId: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.queue.items.unresolve(\"\", \"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -4664,7 +4664,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.list({});\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.list();\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" }, { "lang": "python", @@ -5037,7 +5037,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.create({\n body: {\n key: \"suspend-24h\",\n name: \"Suspend for 24 hours\",\n type: \"AUTHOR_BLOCK_TEMP\",\n queueBehaviour: \"REMOVE\",\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.create({\n key: \"suspend-24h\",\n name: \"Suspend for 24 hours\",\n type: \"AUTHOR_BLOCK_TEMP\",\n queueBehaviour: \"REMOVE\",\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -5297,7 +5297,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.retrieve({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.retrieve(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -5681,7 +5681,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.update({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.update(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -5826,7 +5826,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.delete({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.delete(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -5913,6 +5913,14 @@ "description": "Optional duration in milliseconds for actions with timeouts", "type": "number", "minimum": 0 + }, + "moderator": { + "description": "The user ID or email of the organization member who made the decision. The action is recorded as theirs.", + "type": "string" + }, + "createCasebookCase": { + "description": "Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System.", + "type": "boolean" } }, "required": [ @@ -6012,7 +6020,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.execute({\n body: {\n actionKey: \"suspend-24h\",\n authorIds: [\n \"user-1092\",\n ],\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.actions.execute({\n actionKey: \"suspend-24h\",\n authorIds: [\n \"user-1092\",\n ],\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -6193,6 +6201,847 @@ "x-speakeasy-ignore": true } }, + "/content/{id}/reject": { + "post": { + "operationId": "rejectContent", + "summary": "Reject content", + "description": "Reject a content item with the built-in reject action, and resolve it in the review queue.", + "tags": [ + "Content" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + "required": true, + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + }, + "queueId": { + "description": "The queue the content is reviewed in. Defaults to the project's default queue.", + "type": "string" + }, + "moderator": { + "description": "The user ID or email of the organization member who made the decision. The action is recorded as theirs.", + "type": "string" + }, + "createCasebookCase": { + "description": "Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System.", + "type": "boolean" + } + } + }, + "example": { + "reason": "Spam" + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying.", + "schema": { + "type": "integer" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "content", + "x-speakeasy-name-override": "reject", + "x-speakeasy-mcp": { + "title": "Reject content", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript", + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.content.reject(\"\", {\n reason: \"Spam\",\n });\n\n console.log(result);\n}\n\nrun();\n" + }, + { + "lang": "python", + "label": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\n\nwith ModerationAPI(\n secret_key=os.environ[\"MODAPI_SECRET_KEY\"],\n) as moderation_api:\n\n res = moderation_api.content.reject(id=\"\", reason=\"Spam\")\n\n # Handle response\n print(res)\n" + }, + { + "lang": "php", + "label": "PHP", + "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse ModerationApi;\nuse ModerationApi\\Models\\Operations;\n\n$sdk = ModerationApi\\ModerationApi::builder()\n ->setSecurity(\n getenv('MODAPI_SECRET_KEY')\n )\n ->build();\n\n$body = new Operations\\RejectContentRequestBody(\n reason: 'Spam',\n);\n\n$response = $sdk->content->reject(\n id: '',\n body: $body\n\n);\n\nif ($response->object !== null) {\n // handle response\n}\n" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require 'moderation_api'\n\nModels = ::ModerationApi::Models\ns = ::ModerationApi::ModerationApi.new(\n secret_key: ENV.fetch('MODAPI_SECRET_KEY')\n)\nres = s.content.reject(id: '', body: Models::Operations::RejectContentRequestBody.new(\n reason: 'Spam'\n))\n\nunless res.object.nil?\n # handle response\nend\n" + }, + { + "lang": "bash", + "label": "CLI", + "source": "modapi content reject --secret-key \"$MODAPI_SECRET_KEY\" --id '' --reason Spam\n" + } + ] + } + }, + "/content/{id}/allow": { + "post": { + "operationId": "allowContent", + "summary": "Allow content", + "description": "Allow a content item with the built-in allow action, and resolve it in the review queue.", + "tags": [ + "Content" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + "required": true, + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + }, + "queueId": { + "description": "The queue the content is reviewed in. Defaults to the project's default queue.", + "type": "string" + }, + "moderator": { + "description": "The user ID or email of the organization member who made the decision. The action is recorded as theirs.", + "type": "string" + }, + "createCasebookCase": { + "description": "Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying.", + "schema": { + "type": "integer" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "content", + "x-speakeasy-name-override": "allow", + "x-speakeasy-mcp": { + "title": "Allow content", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript", + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.content.allow(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" + }, + { + "lang": "python", + "label": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\n\nwith ModerationAPI(\n secret_key=os.environ[\"MODAPI_SECRET_KEY\"],\n) as moderation_api:\n\n res = moderation_api.content.allow(id=\"\")\n\n # Handle response\n print(res)\n" + }, + { + "lang": "php", + "label": "PHP", + "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse ModerationApi;\nuse ModerationApi\\Models\\Operations;\n\n$sdk = ModerationApi\\ModerationApi::builder()\n ->setSecurity(\n getenv('MODAPI_SECRET_KEY')\n )\n ->build();\n\n$body = new Operations\\AllowContentRequestBody();\n\n$response = $sdk->content->allow(\n id: '',\n body: $body\n\n);\n\nif ($response->object !== null) {\n // handle response\n}\n" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require 'moderation_api'\n\nModels = ::ModerationApi::Models\ns = ::ModerationApi::ModerationApi.new(\n secret_key: ENV.fetch('MODAPI_SECRET_KEY')\n)\nres = s.content.allow(id: '', body: Models::Operations::AllowContentRequestBody.new)\n\nunless res.object.nil?\n # handle response\nend\n" + }, + { + "lang": "bash", + "label": "CLI", + "source": "modapi content allow --secret-key \"$MODAPI_SECRET_KEY\" --id ''\n" + } + ] + } + }, + "/authors/{id}/block": { + "post": { + "operationId": "blockAuthor", + "summary": "Block author", + "description": "Block an author with the built-in block action. A blocked author cannot post new content until unblocked.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying.", + "schema": { + "type": "integer" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "block", + "x-speakeasy-mcp": { + "title": "Block author", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript", + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.block(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" + }, + { + "lang": "python", + "label": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\n\nwith ModerationAPI(\n secret_key=os.environ[\"MODAPI_SECRET_KEY\"],\n) as moderation_api:\n\n res = moderation_api.authors.block(id=\"\")\n\n # Handle response\n print(res)\n" + }, + { + "lang": "php", + "label": "PHP", + "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse ModerationApi;\nuse ModerationApi\\Models\\Operations;\n\n$sdk = ModerationApi\\ModerationApi::builder()\n ->setSecurity(\n getenv('MODAPI_SECRET_KEY')\n )\n ->build();\n\n$body = new Operations\\BlockAuthorRequestBody();\n\n$response = $sdk->authors->block(\n id: '',\n body: $body\n\n);\n\nif ($response->object !== null) {\n // handle response\n}\n" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require 'moderation_api'\n\nModels = ::ModerationApi::Models\ns = ::ModerationApi::ModerationApi.new(\n secret_key: ENV.fetch('MODAPI_SECRET_KEY')\n)\nres = s.authors.block(id: '', body: Models::Operations::BlockAuthorRequestBody.new)\n\nunless res.object.nil?\n # handle response\nend\n" + }, + { + "lang": "bash", + "label": "CLI", + "source": "modapi authors block --secret-key \"$MODAPI_SECRET_KEY\" --id ''\n" + } + ] + } + }, + "/authors/{id}/suspend": { + "post": { + "operationId": "suspendAuthor", + "summary": "Suspend author", + "description": "Block an author for a limited time with the built-in suspend action.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + }, + "duration": { + "description": "How long the suspension lasts, in milliseconds. Defaults to 24 hours.", + "type": "number", + "minimum": 0 + } + } + }, + "example": { + "reason": "Violation of community guidelines", + "duration": 604800000 + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying.", + "schema": { + "type": "integer" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "suspend", + "x-speakeasy-mcp": { + "title": "Suspend author", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript", + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.suspend(\"\", {\n reason: \"Violation of community guidelines\",\n duration: 604800000,\n });\n\n console.log(result);\n}\n\nrun();\n" + }, + { + "lang": "python", + "label": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\n\nwith ModerationAPI(\n secret_key=os.environ[\"MODAPI_SECRET_KEY\"],\n) as moderation_api:\n\n res = moderation_api.authors.suspend(id=\"\", reason=\"Violation of community guidelines\", duration=604800000)\n\n # Handle response\n print(res)\n" + }, + { + "lang": "php", + "label": "PHP", + "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse ModerationApi;\nuse ModerationApi\\Models\\Operations;\n\n$sdk = ModerationApi\\ModerationApi::builder()\n ->setSecurity(\n getenv('MODAPI_SECRET_KEY')\n )\n ->build();\n\n$body = new Operations\\SuspendAuthorRequestBody(\n reason: 'Violation of community guidelines',\n duration: 604800000,\n);\n\n$response = $sdk->authors->suspend(\n id: '',\n body: $body\n\n);\n\nif ($response->object !== null) {\n // handle response\n}\n" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require 'moderation_api'\n\nModels = ::ModerationApi::Models\ns = ::ModerationApi::ModerationApi.new(\n secret_key: ENV.fetch('MODAPI_SECRET_KEY')\n)\nres = s.authors.suspend(id: '', body: Models::Operations::SuspendAuthorRequestBody.new(\n reason: 'Violation of community guidelines',\n duration: 604_800_000.0\n))\n\nunless res.object.nil?\n # handle response\nend\n" + }, + { + "lang": "bash", + "label": "CLI", + "source": "modapi authors suspend --secret-key \"$MODAPI_SECRET_KEY\" --id '' --reason 'Violation of community guidelines' --duration 604800000\n" + } + ] + } + }, + "/authors/{id}/unblock": { + "post": { + "operationId": "unblockAuthor", + "summary": "Unblock author", + "description": "Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying.", + "schema": { + "type": "integer" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "unblock", + "x-speakeasy-mcp": { + "title": "Unblock author", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + }, + "x-codeSamples": [ + { + "lang": "typescript", + "label": "TypeScript", + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.authors.unblock(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" + }, + { + "lang": "python", + "label": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\n\nwith ModerationAPI(\n secret_key=os.environ[\"MODAPI_SECRET_KEY\"],\n) as moderation_api:\n\n res = moderation_api.authors.unblock(id=\"\")\n\n # Handle response\n print(res)\n" + }, + { + "lang": "php", + "label": "PHP", + "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse ModerationApi;\nuse ModerationApi\\Models\\Operations;\n\n$sdk = ModerationApi\\ModerationApi::builder()\n ->setSecurity(\n getenv('MODAPI_SECRET_KEY')\n )\n ->build();\n\n$body = new Operations\\UnblockAuthorRequestBody();\n\n$response = $sdk->authors->unblock(\n id: '',\n body: $body\n\n);\n\nif ($response->object !== null) {\n // handle response\n}\n" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require 'moderation_api'\n\nModels = ::ModerationApi::Models\ns = ::ModerationApi::ModerationApi.new(\n secret_key: ENV.fetch('MODAPI_SECRET_KEY')\n)\nres = s.authors.unblock(id: '', body: Models::Operations::UnblockAuthorRequestBody.new)\n\nunless res.object.nil?\n # handle response\nend\n" + }, + { + "lang": "bash", + "label": "CLI", + "source": "modapi authors unblock --secret-key \"$MODAPI_SECRET_KEY\" --id ''\n" + } + ] + } + }, "/webhooks": { "get": { "operationId": "webhooks-publicList", @@ -6391,7 +7240,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.list({});\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.list();\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" }, { "lang": "python", @@ -6627,7 +7476,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.create({\n body: {\n name: \"Moderation events\",\n url: \"https://example.com/webhooks/moderation\",\n eventTypes: [\n \"QUEUE_ITEM_REJECTED\",\n \"AUTHOR_BLOCKED\",\n ],\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.create({\n name: \"Moderation events\",\n url: \"https://example.com/webhooks/moderation\",\n eventTypes: [\n \"QUEUE_ITEM_REJECTED\",\n \"AUTHOR_BLOCKED\",\n ],\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -6812,7 +7661,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.retrieve({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.retrieve(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -7055,7 +7904,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.update({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.update(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -7190,7 +8039,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.delete({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.webhooks.delete(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -8517,7 +9366,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.list({});\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.list();\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" }, { "lang": "python", @@ -8722,7 +9571,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.create({\n body: {\n name: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.create({\n name: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -8931,7 +9780,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.retrieve({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.retrieve(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -9153,7 +10002,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.update({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.update(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -9326,7 +10175,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.getEmbeddingStatus({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.getEmbeddingStatus(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -9509,7 +10358,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.words.add({\n id: \"\",\n body: {\n words: [\n \"free money\",\n \"click here\",\n ],\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.words.add(\"\", {\n words: [\n \"free money\",\n \"click here\",\n ],\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -9675,7 +10524,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.words.remove({\n id: \"\",\n words: [\n \"\",\n \"\",\n \"\",\n ],\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.wordlist.words.remove(\"\", [\n \"\",\n \"\",\n \"\",\n ]);\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -10825,13 +11674,15 @@ "const": "unicode_spoofing" }, "signals": { - "description": "Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy.", + "description": "Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled.", "type": "object", "propertyNames": { "type": "string", "enum": [ "mixed_script", "confusable_word", + "hidden_lookalike", + "leetspeak", "invisible", "zalgo", "illegal", @@ -12103,7 +12954,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.content.submit({\n body: {\n content: {\n type: \"text\",\n text: \"Hey, check out my profile for a deal!\",\n },\n contentId: \"message-48213\",\n authorId: \"user-1092\",\n conversationId: \"room-general\",\n metadata: {\n \"platform\": \"ios\",\n },\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.content.submit({\n content: {\n type: \"text\",\n text: \"Hey, check out my profile for a deal!\",\n },\n contentId: \"message-48213\",\n authorId: \"user-1092\",\n conversationId: \"room-general\",\n metadata: {\n \"platform\": \"ios\",\n },\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -12263,7 +13114,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.list({});\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.list();\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" }, { "lang": "python", @@ -12535,7 +13386,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.retrieve({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.retrieve(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -12735,7 +13586,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.update({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.update(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -12870,7 +13721,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.delete({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.delete(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -13020,7 +13871,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.duplicate({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.duplicate(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -13173,7 +14024,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.apiKeys.create({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.projects.apiKeys.create(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -13353,7 +14204,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.list({\n projectId: \"\",\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.list(\"\");\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();\n" }, { "lang": "python", @@ -13531,7 +14382,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.create({\n projectId: \"\",\n body: {\n name: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.create(\"\", {\n name: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -13653,7 +14504,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.retrieve({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.retrieve(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -13896,7 +14747,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.update({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.update(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -14041,7 +14892,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.delete({\n id: \"\",\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.delete(\"\");\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python", @@ -14198,7 +15049,7 @@ { "lang": "typescript", "label": "TypeScript", - "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.duplicate({\n id: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();\n" + "source": "import { ModerationApi } from \"@moderation-api/sdk\";\n\nconst moderationApi = new ModerationApi({\n secretKey: process.env[\"MODAPI_SECRET_KEY\"] ?? \"\",\n});\n\nasync function run() {\n const result = await moderationApi.channels.duplicate(\"\", {});\n\n console.log(result);\n}\n\nrun();\n" }, { "lang": "python",