@maxim_mazurok/gapi.client.readerrevenuesubscriptionlinking-v1 0.0.20230409

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 ADDED
@@ -0,0 +1,217 @@
1
+ /* Type definitions for non-npm package Reader Revenue Subscription Linking API v1 0.0 */
2
+ // Project: https://developers.google.com/news/subscribe/subscription-linking/overview
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+
8
+ // IMPORTANT
9
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
+ // Generated from: https://readerrevenuesubscriptionlinking.googleapis.com/$discovery/rest?version=v1
12
+ // Revision: 20230409
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Reader Revenue Subscription Linking API v1 */
18
+ function load(urlOrObject: "https://readerrevenuesubscriptionlinking.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
19
+ /** @deprecated Please load APIs with discovery documents. */
20
+ function load(name: "readerrevenuesubscriptionlinking", version: "v1"): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: "readerrevenuesubscriptionlinking", version: "v1", callback: () => any): void;
23
+
24
+ namespace readerrevenuesubscriptionlinking {
25
+ // tslint:disable-next-line:no-empty-interface
26
+ interface DeleteReaderResponse {
27
+ }
28
+ interface Entitlement {
29
+ /**
30
+ * The detail field can carry a description of the SKU that corresponds to what the user has been granted access to. This description, which is opaque to Google, can be displayed in
31
+ * the Google user subscription console for users who linked the subscription to a Google Account. Max 80 character limit.
32
+ */
33
+ detail?: string;
34
+ /**
35
+ * Required. Expiration time of the entitlement. Entitlements that have expired over 30 days will be purged. Required. LINT.IfChange(expire_time) The max expire_time is 398 days from
36
+ * now(). LINT.ThenChange(//depot/google3/java/com/google/subscribewithgoogle/accountlinking/subscriptionlink/service/config/protoconf.pi:max_expiry_age)
37
+ */
38
+ expireTime?: string;
39
+ /**
40
+ * Required. The publication's product ID that the user has access to. This is the same product ID as can be found in Schema.org markup (http://schema.org/productID). E.g.
41
+ * "dailybugle.com:basic"
42
+ */
43
+ productId?: string;
44
+ /** A source-specific subscription token. This is an opaque string that the publisher provides to Google. This token is opaque and has no meaning to Google. */
45
+ subscriptionToken?: string;
46
+ }
47
+ interface Reader {
48
+ /** Output only. Time the publication reader was created and associated with a Google user. */
49
+ createTime?: string;
50
+ /** Output only. The resource name of the reader. The last part of ppid in the resource name is the publisher provided id. */
51
+ name?: string;
52
+ }
53
+ interface ReaderEntitlements {
54
+ /** All of the entitlements for a publication reader. */
55
+ entitlements?: Entitlement[];
56
+ /** Output only. The resource name of the singleton. */
57
+ name?: string;
58
+ }
59
+ interface ReadersResource {
60
+ /**
61
+ * Removes a publication reader, effectively severing the association with a Google user. If `force` is set to true, any entitlements for this reader will also be deleted. (Otherwise,
62
+ * the request will only work if the reader has no entitlements.) - If the reader does not exist, return NOT_FOUND. - Return FAILED_PRECONDITION if the force field is false (or unset)
63
+ * and entitlements are present.
64
+ */
65
+ delete(request?: {
66
+ /** V1 error format. */
67
+ "$.xgafv"?: string;
68
+ /** OAuth access token. */
69
+ access_token?: string;
70
+ /** Data format for response. */
71
+ alt?: string;
72
+ /** JSONP */
73
+ callback?: string;
74
+ /** Selector specifying which fields to include in a partial response. */
75
+ fields?: string;
76
+ /** If set to true, any entitlements under the reader will also be purged. */
77
+ force?: boolean;
78
+ /** 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. */
79
+ key?: string;
80
+ /** Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid} */
81
+ name: string;
82
+ /** OAuth 2.0 token for the current user. */
83
+ oauth_token?: string;
84
+ /** Returns response with indentations and line breaks. */
85
+ prettyPrint?: boolean;
86
+ /** 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. */
87
+ quotaUser?: string;
88
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
89
+ upload_protocol?: string;
90
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
91
+ uploadType?: string;
92
+ }): Request<{}>;
93
+ /** Gets a reader of a publication. Returns NOT_FOUND if the reader does not exist. */
94
+ get(request?: {
95
+ /** V1 error format. */
96
+ "$.xgafv"?: string;
97
+ /** OAuth access token. */
98
+ access_token?: string;
99
+ /** Data format for response. */
100
+ alt?: string;
101
+ /** JSONP */
102
+ callback?: string;
103
+ /** Selector specifying which fields to include in a partial response. */
104
+ fields?: string;
105
+ /** 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. */
106
+ key?: string;
107
+ /** Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid} */
108
+ name: string;
109
+ /** OAuth 2.0 token for the current user. */
110
+ oauth_token?: string;
111
+ /** Returns response with indentations and line breaks. */
112
+ prettyPrint?: boolean;
113
+ /** 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. */
114
+ quotaUser?: string;
115
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
116
+ upload_protocol?: string;
117
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
118
+ uploadType?: string;
119
+ }): Request<Reader>;
120
+ /** Gets the reader entitlements for a publication reader. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist. */
121
+ getEntitlements(request?: {
122
+ /** V1 error format. */
123
+ "$.xgafv"?: string;
124
+ /** OAuth access token. */
125
+ access_token?: string;
126
+ /** Data format for response. */
127
+ alt?: string;
128
+ /** JSONP */
129
+ callback?: string;
130
+ /** Selector specifying which fields to include in a partial response. */
131
+ fields?: string;
132
+ /** 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. */
133
+ key?: string;
134
+ /** Required. The name of the reader entitlements to retrieve. Format: publications/{publication_id}/readers/{reader_id}/entitlements */
135
+ name: string;
136
+ /** OAuth 2.0 token for the current user. */
137
+ oauth_token?: string;
138
+ /** Returns response with indentations and line breaks. */
139
+ prettyPrint?: boolean;
140
+ /** 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. */
141
+ quotaUser?: string;
142
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
143
+ upload_protocol?: string;
144
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
145
+ uploadType?: string;
146
+ }): Request<ReaderEntitlements>;
147
+ /**
148
+ * Updates the reader entitlements for a publication reader. The entire reader entitlements will be overwritten by the new reader entitlements in the payload, like a PUT. - Returns
149
+ * PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist.
150
+ */
151
+ updateEntitlements(request: {
152
+ /** V1 error format. */
153
+ "$.xgafv"?: string;
154
+ /** OAuth access token. */
155
+ access_token?: string;
156
+ /** Data format for response. */
157
+ alt?: string;
158
+ /** JSONP */
159
+ callback?: string;
160
+ /** Selector specifying which fields to include in a partial response. */
161
+ fields?: string;
162
+ /** 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. */
163
+ key?: string;
164
+ /** Output only. The resource name of the singleton. */
165
+ name: string;
166
+ /** OAuth 2.0 token for the current user. */
167
+ oauth_token?: string;
168
+ /** Returns response with indentations and line breaks. */
169
+ prettyPrint?: boolean;
170
+ /** 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. */
171
+ quotaUser?: string;
172
+ /** Optional. The list of fields to update. Defaults to all fields. */
173
+ updateMask?: string;
174
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
175
+ upload_protocol?: string;
176
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
177
+ uploadType?: string;
178
+ /** Request body */
179
+ resource: ReaderEntitlements;
180
+ }): Request<ReaderEntitlements>;
181
+ updateEntitlements(request: {
182
+ /** V1 error format. */
183
+ "$.xgafv"?: string;
184
+ /** OAuth access token. */
185
+ access_token?: string;
186
+ /** Data format for response. */
187
+ alt?: string;
188
+ /** JSONP */
189
+ callback?: string;
190
+ /** Selector specifying which fields to include in a partial response. */
191
+ fields?: string;
192
+ /** 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. */
193
+ key?: string;
194
+ /** Output only. The resource name of the singleton. */
195
+ name: string;
196
+ /** OAuth 2.0 token for the current user. */
197
+ oauth_token?: string;
198
+ /** Returns response with indentations and line breaks. */
199
+ prettyPrint?: boolean;
200
+ /** 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. */
201
+ quotaUser?: string;
202
+ /** Optional. The list of fields to update. Defaults to all fields. */
203
+ updateMask?: string;
204
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
205
+ upload_protocol?: string;
206
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
207
+ uploadType?: string;
208
+ },
209
+ body: ReaderEntitlements): Request<ReaderEntitlements>;
210
+ }
211
+ interface PublicationsResource {
212
+ readers: ReadersResource;
213
+ }
214
+
215
+ const publications: PublicationsResource;
216
+ }
217
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.readerrevenuesubscriptionlinking-v1",
3
+ "version": "0.0.20230409",
4
+ "description": "TypeScript typings for Reader Revenue Subscription Linking API v1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,47 @@
1
+ # TypeScript typings for Reader Revenue Subscription Linking API v1
2
+
3
+ readerrevenuesubscriptionlinking.googleapis.com API.
4
+ For detailed description please check [documentation](https://developers.google.com/news/subscribe/subscription-linking/overview).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Reader Revenue Subscription Linking API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.readerrevenuesubscriptionlinking-v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://readerrevenuesubscriptionlinking.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.readerrevenuesubscriptionlinking
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('readerrevenuesubscriptionlinking', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.readerrevenuesubscriptionlinking
39
+ });
40
+ ```
41
+
42
+
43
+
44
+ After that you can use Reader Revenue Subscription Linking API resources: <!-- TODO: make this work for multiple namespaces -->
45
+
46
+ ```typescript
47
+ ```
package/tests.ts ADDED
@@ -0,0 +1,53 @@
1
+ /* This is stub file for gapi.client.readerrevenuesubscriptionlinking-v1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20230409
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://readerrevenuesubscriptionlinking.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.readerrevenuesubscriptionlinking */
13
+
14
+ run();
15
+
16
+ async function run() {
17
+ /**
18
+ * Removes a publication reader, effectively severing the association with a Google user. If `force` is set to true, any entitlements for this reader will also be deleted. (Otherwise, the
19
+ * request will only work if the reader has no entitlements.) - If the reader does not exist, return NOT_FOUND. - Return FAILED_PRECONDITION if the force field is false (or unset) and
20
+ * entitlements are present.
21
+ */
22
+ await gapi.client.readerrevenuesubscriptionlinking.publications.readers.delete({
23
+ force: true,
24
+ name: "Test string",
25
+ });
26
+ /** Gets a reader of a publication. Returns NOT_FOUND if the reader does not exist. */
27
+ await gapi.client.readerrevenuesubscriptionlinking.publications.readers.get({
28
+ name: "Test string",
29
+ });
30
+ /** Gets the reader entitlements for a publication reader. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist. */
31
+ await gapi.client.readerrevenuesubscriptionlinking.publications.readers.getEntitlements({
32
+ name: "Test string",
33
+ });
34
+ /**
35
+ * Updates the reader entitlements for a publication reader. The entire reader entitlements will be overwritten by the new reader entitlements in the payload, like a PUT. - Returns
36
+ * PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist.
37
+ */
38
+ await gapi.client.readerrevenuesubscriptionlinking.publications.readers.updateEntitlements({
39
+ name: "Test string",
40
+ updateMask: "Test string",
41
+ }, {
42
+ entitlements: [
43
+ {
44
+ detail: "Test string",
45
+ expireTime: "Test string",
46
+ productId: "Test string",
47
+ subscriptionToken: "Test string",
48
+ }
49
+ ],
50
+ name: "Test string",
51
+ });
52
+ }
53
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }