Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: handle versionless orgs api for node, ruby, python, php #624

Merged
merged 35 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5c9f664
chore: handling orgs api for dynamic typed languages
tiwarishubham635 Nov 27, 2024
8ede37e
chore: pass headers with body params in node
tiwarishubham635 Nov 27, 2024
f56392e
chore: fix endpoints
tiwarishubham635 Nov 27, 2024
1ed7426
chore: fixing orgs api param names
tiwarishubham635 Nov 28, 2024
3d4ab8f
chore: add temp_specs to gitignore
tiwarishubham635 Nov 28, 2024
cda8e9c
chore: add pathType in orgs spec
tiwarishubham635 Nov 28, 2024
0c23403
chore: setting header correctly
tiwarishubham635 Dec 2, 2024
fb855a3
chore: setting header correctly
tiwarishubham635 Dec 2, 2024
5db63b7
orgs api changes
AsabuHere Dec 3, 2024
7080338
Revert "orgs api changes"
AsabuHere Dec 3, 2024
f7b7296
orgs api python changes
AsabuHere Dec 3, 2024
317a577
fix: Fixing header parameter issues in twilio-python (#625)
AsabuHere Dec 3, 2024
7fcfc8f
chore: fix node header
tiwarishubham635 Dec 3, 2024
059e135
chore: read basename for nested model
tiwarishubham635 Dec 3, 2024
c19fe84
Adding required models
AsabuHere Dec 3, 2024
caec301
orgs api changes for python
AsabuHere Dec 4, 2024
e32f3b6
orgs api changes for python
AsabuHere Dec 4, 2024
47d2dd7
Merge remote-tracking branch 'origin/fix_orgs_api' into fix_orgs_api
tiwarishubham635 Dec 4, 2024
d04d3f3
chore: skip accept header in delete
tiwarishubham635 Dec 4, 2024
d011211
feat: orgs api (#626)
manisha1997 Dec 9, 2024
333d92f
chore: add header for bodyParams
tiwarishubham635 Dec 9, 2024
2d6d549
chore: access temp spec via parent path
tiwarishubham635 Dec 11, 2024
39aa6ac
chore: remove version extraction from domain name
tiwarishubham635 Dec 11, 2024
97c9ca7
Organization api uptake changes
AsabuHere Dec 11, 2024
7863f9d
Organization api uptake changes
AsabuHere Dec 11, 2024
130b0a8
Organization api uptake changes
AsabuHere Dec 12, 2024
f3092a7
removing accept headers for delete operation
AsabuHere Dec 12, 2024
2fb73b4
removing accept headers for delete operation
AsabuHere Dec 12, 2024
81fba7f
chore: generate python examples
tiwarishubham635 Dec 12, 2024
8c1b3c4
chore: add preview-iam examples to node
tiwarishubham635 Dec 12, 2024
1df483d
chore: add preview-iam examples to ruby
tiwarishubham635 Dec 12, 2024
fbc18e7
chore: add preview-iam examples to python
tiwarishubham635 Dec 12, 2024
1f07156
Accept header fixes
AsabuHere Dec 12, 2024
0e3d03f
Accept header fixes
AsabuHere Dec 12, 2024
bd215a2
chore: add preview-iam examples to python
tiwarishubham635 Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ tmp
**/execution-result.xml
**/php_coverage.xml
*.iml
generateFiles.py
generateFiles.py
temp_specs/
14 changes: 14 additions & 0 deletions examples/node/src/rest/PreviewIamBase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Domain from "../base/Domain";
import V1 from "./previewIam/V1";

class PreviewIamBase extends Domain {
constructor(twilio: any) {
super(twilio, "https://preview-iam.twilio.com");
}

get v1(): V1 {
return new V1(this);
}
}

export = PreviewIamBase;
5 changes: 5 additions & 0 deletions examples/node/src/rest/Twilio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Client, ClientOpts } from "../base/BaseTwilio";
import ApiBase from "./ApiBase";
import FlexApiBase from "./FlexApiBase";
import VersionlessBase from "./VersionlessBase";
import PreviewIamBase = require("./PreviewIamBase");

class Twilio extends Client {
constructor(username?: string, password?: string, opts?: ClientOpts) {
Expand All @@ -19,6 +20,10 @@ class Twilio extends Client {
get versionless(): VersionlessBase {
return new VersionlessBase(this);
}

get previewIam(): PreviewIamBase {
return new PreviewIamBase(this);
}
}

export = Twilio;
10 changes: 10 additions & 0 deletions examples/node/src/rest/api/v2010/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,14 @@ export class AccountContextImpl implements AccountContext {
remove(
callback?: (error: Error | null, item?: boolean) => any,
): Promise<boolean> {
const headers: any = {};

const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.remove({
uri: instance._uri,
method: "delete",
headers,
});

operationPromise = instance._version.setPromiseCallback(
Expand All @@ -214,11 +217,15 @@ export class AccountContextImpl implements AccountContext {
fetch(
callback?: (error: Error | null, item?: AccountInstance) => any,
): Promise<AccountInstance> {
const headers: any = {};
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.fetch({
uri: instance._uri,
method: "get",
headers,
});

operationPromise = operationPromise.then(
Expand Down Expand Up @@ -254,6 +261,7 @@ export class AccountContextImpl implements AccountContext {

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
Expand Down Expand Up @@ -607,6 +615,7 @@ export function AccountListInstance(version: V2010): AccountListInstance {

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
headers["Accept"] = "application/json";
if (params["xTwilioWebhookEnabled"] !== undefined)
headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"];

Expand Down Expand Up @@ -662,6 +671,7 @@ export function AccountListInstance(version: V2010): AccountListInstance {
if (params.pageToken !== undefined) data["PageToken"] = params.pageToken;

const headers: any = {};
headers["Accept"] = "application/json";

let operationVersion = version,
operationPromise = operationVersion.page({
Expand Down
8 changes: 8 additions & 0 deletions examples/node/src/rest/api/v2010/account/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ export class CallContextImpl implements CallContext {
remove(
callback?: (error: Error | null, item?: boolean) => any,
): Promise<boolean> {
const headers: any = {};

const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.remove({
uri: instance._uri,
method: "delete",
headers,
});

operationPromise = instance._version.setPromiseCallback(
Expand All @@ -123,11 +126,15 @@ export class CallContextImpl implements CallContext {
fetch(
callback?: (error: Error | null, item?: CallInstance) => any,
): Promise<CallInstance> {
const headers: any = {};
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.fetch({
uri: instance._uri,
method: "get",
headers,
});

operationPromise = operationPromise.then(
Expand Down Expand Up @@ -415,6 +422,7 @@ export function CallListInstance(

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
headers["Accept"] = "application/json";

let operationVersion = version,
operationPromise = operationVersion.create({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class FeedbackCallSummaryContextImpl

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
Expand Down
4 changes: 4 additions & 0 deletions examples/node/src/rest/flexApi/v1/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@ export class CallContextImpl implements CallContext {
update(
callback?: (error: Error | null, item?: CallInstance) => any,
): Promise<CallInstance> {
const headers: any = {};
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.update({
uri: instance._uri,
method: "post",
headers,
});

operationPromise = operationPromise.then(
Expand Down
9 changes: 9 additions & 0 deletions examples/node/src/rest/flexApi/v1/credential/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,14 @@ export class AwsContextImpl implements AwsContext {
remove(
callback?: (error: Error | null, item?: boolean) => any,
): Promise<boolean> {
const headers: any = {};

const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.remove({
uri: instance._uri,
method: "delete",
headers,
});

operationPromise = instance._version.setPromiseCallback(
Expand All @@ -169,11 +172,15 @@ export class AwsContextImpl implements AwsContext {
fetch(
callback?: (error: Error | null, item?: AwsInstance) => any,
): Promise<AwsInstance> {
const headers: any = {};
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.fetch({
uri: instance._uri,
method: "get",
headers,
});

operationPromise = operationPromise.then(
Expand Down Expand Up @@ -210,6 +217,7 @@ export class AwsContextImpl implements AwsContext {

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
Expand Down Expand Up @@ -485,6 +493,7 @@ export function AwsListInstance(version: V1): AwsListInstance {
if (params.pageToken !== undefined) data["PageToken"] = params.pageToken;

const headers: any = {};
headers["Accept"] = "application/json";

let operationVersion = version,
operationPromise = operationVersion.page({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export class HistoryContextImpl implements HistoryContext {
};

const headers: any = {};
headers["Accept"] = "application/json";

const instance = this;
let operationVersion = instance._version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export function NewCredentialsListInstance(

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
headers["Accept"] = "application/json";

let operationVersion = version,
operationPromise = operationVersion.create({
Expand Down
46 changes: 46 additions & 0 deletions examples/node/src/rest/previewIam/V1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Organization Public API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import PreviewIamBase from "../PreviewIamBase";
import Version from "../../base/Version";
import { AuthorizeListInstance } from "./v1/authorize";
import { TokenListInstance } from "./v1/token";

export default class V1 extends Version {
/**
* Initialize the V1 version of PreviewIam
*
* @param domain - The Twilio (Twilio.PreviewIam) domain
*/
constructor(domain: PreviewIamBase) {
super(domain, "v1");
}

/** authorize - { Twilio.PreviewIam.V1.AuthorizeListInstance } resource */
protected _authorize?: AuthorizeListInstance;
/** token - { Twilio.PreviewIam.V1.TokenListInstance } resource */
protected _token?: TokenListInstance;

/** Getter for authorize resource */
get authorize(): AuthorizeListInstance {
this._authorize = this._authorize || AuthorizeListInstance(this);
return this._authorize;
}

/** Getter for token resource */
get token(): TokenListInstance {
this._token = this._token || TokenListInstance(this);
return this._token;
}
}
Loading
Loading