@maxim_mazurok/gapi.client.language-v1 0.0.20230520 → 0.0.20230603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://language.googleapis.com/$discovery/rest?version=v1
12
- // Revision: 20230520
12
+ // Revision: 20230603
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -131,6 +131,9 @@ declare namespace gapi.client {
131
131
  */
132
132
  language?:
133
133
  string;
134
+ /** Harmful and sensitive categories identified in the input document. */
135
+ moderationCategories?:
136
+ ClassificationCategory[];
134
137
  /** Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax. */
135
138
  sentences?:
136
139
  Sentence[];
@@ -261,6 +264,19 @@ declare namespace gapi.client {
261
264
  /** Extract syntax information. */
262
265
  extractSyntax?:
263
266
  boolean;
267
+ /** Moderate the document for harmful and sensitive categories. */
268
+ moderateText?:
269
+ boolean;
270
+ }
271
+ interface ModerateTextRequest {
272
+ /** Required. Input document. */
273
+ document?:
274
+ Document;
275
+ }
276
+ interface ModerateTextResponse {
277
+ /** Harmful and sensitive categories representing the input document. */
278
+ moderationCategories?:
279
+ ClassificationCategory[];
264
280
  }
265
281
  interface PartOfSpeech {
266
282
  /** The grammatical aspect. */
@@ -811,6 +827,81 @@ declare namespace gapi.client {
811
827
  string;
812
828
  },
813
829
  body: ClassifyTextRequest): Request<ClassifyTextResponse>;
830
+ /** Moderates a document for harmful and sensitive categories. */
831
+ moderateText(request: {
832
+ /** V1 error format. */
833
+ "$.xgafv"?:
834
+ string;
835
+ /** OAuth access token. */
836
+ access_token?:
837
+ string;
838
+ /** Data format for response. */
839
+ alt?:
840
+ string;
841
+ /** JSONP */
842
+ callback?:
843
+ string;
844
+ /** Selector specifying which fields to include in a partial response. */
845
+ fields?:
846
+ string;
847
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
848
+ key?:
849
+ string;
850
+ /** OAuth 2.0 token for the current user. */
851
+ oauth_token?:
852
+ string;
853
+ /** Returns response with indentations and line breaks. */
854
+ prettyPrint?:
855
+ boolean;
856
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
857
+ quotaUser?:
858
+ string;
859
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
860
+ upload_protocol?:
861
+ string;
862
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
863
+ uploadType?:
864
+ string;
865
+ /** Request body */
866
+ resource:
867
+ ModerateTextRequest;
868
+ }): Request<ModerateTextResponse>;
869
+ moderateText(request: {
870
+ /** V1 error format. */
871
+ "$.xgafv"?:
872
+ string;
873
+ /** OAuth access token. */
874
+ access_token?:
875
+ string;
876
+ /** Data format for response. */
877
+ alt?:
878
+ string;
879
+ /** JSONP */
880
+ callback?:
881
+ string;
882
+ /** Selector specifying which fields to include in a partial response. */
883
+ fields?:
884
+ string;
885
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
886
+ key?:
887
+ string;
888
+ /** OAuth 2.0 token for the current user. */
889
+ oauth_token?:
890
+ string;
891
+ /** Returns response with indentations and line breaks. */
892
+ prettyPrint?:
893
+ boolean;
894
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
895
+ quotaUser?:
896
+ string;
897
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
898
+ upload_protocol?:
899
+ string;
900
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
901
+ uploadType?:
902
+ string;
903
+ },
904
+ body: ModerateTextRequest): Request<ModerateTextResponse>;
814
905
  }
815
906
 
816
907
  const documents: DocumentsResource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.language-v1",
3
- "version": "0.0.20230520",
3
+ "version": "0.0.20230603",
4
4
  "description": "TypeScript typings for Cloud Natural Language API v1",
5
5
  "license": "MIT",
6
6
  "author": {
package/readme.md CHANGED
@@ -98,4 +98,9 @@ await gapi.client.language.documents.annotateText({ });
98
98
  Classifies a document into categories.
99
99
  */
100
100
  await gapi.client.language.documents.classifyText({ });
101
+
102
+ /*
103
+ Moderates a document for harmful and sensitive categories.
104
+ */
105
+ await gapi.client.language.documents.moderateText({ });
101
106
  ```
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20230520
6
+ // Revision: 20230603
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -98,6 +98,7 @@ gapi.load('client', async () => {
98
98
  extractEntities: true,
99
99
  extractEntitySentiment: true,
100
100
  extractSyntax: true,
101
+ moderateText: true,
101
102
  },
102
103
  });
103
104
  /** Classifies a document into categories. */
@@ -117,5 +118,15 @@ gapi.load('client', async () => {
117
118
  type: "Test string",
118
119
  },
119
120
  });
121
+ /** Moderates a document for harmful and sensitive categories. */
122
+ await gapi.client.language.documents.moderateText({
123
+ }, {
124
+ document: {
125
+ content: "Test string",
126
+ gcsContentUri: "Test string",
127
+ language: "Test string",
128
+ type: "Test string",
129
+ },
130
+ });
120
131
  }
121
132
  });