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

fix: correct the enum naming in node, python, and ruby #460

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 11 additions & 11 deletions examples/node/src/rest/api/v2010/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ import { CallListInstance } from "./account/call";
import { PhoneNumberCapabilities } from "../../../interfaces";
import TwiML from "../../../twiml/TwiML";

export class TestResponseObjectTestArrayOfObjects {
"count"?: number;
"description"?: string;
}

export type TestStatus =
export type AccountStatus =
| "in-progress"
| "paused"
| "stopped"
| "processing"
| "completed"
| "absent";

export class TestResponseObjectTestArrayOfObjects {
"count"?: number;
"description"?: string;
}

/**
* Options to pass to update a AccountInstance
*/
export interface AccountContextUpdateOptions {
/** */
status: TestStatus;
status: AccountStatus;
/** */
pauseBehavior?: string;
}
Expand Down Expand Up @@ -300,12 +300,12 @@ interface AccountResource {
price_unit: string;
test_number_float: number;
test_number_decimal: number;
test_enum: TestStatus;
test_enum: AccountStatus;
a2p_profile_bundle_sid: string;
test_array_of_integers: Array<number>;
test_array_of_array_of_integers: Array<Array<number>>;
test_array_of_objects: Array<TestResponseObjectTestArrayOfObjects>;
test_array_of_enum: Array<TestStatus>;
test_array_of_enum: Array<AccountStatus>;
}

export class AccountInstance {
Expand Down Expand Up @@ -347,7 +347,7 @@ export class AccountInstance {
priceUnit: string;
testNumberFloat: number;
testNumberDecimal: number;
testEnum: TestStatus;
testEnum: AccountStatus;
/**
* A2P Messaging Profile Bundle BundleSid
*/
Expand All @@ -358,7 +358,7 @@ export class AccountInstance {
/**
* Permissions authorized to the app
*/
testArrayOfEnum: Array<TestStatus>;
testArrayOfEnum: Array<AccountStatus>;

private get _proxy(): AccountContext {
this._context =
Expand Down
20 changes: 10 additions & 10 deletions examples/node/src/rest/api/v2010/account/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ import { isValidPathParam } from "../../../../base/utility";
import { FeedbackCallSummaryListInstance } from "./call/feedbackCallSummary";
import { PhoneNumberCapabilities } from "../../../../interfaces";

export class TestResponseObjectTestArrayOfObjects {
"count"?: number;
"description"?: string;
}

export type TestStatus =
export type CallStatus =
| "in-progress"
| "paused"
| "stopped"
| "processing"
| "completed"
| "absent";

export class TestResponseObjectTestArrayOfObjects {
"count"?: number;
"description"?: string;
}

/**
* Options to pass to create a CallInstance
*/
Expand Down Expand Up @@ -174,12 +174,12 @@ interface CallResource {
price_unit: string;
test_number_float: number;
test_number_decimal: number;
test_enum: TestStatus;
test_enum: CallStatus;
a2p_profile_bundle_sid: string;
test_array_of_integers: Array<number>;
test_array_of_array_of_integers: Array<Array<number>>;
test_array_of_objects: Array<TestResponseObjectTestArrayOfObjects>;
test_array_of_enum: Array<TestStatus>;
test_array_of_enum: Array<CallStatus>;
}

export class CallInstance {
Expand Down Expand Up @@ -225,7 +225,7 @@ export class CallInstance {
priceUnit: string;
testNumberFloat: number;
testNumberDecimal: number;
testEnum: TestStatus;
testEnum: CallStatus;
/**
* A2P Messaging Profile Bundle BundleSid
*/
Expand All @@ -236,7 +236,7 @@ export class CallInstance {
/**
* Permissions authorized to the app
*/
testArrayOfEnum: Array<TestStatus>;
testArrayOfEnum: Array<CallStatus>;

private get _proxy(): CallContext {
this._context =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ const serialize = require("../../../../../base/serialize");
import { isValidPathParam } from "../../../../../base/utility";
import { PhoneNumberCapabilities } from "../../../../../interfaces";

export class TestResponseObjectTestArrayOfObjects {
"count"?: number;
"description"?: string;
}

export type TestStatus =
export type FeedbackCallSummaryStatus =
| "in-progress"
| "paused"
| "stopped"
| "processing"
| "completed"
| "absent";

export class TestResponseObjectTestArrayOfObjects {
"count"?: number;
"description"?: string;
}

/**
* Options to pass to update a FeedbackCallSummaryInstance
*/
Expand Down Expand Up @@ -170,12 +170,12 @@ interface FeedbackCallSummaryResource {
price_unit: string;
test_number_float: number;
test_number_decimal: number;
test_enum: TestStatus;
test_enum: FeedbackCallSummaryStatus;
a2p_profile_bundle_sid: string;
test_array_of_integers: Array<number>;
test_array_of_array_of_integers: Array<Array<number>>;
test_array_of_objects: Array<TestResponseObjectTestArrayOfObjects>;
test_array_of_enum: Array<TestStatus>;
test_array_of_enum: Array<FeedbackCallSummaryStatus>;
}

export class FeedbackCallSummaryInstance {
Expand Down Expand Up @@ -218,7 +218,7 @@ export class FeedbackCallSummaryInstance {
priceUnit: string;
testNumberFloat: number;
testNumberDecimal: number;
testEnum: TestStatus;
testEnum: FeedbackCallSummaryStatus;
/**
* A2P Messaging Profile Bundle BundleSid
*/
Expand All @@ -229,7 +229,7 @@ export class FeedbackCallSummaryInstance {
/**
* Permissions authorized to the app
*/
testArrayOfEnum: Array<TestStatus>;
testArrayOfEnum: Array<FeedbackCallSummaryStatus>;

private get _proxy(): FeedbackCallSummaryContext {
this._context =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const deserialize = require("../../../../base/deserialize");
const serialize = require("../../../../base/serialize");
import { isValidPathParam } from "../../../../base/utility";

export type TestStatus =
export type NewCredentialsStatus =
| "in-progress"
| "paused"
| "stopped"
Expand Down Expand Up @@ -53,7 +53,7 @@ export interface NewCredentialsListInstanceCreateOptions {
/** */
testDate?: Date;
/** */
testEnum?: TestStatus;
testEnum?: NewCredentialsStatus;
/** */
testObjectArray?: Array<object>;
/** */
Expand Down
10 changes: 5 additions & 5 deletions examples/python/twilio/rest/api/v2010/account/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def update(self, status, pause_behavior=values.unset):
"""
Update the AccountInstance

:params TestStatus status:
:params Status status:
:params str pause_behavior:

:returns: The updated AccountInstance
Expand Down Expand Up @@ -354,7 +354,7 @@ def __repr__(self):

class AccountInstance(InstanceResource):

class TestStatus(object):
class Status(object):
IN_PROGRESS = "in-progress"
PAUSED = "paused"
STOPPED = "stopped"
Expand Down Expand Up @@ -489,7 +489,7 @@ def test_number_decimal(self):
def test_enum(self):
"""
:returns:
:rtype: TestStatus
:rtype: Status
"""
return self._properties['test_enum']

Expand Down Expand Up @@ -529,7 +529,7 @@ def test_array_of_objects(self):
def test_array_of_enum(self):
"""
:returns: Permissions authorized to the app
:rtype: list[TestStatus]
:rtype: list[Status]
"""
return self._properties['test_array_of_enum']

Expand Down Expand Up @@ -557,7 +557,7 @@ def update(self, status, pause_behavior=values.unset):
"""
Update the AccountInstance

:params TestStatus status:
:params Status status:
:params str pause_behavior:

:returns: The updated AccountInstance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __repr__(self):

class CallInstance(InstanceResource):

class TestStatus(object):
class Status(object):
IN_PROGRESS = "in-progress"
PAUSED = "paused"
STOPPED = "stopped"
Expand Down Expand Up @@ -311,7 +311,7 @@ def test_number_decimal(self):
def test_enum(self):
"""
:returns:
:rtype: TestStatus
:rtype: Status
"""
return self._properties['test_enum']

Expand Down Expand Up @@ -351,7 +351,7 @@ def test_array_of_objects(self):
def test_array_of_enum(self):
"""
:returns: Permissions authorized to the app
:rtype: list[TestStatus]
:rtype: list[Status]
"""
return self._properties['test_array_of_enum']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __repr__(self):

class FeedbackCallSummaryInstance(InstanceResource):

class TestStatus(object):
class Status(object):
IN_PROGRESS = "in-progress"
PAUSED = "paused"
STOPPED = "stopped"
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_number_decimal(self):
def test_enum(self):
"""
:returns:
:rtype: TestStatus
:rtype: Status
"""
return self._properties['test_enum']

Expand Down Expand Up @@ -310,7 +310,7 @@ def test_array_of_objects(self):
def test_array_of_enum(self):
"""
:returns: Permissions authorized to the app
:rtype: list[TestStatus]
:rtype: list[Status]
"""
return self._properties['test_array_of_enum']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create(self, test_string, test_boolean=values.unset, test_integer=values.uns
:param dict test_object:
:param datetime test_date_time:
:param date test_date:
:param TestStatus test_enum:
:param Status test_enum:
:param list[object] test_object_array:
:param object test_any_type:
:param list[object] test_any_array:
Expand Down
8 changes: 4 additions & 4 deletions examples/ruby/lib/twilio-ruby/rest/api/v2010/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def fetch
##
# Update the AccountInstance
# @param [String] pause_behavior
# @param [TestStatus] status
# @param [Status] status
# @return [AccountInstance] Updated AccountInstance
def update(
pause_behavior: :unset,
Expand Down Expand Up @@ -415,7 +415,7 @@ def test_number_decimal
end

##
# @return [TestStatus]
# @return [Status]
def test_enum
@properties['test_enum']
end
Expand Down Expand Up @@ -445,7 +445,7 @@ def test_array_of_objects
end

##
# @return [Array<TestStatus>] Permissions authorized to the app
# @return [Array<Status>] Permissions authorized to the app
def test_array_of_enum
@properties['test_array_of_enum']
end
Expand All @@ -467,7 +467,7 @@ def fetch
##
# Update the AccountInstance
# @param [String] pause_behavior
# @param [TestStatus] status
# @param [Status] status
# @return [AccountInstance] Updated AccountInstance
def update(
pause_behavior: :unset,
Expand Down
4 changes: 2 additions & 2 deletions examples/ruby/lib/twilio-ruby/rest/api/v2010/account/call.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def test_number_decimal
end

##
# @return [TestStatus]
# @return [Status]
def test_enum
@properties['test_enum']
end
Expand Down Expand Up @@ -324,7 +324,7 @@ def test_array_of_objects
end

##
# @return [Array<TestStatus>] Permissions authorized to the app
# @return [Array<Status>] Permissions authorized to the app
def test_array_of_enum
@properties['test_array_of_enum']
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def test_number_decimal
end

##
# @return [TestStatus]
# @return [Status]
def test_enum
@properties['test_enum']
end
Expand Down Expand Up @@ -262,7 +262,7 @@ def test_array_of_objects
end

##
# @return [Array<TestStatus>] Permissions authorized to the app
# @return [Array<Status>] Permissions authorized to the app
def test_array_of_enum
@properties['test_array_of_enum']
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def initialize(version)
# @param [Hash] test_object
# @param [Time] test_date_time
# @param [Date] test_date
# @param [TestStatus] test_enum
# @param [Status] test_enum
# @param [Array[Hash]] test_object_array
# @param [Object] test_any_type
# @param [Array[Hash]] test_any_array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ public Optional<String> getApiVersionClass() {
public void postProcessAllModels(final Map<String, ModelsMap> models, final Map<String, String> modelFormatMap) {
Utility.addModelsToLocalModelList(models, allModels);
Utility.setComplexDataMapping(allModels, modelFormatMap);
allModels.forEach(model -> model.setClassname(model.getClassname().replace("Enum", "")));
}

public List<CodegenOperation> processOperations(final OperationsMap results) {
Expand Down
Loading