Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ['java' ]
language: [ 'csharp', 'go', 'java', 'node', 'php', 'python', 'ruby' ]
runs-on: ubuntu-latest
timeout-minutes: 20
env:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Set up Java 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: '11'

- name: Login to Docker Hub
Expand Down
10 changes: 5 additions & 5 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ A short description of what this PR does.
### Checklist
- [x] I acknowledge that all my contributions will be made under the project's license
- [ ] Run `make test-docker`
- [ ] Verify affected language:
- [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our [OpenAPI specification](https://github.com/twilio/twilio-oai) using the [build_twilio_go.py](./examples/build_twilio_go.py) using `python examples/build_twilio_go.py path/to/twilio-oai/spec/yaml path/to/twilio-go` and inspect the diff
- [ ] Run `make test` in `twilio-go`
- [ ] Create a pull request in `twilio-go`
- [ ] Provide a link below to the pull request
- [ ] Verify affected language according to the code change:
- [ ] Generate [twilio-java](https://github.com/twilio/twilio-java) from our [OpenAPI specification](https://github.com/twilio/twilio-oai) using the [scripts/build_twilio_library.py](./scripts/build_twilio_library.py) using `python scripts/build_twilio_library.py path/to/twilio-oai/spec/yaml path/to/twilio-java -l java` and inspect the diff
- [ ] Run `make test` in `twilio-java`
- [ ] Create a pull request in `twilio-java`
- [ ] Provide a link below to the pull request, this ensures that the generated code has been verified
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
- [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md) and my PR follows them
- [ ] I have titled the PR appropriately
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ java -cp /path/to/openapi-generator-cli.jar:/path/to/your.jar org.openapitools.c

(Do not forget to replace the values `/path/to/openapi-generator-cli.jar`, `/path/to/your.jar` and `/path/to/openapi.yaml` in the previous command)

Here is an example script to generate [twilio-go](https://github.com/twilio/twilio-go) from our [OpenAPI specification](https://github.com/twilio/twilio-oai): [build_twilio_go.py](./examples/build_twilio_go.py).

### For Windows
You will need to use `;` instead of `:` in the classpath, e.g.
```
Expand Down Expand Up @@ -109,8 +107,8 @@ To generate [`twilio-go`](https://github.com/twilio/twilio-go) from [`twilio-oai

Update `<path to>` and execute the following from the root of this repo:

* To generate the entire suite, run `make install && python3 examples/build_twilio_go.py <path to>/twilio-oai/spec/yaml <path to>/twilio-go`
* To generate the provider for a single domain such as studio, run `make install && python3 examples/build_twilio_go.py <path to>/twilio-oai/spec/yaml/twilio_studio_v2.yaml <path to>/twilio-go`
* To generate the entire suite, run `make install && python3 scripts/build_twilio_library.py <path to>/twilio-oai/spec/yaml <path to>/twilio-go`
* To generate the provider for a single domain such as studio, run `make install && python3 scripts/build_twilio_library.py <path to>/twilio-oai/spec/yaml/twilio_studio_v2.yaml <path to>/twilio-go`

## Generating terraform-provider-twilio

Expand All @@ -125,6 +123,5 @@ Update `<path to>` and execute the following from the root of this repo:

Update `<path to>` and execute the following from the root of this repo:

* To generate the entire suite, run `make install && python3 examples/build_twilio_go.py <path to>/twilio-oai/spec/yaml <path to>/terraform-provider-twilio -l terraform`
* To generate the provider for a single domain such as studio, run `make install && python3 examples/build_twilio_go.py <path to>/twilio-oai/spec/yaml/twilio_studio_v2.yaml <path to>/terraform-provider-twilio -l terraform`
* Run `python3 examples/build_twilio_go.py -h` to see more details
* To generate the entire suite, run `make install && python3 scripts/build_twilio_library.py <path to oai spec file>/twilio-oai/spec/yaml/abc.yaml <path to language repo>/github/twilio/twilio-java/<language> -l java`
* Run ` python3 scripts/build_twilio_library.py -h` to see more details
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,56 @@ namespace Twilio.Rest.FlexApi.V1.Credential
/// <summary> create </summary>
public class CreateNewCredentialsOptions : IOptions<NewCredentialsResource>
{


public string TestString { get; }


public bool? TestBoolean { get; set; }


public int? TestInteger { get; set; }


public decimal? TestNumber { get; set; }


public float TestNumberFloat { get; set; }


public double TestNumberDouble { get; set; }
public float? TestNumberFloat { get; set; }


public double? TestNumberDouble { get; set; }



public decimal? TestNumberInt32 { get; set; }


public long? TestNumberInt64 { get; set; }


public object TestObject { get; set; }


public DateTime? TestDateTime { get; set; }


public DateTime? TestDate { get; set; }


public NewCredentialsResource.StatusEnum TestEnum { get; set; }


public List<object> TestObjectArray { get; set; }


public object TestAnyType { get; set; }


public List<object> TestAnyArray { get; set; }

///<summary> A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. </summary>
///<summary> A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. </summary>
public List<NewCredentialsResource.PermissionsEnum> Permissions { get; set; }


public string SomeA2PThing { get; set; }


Expand All @@ -90,7 +90,7 @@ public CreateNewCredentialsOptions(string testString)
Permissions = new List<NewCredentialsResource.PermissionsEnum>();
}


/// <summary> Generate the necessary parameters </summary>
public List<KeyValuePair<string, string>> GetParams()
{
Expand All @@ -114,11 +114,11 @@ public List<KeyValuePair<string, string>> GetParams()
}
if (TestNumberFloat != null)
{
p.Add(new KeyValuePair<string, string>("TestNumberFloat", TestNumberFloat.ToString()));
p.Add(new KeyValuePair<string, string>("TestNumberFloat", TestNumberFloat.Value.ToString()));
}
if (TestNumberDouble != null)
{
p.Add(new KeyValuePair<string, string>("TestNumberDouble", TestNumberDouble.ToString()));
p.Add(new KeyValuePair<string, string>("TestNumberDouble", TestNumberDouble.Value.ToString()));
}
if (TestNumberInt32 != null)
{
Expand Down Expand Up @@ -167,7 +167,7 @@ public List<KeyValuePair<string, string>> GetParams()
return p;
}



}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace Twilio.Rest.FlexApi.V1.Credential
{
public class NewCredentialsResource : Resource
{





public sealed class StatusEnum : StringEnum
{
private StatusEnum(string value) : base(value) {}
Expand Down Expand Up @@ -61,10 +61,10 @@ public static implicit operator PermissionsEnum(string value)
public static readonly PermissionsEnum PostAll = new PermissionsEnum("post-all");
}


private static Request BuildCreateRequest(CreateNewCredentialsOptions options, ITwilioRestClient client)
{

string path = "/v1/Credentials/AWS";


Expand Down Expand Up @@ -126,11 +126,11 @@ public static NewCredentialsResource Create(
string testString,
int? testInteger = null,
DateTime? testDate = null,
float testNumberFloat = null,
float? testNumberFloat = null,
object testObject = null,
bool? testBoolean = null,
decimal? testNumber = null,
double testNumberDouble = null,
double? testNumberDouble = null,
decimal? testNumberInt32 = null,
long? testNumberInt64 = null,
DateTime? testDateTime = null,
Expand Down Expand Up @@ -171,11 +171,11 @@ public static async System.Threading.Tasks.Task<NewCredentialsResource> CreateAs
string testString,
int? testInteger = null,
DateTime? testDate = null,
float testNumberFloat = null,
float? testNumberFloat = null,
object testObject = null,
bool? testBoolean = null,
decimal? testNumber = null,
double testNumberDouble = null,
double? testNumberDouble = null,
decimal? testNumberInt32 = null,
long? testNumberInt64 = null,
DateTime? testDateTime = null,
Expand All @@ -192,7 +192,7 @@ public static async System.Threading.Tasks.Task<NewCredentialsResource> CreateAs
}
#endif


/// <summary>
/// Converts a JSON string into a NewCredentialsResource object
/// </summary>
Expand Down Expand Up @@ -226,20 +226,20 @@ public static string ToJson(object model)
}
}

///<summary> The account_sid </summary>

///<summary> The account_sid </summary>
[JsonProperty("account_sid")]
public string AccountSid { get; private set; }

///<summary> The sid </summary>
///<summary> The sid </summary>
[JsonProperty("sid")]
public string Sid { get; private set; }

///<summary> The test_string </summary>
///<summary> The test_string </summary>
[JsonProperty("test_string")]
public string TestString { get; private set; }

///<summary> The test_integer </summary>
///<summary> The test_integer </summary>
[JsonProperty("test_integer")]
public int? TestInteger { get; private set; }

Expand Down
1 change: 1 addition & 0 deletions examples/csharp/src/Twilio/Rest/Oauth/V2/TokenOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@ public List<KeyValuePair<string, string>> GetParams()


}

}

1 change: 1 addition & 0 deletions examples/csharp/src/Twilio/Rest/Oauth/V2/TokenResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static async System.Threading.Tasks.Task<TokenResource> CreateAsync(
return await CreateAsync(options, client);
}
#endif


/// <summary>
/// Converts a JSON string into a TokenResource object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,35 @@ namespace Twilio.Rest.Versionless.DeployedDevices
public class FleetResource : Resource
{

public class VersionlessFleetTestNestedObjectValue
{
[JsonProperty("param1")]
private string Param1 {get; set;}
[JsonProperty("param2")]
private int Param2 {get; set;}
public VersionlessFleetTestNestedObjectValue() { }
public class Builder
{
private VersionlessFleetTestNestedObjectValue _versionlessFleetTestNestedObjectValue = new VersionlessFleetTestNestedObjectValue();
public Builder()
{
}
public Builder WithParam1(string param1)
{
_versionlessFleetTestNestedObjectValue.Param1= param1;
return this;
}
public Builder WithParam2(int param2)
{
_versionlessFleetTestNestedObjectValue.Param2= param2;
return this;
}
public VersionlessFleetTestNestedObjectValue Build()
{
return _versionlessFleetTestNestedObjectValue;
}
}
}



Expand Down Expand Up @@ -207,6 +236,18 @@ public static string ToJson(object model)
[JsonProperty("test_int_map")]
public Dictionary<string, int> TestIntMap { get; private set; }

///<summary> The test_nested_object </summary>
[JsonProperty("test_nested_object")]
public Dictionary<string, VersionlessFleetTestNestedObjectValue> TestNestedObject { get; private set; }

///<summary> The test_nested_array </summary>
[JsonProperty("test_nested_array")]
public List<Dictionary<string, int>> TestNestedArray { get; private set; }

///<summary> The test_nested_array_of_objects </summary>
[JsonProperty("test_nested_array_of_objects")]
public List<Dictionary<string, VersionlessFleetTestNestedObjectValue>> TestNestedArrayOfObjects { get; private set; }

///<summary> A string that uniquely identifies this Fleet. </summary>
[JsonProperty("sid")]
public string Sid { get; private set; }
Expand Down
9 changes: 6 additions & 3 deletions examples/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM golang:1.20
FROM golang:1.21

ENV GOPATH /go

WORKDIR /go/src/twilio-go
COPY go-client .

RUN go get -u github.com/twilio/twilio-go@main
RUN go get -u github.com/twilio/terraform-provider-twilio@main
# Initialize Go modules and download dependencies
RUN go mod download && go mod verify

# Install test dependencies
RUN go get github.com/stretchr/[email protected]

# pipefail prevents errors in a pipeline from being masked.
CMD ["/bin/bash", "-c", "sleep 25 && set -o pipefail && go test -race ./... -coverprofile /local/coverage.out -json | tee /local/test-report.out"]
29 changes: 2 additions & 27 deletions examples/go/go-client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,14 @@ go 1.21

require (
github.com/golang/mock v1.6.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1
github.com/stretchr/testify v1.7.0
github.com/twilio/terraform-provider-twilio v0.13.1
github.com/twilio/twilio-go v0.25.0
)

require (
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-version v1.4.0 // indirect
github.com/hashicorp/hcl/v2 v2.11.1 // indirect
github.com/hashicorp/terraform-plugin-go v0.7.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading