Skip to content

Commit ed5f757

Browse files
stainless-app[bot]aagarwal1012
authored andcommitted
feat(api): update openapi spec
1 parent 690dcf8 commit ed5f757

44 files changed

Lines changed: 930 additions & 795 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 115
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/dodo-payments/dodo-payments-29ffb4b7a04ca706ff7cd2a5b2b9363953827bb903eb30b6adea2b7290ce215e.yml
3-
openapi_spec_hash: da6d1a7b26410bd4bc919a82bf10645f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/dodo-payments/dodo-payments-61a2890a5da91623dd5fd97bae8c3fea69a24a6104947d3db52f36f832e7a5f8.yml
3+
openapi_spec_hash: 41f851f5361918b225779b7573bf1bd0
44
config_hash: 1a3f0a553228caf2b626869930f94aea

src/DodoPayments.Client.Tests/Models/Entitlements/EntitlementCreateParamsTest.cs

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void FieldRoundtrip_Works()
1414
{
1515
IntegrationConfig = new GitHubConfig()
1616
{
17-
Permission = "permission",
17+
Permission = Permission.Pull,
1818
TargetID = "target_id",
1919
},
2020
IntegrationType = EntitlementIntegrationType.Discord,
@@ -25,7 +25,7 @@ public void FieldRoundtrip_Works()
2525

2626
IntegrationConfig expectedIntegrationConfig = new GitHubConfig()
2727
{
28-
Permission = "permission",
28+
Permission = Permission.Pull,
2929
TargetID = "target_id",
3030
};
3131
ApiEnum<string, EntitlementIntegrationType> expectedIntegrationType =
@@ -48,24 +48,64 @@ public void FieldRoundtrip_Works()
4848
}
4949
}
5050

51+
[Fact]
52+
public void OptionalNonNullableParamsUnsetAreNotSet_Works()
53+
{
54+
var parameters = new EntitlementCreateParams
55+
{
56+
IntegrationConfig = new GitHubConfig()
57+
{
58+
Permission = Permission.Pull,
59+
TargetID = "target_id",
60+
},
61+
IntegrationType = EntitlementIntegrationType.Discord,
62+
Name = "name",
63+
Description = "description",
64+
};
65+
66+
Assert.Null(parameters.Metadata);
67+
Assert.False(parameters.RawBodyData.ContainsKey("metadata"));
68+
}
69+
70+
[Fact]
71+
public void OptionalNonNullableParamsSetToNullAreNotSet_Works()
72+
{
73+
var parameters = new EntitlementCreateParams
74+
{
75+
IntegrationConfig = new GitHubConfig()
76+
{
77+
Permission = Permission.Pull,
78+
TargetID = "target_id",
79+
},
80+
IntegrationType = EntitlementIntegrationType.Discord,
81+
Name = "name",
82+
Description = "description",
83+
84+
// Null should be interpreted as omitted for these properties
85+
Metadata = null,
86+
};
87+
88+
Assert.Null(parameters.Metadata);
89+
Assert.False(parameters.RawBodyData.ContainsKey("metadata"));
90+
}
91+
5192
[Fact]
5293
public void OptionalNullableParamsUnsetAreNotSet_Works()
5394
{
5495
var parameters = new EntitlementCreateParams
5596
{
5697
IntegrationConfig = new GitHubConfig()
5798
{
58-
Permission = "permission",
99+
Permission = Permission.Pull,
59100
TargetID = "target_id",
60101
},
61102
IntegrationType = EntitlementIntegrationType.Discord,
62103
Name = "name",
104+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
63105
};
64106

65107
Assert.Null(parameters.Description);
66108
Assert.False(parameters.RawBodyData.ContainsKey("description"));
67-
Assert.Null(parameters.Metadata);
68-
Assert.False(parameters.RawBodyData.ContainsKey("metadata"));
69109
}
70110

71111
[Fact]
@@ -75,20 +115,18 @@ public void OptionalNullableParamsSetToNullAreSetToNull_Works()
75115
{
76116
IntegrationConfig = new GitHubConfig()
77117
{
78-
Permission = "permission",
118+
Permission = Permission.Pull,
79119
TargetID = "target_id",
80120
},
81121
IntegrationType = EntitlementIntegrationType.Discord,
82122
Name = "name",
123+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
83124

84125
Description = null,
85-
Metadata = null,
86126
};
87127

88128
Assert.Null(parameters.Description);
89129
Assert.True(parameters.RawBodyData.ContainsKey("description"));
90-
Assert.Null(parameters.Metadata);
91-
Assert.True(parameters.RawBodyData.ContainsKey("metadata"));
92130
}
93131

94132
[Fact]
@@ -98,7 +136,7 @@ public void Url_Works()
98136
{
99137
IntegrationConfig = new GitHubConfig()
100138
{
101-
Permission = "permission",
139+
Permission = Permission.Pull,
102140
TargetID = "target_id",
103141
},
104142
IntegrationType = EntitlementIntegrationType.Discord,
@@ -117,7 +155,7 @@ public void CopyConstructor_Works()
117155
{
118156
IntegrationConfig = new GitHubConfig()
119157
{
120-
Permission = "permission",
158+
Permission = Permission.Pull,
121159
TargetID = "target_id",
122160
},
123161
IntegrationType = EntitlementIntegrationType.Discord,

src/DodoPayments.Client.Tests/Models/Entitlements/EntitlementListPageResponseTest.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ public void FieldRoundtrip_Works()
2222
CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
2323
IntegrationConfig = new IntegrationConfigResponseGitHubConfig()
2424
{
25-
Permission = "permission",
25+
Permission = IntegrationConfigResponseGitHubConfigPermission.Pull,
2626
TargetID = "target_id",
2727
},
2828
IntegrationType = EntitlementIntegrationType.Discord,
2929
IsActive = true,
30+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
3031
Name = "name",
3132
UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
3233
Description = "description",
33-
Metadata = JsonSerializer.Deserialize<JsonElement>("{}"),
3434
},
3535
],
3636
};
@@ -44,15 +44,15 @@ public void FieldRoundtrip_Works()
4444
CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
4545
IntegrationConfig = new IntegrationConfigResponseGitHubConfig()
4646
{
47-
Permission = "permission",
47+
Permission = IntegrationConfigResponseGitHubConfigPermission.Pull,
4848
TargetID = "target_id",
4949
},
5050
IntegrationType = EntitlementIntegrationType.Discord,
5151
IsActive = true,
52+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
5253
Name = "name",
5354
UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
5455
Description = "description",
55-
Metadata = JsonSerializer.Deserialize<JsonElement>("{}"),
5656
},
5757
];
5858

@@ -77,15 +77,15 @@ public void SerializationRoundtrip_Works()
7777
CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
7878
IntegrationConfig = new IntegrationConfigResponseGitHubConfig()
7979
{
80-
Permission = "permission",
80+
Permission = IntegrationConfigResponseGitHubConfigPermission.Pull,
8181
TargetID = "target_id",
8282
},
8383
IntegrationType = EntitlementIntegrationType.Discord,
8484
IsActive = true,
85+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
8586
Name = "name",
8687
UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
8788
Description = "description",
88-
Metadata = JsonSerializer.Deserialize<JsonElement>("{}"),
8989
},
9090
],
9191
};
@@ -113,15 +113,15 @@ public void FieldRoundtripThroughSerialization_Works()
113113
CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
114114
IntegrationConfig = new IntegrationConfigResponseGitHubConfig()
115115
{
116-
Permission = "permission",
116+
Permission = IntegrationConfigResponseGitHubConfigPermission.Pull,
117117
TargetID = "target_id",
118118
},
119119
IntegrationType = EntitlementIntegrationType.Discord,
120120
IsActive = true,
121+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
121122
Name = "name",
122123
UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
123124
Description = "description",
124-
Metadata = JsonSerializer.Deserialize<JsonElement>("{}"),
125125
},
126126
],
127127
};
@@ -142,15 +142,15 @@ public void FieldRoundtripThroughSerialization_Works()
142142
CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
143143
IntegrationConfig = new IntegrationConfigResponseGitHubConfig()
144144
{
145-
Permission = "permission",
145+
Permission = IntegrationConfigResponseGitHubConfigPermission.Pull,
146146
TargetID = "target_id",
147147
},
148148
IntegrationType = EntitlementIntegrationType.Discord,
149149
IsActive = true,
150+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
150151
Name = "name",
151152
UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
152153
Description = "description",
153-
Metadata = JsonSerializer.Deserialize<JsonElement>("{}"),
154154
},
155155
];
156156

@@ -175,15 +175,15 @@ public void Validation_Works()
175175
CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
176176
IntegrationConfig = new IntegrationConfigResponseGitHubConfig()
177177
{
178-
Permission = "permission",
178+
Permission = IntegrationConfigResponseGitHubConfigPermission.Pull,
179179
TargetID = "target_id",
180180
},
181181
IntegrationType = EntitlementIntegrationType.Discord,
182182
IsActive = true,
183+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
183184
Name = "name",
184185
UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
185186
Description = "description",
186-
Metadata = JsonSerializer.Deserialize<JsonElement>("{}"),
187187
},
188188
],
189189
};
@@ -205,15 +205,15 @@ public void CopyConstructor_Works()
205205
CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
206206
IntegrationConfig = new IntegrationConfigResponseGitHubConfig()
207207
{
208-
Permission = "permission",
208+
Permission = IntegrationConfigResponseGitHubConfigPermission.Pull,
209209
TargetID = "target_id",
210210
},
211211
IntegrationType = EntitlementIntegrationType.Discord,
212212
IsActive = true,
213+
Metadata = new Dictionary<string, string>() { { "foo", "string" } },
213214
Name = "name",
214215
UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),
215216
Description = "description",
216-
Metadata = JsonSerializer.Deserialize<JsonElement>("{}"),
217217
},
218218
],
219219
};

0 commit comments

Comments
 (0)