Skip to content

Commit 13e5c4a

Browse files
author
stlc-bot
committed
feat(api)!: sync OpenAPI spec from production
Stainless-Generated-From: e870500
1 parent fa8f323 commit 13e5c4a

41 files changed

Lines changed: 746 additions & 142 deletions

Some content is hidden

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

‎sent-java-core/src/main/kotlin/dm/sent/client/SentClient.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ interface SentClient {
110110
* capability's fields and the profile owns that one instead.
111111
*
112112
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot. A
113-
* profile either has a sender of its own or terminates through your shared routes.
113+
* profile either has a sender of its own or reaches only the countries Sent runs a shared route
114+
* for, and the US is not one of them.
114115
*
115116
* To act for a profile on any other resource, send `x-profile-id` with your organization key
116117
* rather than looking for a parallel set of endpoints.
@@ -307,7 +308,8 @@ interface SentClient {
307308
* Supply a capability's fields and the profile owns that one instead.
308309
*
309310
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot.
310-
* A profile either has a sender of its own or terminates through your shared routes.
311+
* A profile either has a sender of its own or reaches only the countries Sent runs a shared
312+
* route for, and the US is not one of them.
311313
*
312314
* To act for a profile on any other resource, send `x-profile-id` with your organization
313315
* key rather than looking for a parallel set of endpoints.

‎sent-java-core/src/main/kotlin/dm/sent/client/SentClientAsync.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ interface SentClientAsync {
110110
* capability's fields and the profile owns that one instead.
111111
*
112112
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot. A
113-
* profile either has a sender of its own or terminates through your shared routes.
113+
* profile either has a sender of its own or reaches only the countries Sent runs a shared route
114+
* for, and the US is not one of them.
114115
*
115116
* To act for a profile on any other resource, send `x-profile-id` with your organization key
116117
* rather than looking for a parallel set of endpoints.
@@ -307,7 +308,8 @@ interface SentClientAsync {
307308
* Supply a capability's fields and the profile owns that one instead.
308309
*
309310
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot.
310-
* A profile either has a sender of its own or terminates through your shared routes.
311+
* A profile either has a sender of its own or reaches only the countries Sent runs a shared
312+
* route for, and the US is not one of them.
311313
*
312314
* To act for a profile on any other resource, send `x-profile-id` with your organization
313315
* key rather than looking for a parallel set of endpoints.

‎sent-java-core/src/main/kotlin/dm/sent/client/SentClientAsyncImpl.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ class SentClientAsyncImpl(private val clientOptions: ClientOptions) : SentClient
160160
* capability's fields and the profile owns that one instead.
161161
*
162162
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot. A
163-
* profile either has a sender of its own or terminates through your shared routes.
163+
* profile either has a sender of its own or reaches only the countries Sent runs a shared route
164+
* for, and the US is not one of them.
164165
*
165166
* To act for a profile on any other resource, send `x-profile-id` with your organization key
166167
* rather than looking for a parallel set of endpoints.
@@ -398,7 +399,8 @@ class SentClientAsyncImpl(private val clientOptions: ClientOptions) : SentClient
398399
* Supply a capability's fields and the profile owns that one instead.
399400
*
400401
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot.
401-
* A profile either has a sender of its own or terminates through your shared routes.
402+
* A profile either has a sender of its own or reaches only the countries Sent runs a shared
403+
* route for, and the US is not one of them.
402404
*
403405
* To act for a profile on any other resource, send `x-profile-id` with your organization
404406
* key rather than looking for a parallel set of endpoints.

‎sent-java-core/src/main/kotlin/dm/sent/client/SentClientImpl.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ class SentClientImpl(private val clientOptions: ClientOptions) : SentClient {
146146
* capability's fields and the profile owns that one instead.
147147
*
148148
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot. A
149-
* profile either has a sender of its own or terminates through your shared routes.
149+
* profile either has a sender of its own or reaches only the countries Sent runs a shared route
150+
* for, and the US is not one of them.
150151
*
151152
* To act for a profile on any other resource, send `x-profile-id` with your organization key
152153
* rather than looking for a parallel set of endpoints.
@@ -384,7 +385,8 @@ class SentClientImpl(private val clientOptions: ClientOptions) : SentClient {
384385
* Supply a capability's fields and the profile owns that one instead.
385386
*
386387
* **A sender is the exception.** A brand and a campaign can be inherited; a number cannot.
387-
* A profile either has a sender of its own or terminates through your shared routes.
388+
* A profile either has a sender of its own or reaches only the countries Sent runs a shared
389+
* route for, and the US is not one of them.
388390
*
389391
* To act for a profile on any other resource, send `x-profile-id` with your organization
390392
* key rather than looking for a parallel set of endpoints.

‎sent-java-core/src/main/kotlin/dm/sent/models/channels/sms/SmsCreateParams.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ import kotlin.jvm.optionals.getOrNull
8686
* `TEN_DLC` numbers belong to the market's campaign and are assigned when the campaign is approved,
8787
* not at request time. Until then they read as `PROVISIONING` in the response's `numbers`, each
8888
* with the area code it was asked for. A profile inheriting your organization's campaign cannot
89-
* request `numbers` (`400`). `numbers` on a `TEN_DLC` market you already hold is `409`: its numbers
90-
* belong to its one campaign and are set when the market is created.
89+
* request `numbers` (`400`). `numbers` on a `TEN_DLC` market you already hold is `409`: change its
90+
* campaign's numbers with `PATCH /v3/channels/sms/{country}/{type}`, add numbers to one of its
91+
* campaigns with `POST /v3/channels/sms/numbers/US/TEN_DLC`, or add a new campaign with `POST
92+
* /v3/channels/sms/compliances/US/TEN_DLC/campaigns`.
9193
*
9294
* **A market you already send in is `409`**: adding what is already there is a mistake worth
9395
* reporting rather than a silent no-op. A market is a `(country, sender_type)` pair, so a **second

‎sent-java-core/src/main/kotlin/dm/sent/models/channels/sms/SmsMarket.kt‎

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ private constructor(
3636
private val numbers: JsonField<List<SmsNumber>>,
3737
private val reason: JsonField<String>,
3838
private val reasonCode: JsonField<String>,
39-
private val senderValue: JsonField<String>,
4039
private val status: JsonField<Status>,
4140
private val additionalProperties: MutableMap<String, JsonValue>,
4241
) {
@@ -57,21 +56,8 @@ private constructor(
5756
@JsonProperty("reason_code")
5857
@ExcludeMissing
5958
reasonCode: JsonField<String> = JsonMissing.of(),
60-
@JsonProperty("sender_value")
61-
@ExcludeMissing
62-
senderValue: JsonField<String> = JsonMissing.of(),
6359
@JsonProperty("status") @ExcludeMissing status: JsonField<Status> = JsonMissing.of(),
64-
) : this(
65-
compliance,
66-
country,
67-
numberType,
68-
numbers,
69-
reason,
70-
reasonCode,
71-
senderValue,
72-
status,
73-
mutableMapOf(),
74-
)
60+
) : this(compliance, country, numberType, numbers, reason, reasonCode, status, mutableMapOf())
7561

7662
/**
7763
* What a market has been given: the identity it registers under, its programme, and any
@@ -138,16 +124,6 @@ private constructor(
138124
*/
139125
fun reasonCode(): Optional<String> = reasonCode.getOptional("reason_code")
140126

141-
/**
142-
* The sender itself. Null until a carrier-assigned number is procured. For a market holding
143-
* several numbers, the first active one (the first assigned while none is active) — every
144-
* number is in numbers.
145-
*
146-
* @throws SentInvalidDataException if the JSON field has an unexpected type (e.g. if the server
147-
* responded with an unexpected value).
148-
*/
149-
fun senderValue(): Optional<String> = senderValue.getOptional("sender_value")
150-
151127
/**
152128
* Where this market's sender stands, in terms of who is holding it up — PROVISIONING,
153129
* ACTION_NEEDED, PENDING_REVIEW or ACTIVE. Read-only.
@@ -211,15 +187,6 @@ private constructor(
211187
*/
212188
@JsonProperty("reason_code") @ExcludeMissing fun _reasonCode(): JsonField<String> = reasonCode
213189

214-
/**
215-
* Returns the raw JSON value of [senderValue].
216-
*
217-
* Unlike [senderValue], this method doesn't throw if the JSON field has an unexpected type.
218-
*/
219-
@JsonProperty("sender_value")
220-
@ExcludeMissing
221-
fun _senderValue(): JsonField<String> = senderValue
222-
223190
/**
224191
* Returns the raw JSON value of [status].
225192
*
@@ -254,7 +221,6 @@ private constructor(
254221
private var numbers: JsonField<MutableList<SmsNumber>>? = null
255222
private var reason: JsonField<String> = JsonMissing.of()
256223
private var reasonCode: JsonField<String> = JsonMissing.of()
257-
private var senderValue: JsonField<String> = JsonMissing.of()
258224
private var status: JsonField<Status> = JsonMissing.of()
259225
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
260226

@@ -266,7 +232,6 @@ private constructor(
266232
numbers = smsMarket.numbers.map { it.toMutableList() }
267233
reason = smsMarket.reason
268234
reasonCode = smsMarket.reasonCode
269-
senderValue = smsMarket.senderValue
270235
status = smsMarket.status
271236
additionalProperties = smsMarket.additionalProperties.toMutableMap()
272237
}
@@ -402,25 +367,6 @@ private constructor(
402367
*/
403368
fun reasonCode(reasonCode: JsonField<String>) = apply { this.reasonCode = reasonCode }
404369

405-
/**
406-
* The sender itself. Null until a carrier-assigned number is procured. For a market holding
407-
* several numbers, the first active one (the first assigned while none is active) — every
408-
* number is in numbers.
409-
*/
410-
fun senderValue(senderValue: String?) = senderValue(JsonField.ofNullable(senderValue))
411-
412-
/** Alias for calling [Builder.senderValue] with `senderValue.orElse(null)`. */
413-
fun senderValue(senderValue: Optional<String>) = senderValue(senderValue.getOrNull())
414-
415-
/**
416-
* Sets [Builder.senderValue] to an arbitrary JSON value.
417-
*
418-
* You should usually call [Builder.senderValue] with a well-typed [String] value instead.
419-
* This method is primarily for setting the field to an undocumented or not yet supported
420-
* value.
421-
*/
422-
fun senderValue(senderValue: JsonField<String>) = apply { this.senderValue = senderValue }
423-
424370
/**
425371
* Where this market's sender stands, in terms of who is holding it up — PROVISIONING,
426372
* ACTION_NEEDED, PENDING_REVIEW or ACTIVE. Read-only.
@@ -481,7 +427,6 @@ private constructor(
481427
(numbers ?: JsonMissing.of()).map { it.toImmutable() },
482428
reason,
483429
reasonCode,
484-
senderValue,
485430
status,
486431
additionalProperties.toMutableMap(),
487432
)
@@ -508,7 +453,6 @@ private constructor(
508453
numbers().ifPresent { it.forEach { it.validate() } }
509454
reason()
510455
reasonCode()
511-
senderValue()
512456
status().ifPresent { it.validate() }
513457
validated = true
514458
}
@@ -534,7 +478,6 @@ private constructor(
534478
(numbers.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
535479
(if (reason.asKnown().isPresent) 1 else 0) +
536480
(if (reasonCode.asKnown().isPresent) 1 else 0) +
537-
(if (senderValue.asKnown().isPresent) 1 else 0) +
538481
(status.asKnown().getOrNull()?.validity() ?: 0)
539482

540483
/**
@@ -792,7 +735,6 @@ private constructor(
792735
numbers == other.numbers &&
793736
reason == other.reason &&
794737
reasonCode == other.reasonCode &&
795-
senderValue == other.senderValue &&
796738
status == other.status &&
797739
additionalProperties == other.additionalProperties
798740
}
@@ -805,7 +747,6 @@ private constructor(
805747
numbers,
806748
reason,
807749
reasonCode,
808-
senderValue,
809750
status,
810751
additionalProperties,
811752
)
@@ -814,5 +755,5 @@ private constructor(
814755
override fun hashCode(): Int = hashCode
815756

816757
override fun toString() =
817-
"SmsMarket{compliance=$compliance, country=$country, numberType=$numberType, numbers=$numbers, reason=$reason, reasonCode=$reasonCode, senderValue=$senderValue, status=$status, additionalProperties=$additionalProperties}"
758+
"SmsMarket{compliance=$compliance, country=$country, numberType=$numberType, numbers=$numbers, reason=$reason, reasonCode=$reasonCode, status=$status, additionalProperties=$additionalProperties}"
818759
}

‎sent-java-core/src/main/kotlin/dm/sent/models/channels/sms/SmsNumber.kt‎

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class SmsNumber
2121
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2222
private constructor(
2323
private val areaCode: JsonField<String>,
24+
private val campaignId: JsonField<String>,
2425
private val senderValue: JsonField<String>,
2526
private val status: JsonField<String>,
2627
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -29,11 +30,14 @@ private constructor(
2930
@JsonCreator
3031
private constructor(
3132
@JsonProperty("area_code") @ExcludeMissing areaCode: JsonField<String> = JsonMissing.of(),
33+
@JsonProperty("campaign_id")
34+
@ExcludeMissing
35+
campaignId: JsonField<String> = JsonMissing.of(),
3236
@JsonProperty("sender_value")
3337
@ExcludeMissing
3438
senderValue: JsonField<String> = JsonMissing.of(),
3539
@JsonProperty("status") @ExcludeMissing status: JsonField<String> = JsonMissing.of(),
36-
) : this(areaCode, senderValue, status, mutableMapOf())
40+
) : this(areaCode, campaignId, senderValue, status, mutableMapOf())
3741

3842
/**
3943
* The number's area code, e.g. 212. While the number is still to be assigned, the area code it
@@ -44,6 +48,16 @@ private constructor(
4448
*/
4549
fun areaCode(): Optional<String> = areaCode.getOptional("area_code")
4650

51+
/**
52+
* The campaign the number is on, or is owed for: the id of its entry in compliance.campaigns.
53+
* Omitted for a market that registers no campaigns, and where the campaign is not known — a
54+
* number recorded without one, or one owed on a campaign inherited from the organization.
55+
*
56+
* @throws SentInvalidDataException if the JSON field has an unexpected type (e.g. if the server
57+
* responded with an unexpected value).
58+
*/
59+
fun campaignId(): Optional<String> = campaignId.getOptional("campaign_id")
60+
4761
/**
4862
* The number, or null while it is still to be assigned.
4963
*
@@ -68,6 +82,13 @@ private constructor(
6882
*/
6983
@JsonProperty("area_code") @ExcludeMissing fun _areaCode(): JsonField<String> = areaCode
7084

85+
/**
86+
* Returns the raw JSON value of [campaignId].
87+
*
88+
* Unlike [campaignId], this method doesn't throw if the JSON field has an unexpected type.
89+
*/
90+
@JsonProperty("campaign_id") @ExcludeMissing fun _campaignId(): JsonField<String> = campaignId
91+
7192
/**
7293
* Returns the raw JSON value of [senderValue].
7394
*
@@ -106,13 +127,15 @@ private constructor(
106127
class Builder internal constructor() {
107128

108129
private var areaCode: JsonField<String> = JsonMissing.of()
130+
private var campaignId: JsonField<String> = JsonMissing.of()
109131
private var senderValue: JsonField<String> = JsonMissing.of()
110132
private var status: JsonField<String> = JsonMissing.of()
111133
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
112134

113135
@JvmSynthetic
114136
internal fun from(smsNumber: SmsNumber) = apply {
115137
areaCode = smsNumber.areaCode
138+
campaignId = smsNumber.campaignId
116139
senderValue = smsNumber.senderValue
117140
status = smsNumber.status
118141
additionalProperties = smsNumber.additionalProperties.toMutableMap()
@@ -135,6 +158,26 @@ private constructor(
135158
*/
136159
fun areaCode(areaCode: JsonField<String>) = apply { this.areaCode = areaCode }
137160

161+
/**
162+
* The campaign the number is on, or is owed for: the id of its entry in
163+
* compliance.campaigns. Omitted for a market that registers no campaigns, and where the
164+
* campaign is not known — a number recorded without one, or one owed on a campaign
165+
* inherited from the organization.
166+
*/
167+
fun campaignId(campaignId: String?) = campaignId(JsonField.ofNullable(campaignId))
168+
169+
/** Alias for calling [Builder.campaignId] with `campaignId.orElse(null)`. */
170+
fun campaignId(campaignId: Optional<String>) = campaignId(campaignId.getOrNull())
171+
172+
/**
173+
* Sets [Builder.campaignId] to an arbitrary JSON value.
174+
*
175+
* You should usually call [Builder.campaignId] with a well-typed [String] value instead.
176+
* This method is primarily for setting the field to an undocumented or not yet supported
177+
* value.
178+
*/
179+
fun campaignId(campaignId: JsonField<String>) = apply { this.campaignId = campaignId }
180+
138181
/** The number, or null while it is still to be assigned. */
139182
fun senderValue(senderValue: String?) = senderValue(JsonField.ofNullable(senderValue))
140183

@@ -192,7 +235,13 @@ private constructor(
192235
* Further updates to this [Builder] will not mutate the returned instance.
193236
*/
194237
fun build(): SmsNumber =
195-
SmsNumber(areaCode, senderValue, status, additionalProperties.toMutableMap())
238+
SmsNumber(
239+
areaCode,
240+
campaignId,
241+
senderValue,
242+
status,
243+
additionalProperties.toMutableMap(),
244+
)
196245
}
197246

198247
private var validated: Boolean = false
@@ -211,6 +260,7 @@ private constructor(
211260
}
212261

213262
areaCode()
263+
campaignId()
214264
senderValue()
215265
status()
216266
validated = true
@@ -232,6 +282,7 @@ private constructor(
232282
@JvmSynthetic
233283
internal fun validity(): Int =
234284
(if (areaCode.asKnown().isPresent) 1 else 0) +
285+
(if (campaignId.asKnown().isPresent) 1 else 0) +
235286
(if (senderValue.asKnown().isPresent) 1 else 0) +
236287
(if (status.asKnown().isPresent) 1 else 0)
237288

@@ -242,17 +293,18 @@ private constructor(
242293

243294
return other is SmsNumber &&
244295
areaCode == other.areaCode &&
296+
campaignId == other.campaignId &&
245297
senderValue == other.senderValue &&
246298
status == other.status &&
247299
additionalProperties == other.additionalProperties
248300
}
249301

250302
private val hashCode: Int by lazy {
251-
Objects.hash(areaCode, senderValue, status, additionalProperties)
303+
Objects.hash(areaCode, campaignId, senderValue, status, additionalProperties)
252304
}
253305

254306
override fun hashCode(): Int = hashCode
255307

256308
override fun toString() =
257-
"SmsNumber{areaCode=$areaCode, senderValue=$senderValue, status=$status, additionalProperties=$additionalProperties}"
309+
"SmsNumber{areaCode=$areaCode, campaignId=$campaignId, senderValue=$senderValue, status=$status, additionalProperties=$additionalProperties}"
258310
}

0 commit comments

Comments
 (0)