1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.libraries.entitlement; 18 19 import androidx.annotation.IntDef; 20 import androidx.annotation.NonNull; 21 import androidx.annotation.StringDef; 22 23 import com.google.auto.value.AutoValue; 24 import com.google.common.collect.ImmutableList; 25 26 import java.lang.annotation.Retention; 27 import java.lang.annotation.RetentionPolicy; 28 29 /** 30 * HTTP request parameters specific to on device service activation (ODSA). See GSMA spec TS.43 31 * section 6.2. 32 */ 33 @AutoValue 34 public abstract class EsimOdsaOperation { 35 /** ODSA operation unknown. For initialization only. */ 36 public static final String OPERATION_UNKNOWN = ""; 37 38 /** ODSA operation: CheckEligibility. */ 39 public static final String OPERATION_CHECK_ELIGIBILITY = "CheckEligibility"; 40 41 /** ODSA operation: ManageSubscription. */ 42 public static final String OPERATION_MANAGE_SUBSCRIPTION = "ManageSubscription"; 43 44 /** ODSA operation: ManageService. */ 45 public static final String OPERATION_MANAGE_SERVICE = "ManageService"; 46 47 /** ODSA operation: AcquireConfiguration. */ 48 public static final String OPERATION_ACQUIRE_CONFIGURATION = "AcquireConfiguration"; 49 50 /** ODSA operation: AcquireTemporaryToken. */ 51 public static final String OPERATION_ACQUIRE_TEMPORARY_TOKEN = "AcquireTemporaryToken"; 52 53 /** ODSA operation: GetPhoneNumber */ 54 public static final String OPERATION_GET_PHONE_NUMBER = "GetPhoneNumber"; 55 56 /** ODSA operation: AcquirePlan */ 57 public static final String OPERATION_ACQUIRE_PLAN = "AcquirePlan"; 58 59 /** ODSA operation: VerifyPhoneNumber */ 60 public static final String OPERATION_VERIFY_PHONE_NUMBER = "VerifyPhoneNumber"; 61 62 @Retention(RetentionPolicy.SOURCE) 63 @StringDef({ 64 OPERATION_UNKNOWN, 65 OPERATION_CHECK_ELIGIBILITY, 66 OPERATION_MANAGE_SUBSCRIPTION, 67 OPERATION_MANAGE_SERVICE, 68 OPERATION_ACQUIRE_CONFIGURATION, 69 OPERATION_ACQUIRE_PLAN, 70 OPERATION_ACQUIRE_TEMPORARY_TOKEN, 71 OPERATION_GET_PHONE_NUMBER, 72 OPERATION_VERIFY_PHONE_NUMBER 73 }) 74 public @interface OdsaOperation { 75 } 76 77 /** eSIM device’s service is unknown. */ 78 public static final int SERVICE_STATUS_UNKNOWN = -1; 79 80 /** eSIM device’s service is activated. */ 81 public static final int SERVICE_STATUS_ACTIVATED = 1; 82 83 /** eSIM device’s service is being activated. */ 84 public static final int SERVICE_STATUS_ACTIVATING = 2; 85 86 /** eSIM device’s service is not activated. */ 87 public static final int SERVICE_STATUS_DEACTIVATED = 3; 88 89 /** eSIM device’s service is not activated and the associated ICCID should not be reused. */ 90 public static final int SERVICE_STATUS_DEACTIVATED_NO_REUSE = 4; 91 92 @Retention(RetentionPolicy.SOURCE) 93 @IntDef({ 94 SERVICE_STATUS_UNKNOWN, 95 SERVICE_STATUS_ACTIVATED, 96 SERVICE_STATUS_ACTIVATING, 97 SERVICE_STATUS_DEACTIVATED, 98 SERVICE_STATUS_DEACTIVATED_NO_REUSE 99 }) 100 public @interface OdsaServiceStatus { 101 } 102 103 /** Indicates that operation_type is not set. */ 104 public static final int OPERATION_TYPE_NOT_SET = -1; 105 106 /** To activate a subscription, used by {@link #OPERATION_MANAGE_SUBSCRIPTION}. */ 107 public static final int OPERATION_TYPE_SUBSCRIBE = 0; 108 109 /** To cancel a subscription, used by {@link #OPERATION_MANAGE_SUBSCRIPTION}. */ 110 public static final int OPERATION_TYPE_UNSUBSCRIBE = 1; 111 112 /** To manage an existing subscription, for {@link #OPERATION_MANAGE_SUBSCRIPTION}. */ 113 public static final int OPERATION_TYPE_CHANGE_SUBSCRIPTION = 2; 114 115 /** 116 * To transfer a subscription from an existing device, used by {@link 117 * #OPERATION_MANAGE_SUBSCRIPTION}. 118 */ 119 public static final int OPERATION_TYPE_TRANSFER_SUBSCRIPTION = 3; 120 121 /** 122 * To inform the network of a subscription update, used by 123 * {@link #OPERATION_MANAGE_SUBSCRIPTION}. 124 */ 125 public static final int OPERATION_TYPE_UPDATE_SUBSCRIPTION = 4; 126 127 /** To activate a service, used by {@link #OPERATION_MANAGE_SERVICE}. */ 128 public static final int OPERATION_TYPE_ACTIVATE_SERVICE = 10; 129 130 /** To deactivate a service, used by {@link #OPERATION_MANAGE_SERVICE}. */ 131 public static final int OPERATION_TYPE_DEACTIVATE_SERVICE = 11; 132 133 @Retention(RetentionPolicy.SOURCE) 134 @IntDef({ 135 OPERATION_TYPE_NOT_SET, 136 OPERATION_TYPE_SUBSCRIBE, 137 OPERATION_TYPE_UNSUBSCRIBE, 138 OPERATION_TYPE_CHANGE_SUBSCRIPTION, 139 OPERATION_TYPE_TRANSFER_SUBSCRIPTION, 140 OPERATION_TYPE_UPDATE_SUBSCRIPTION, 141 OPERATION_TYPE_ACTIVATE_SERVICE, 142 OPERATION_TYPE_DEACTIVATE_SERVICE 143 }) 144 public @interface OdsaOperationType { 145 } 146 147 /** Operation result unknown. */ 148 public static final int OPERATION_RESULT_UNKNOWN = -1; 149 150 /** Operation was a success. */ 151 public static final int OPERATION_RESULT_SUCCESS = 1; 152 153 /** There was a general error during processing. */ 154 public static final int OPERATION_RESULT_ERROR_GENERAL = 100; 155 156 /** An invalid operation value was provided in request. */ 157 public static final int OPERATION_RESULT_ERROR_INVALID_OPERATION = 101; 158 159 /** An invalid parameter name or value was provided in request. */ 160 public static final int OPERATION_RESULT_ERROR_INVALID_PARAMETER = 102; 161 162 /** 163 * The optional operation is not supported by the carrier. Device should continue with the flow. 164 * This error only applies to optional operations (for example ManageService). 165 */ 166 public static final int OPERATION_RESULT_WARNING_NOT_SUPPORTED_OPERATION = 103; 167 168 /** The user has entered an invalid response for the MSG content. */ 169 public static final int OPERATION_RESULT_ERROR_INVALID_MSG_RESPONSE = 104; 170 171 @Retention(RetentionPolicy.SOURCE) 172 @IntDef({ 173 OPERATION_RESULT_UNKNOWN, 174 OPERATION_RESULT_SUCCESS, 175 OPERATION_RESULT_ERROR_GENERAL, 176 OPERATION_RESULT_ERROR_INVALID_OPERATION, 177 OPERATION_RESULT_ERROR_INVALID_PARAMETER, 178 OPERATION_RESULT_WARNING_NOT_SUPPORTED_OPERATION, 179 OPERATION_RESULT_ERROR_INVALID_MSG_RESPONSE 180 }) 181 public @interface OdsaOperationResult { 182 } 183 184 /** Companion service unknown. For initialization only. */ 185 public static final String COMPANION_SERVICE_UNKNOWN = ""; 186 187 /** Indicates the companion device carries the same MSISDN as the primary device. */ 188 public static final String COMPANION_SERVICE_SHARED_NUMBER = "SharedNumber"; 189 190 /** Indicates the companion device carries a different MSISDN as the primary device. */ 191 public static final String COMPANION_SERVICE_DIFFERENT_NUMBER = "DiffNumber"; 192 193 @Retention(RetentionPolicy.SOURCE) 194 @StringDef({ 195 COMPANION_SERVICE_UNKNOWN, 196 COMPANION_SERVICE_SHARED_NUMBER, 197 COMPANION_SERVICE_DIFFERENT_NUMBER 198 }) 199 public @interface CompanionService { 200 } 201 202 /** Indicates the MSG content has been rejected by the user. */ 203 public static final String MESSAGE_BUTTON_REJECTED = "0"; 204 205 /** Indicates the MSG content has been accepted by the user. */ 206 public static final String MESSAGE_BUTTON_ACCEPTED = "1"; 207 208 @Retention(RetentionPolicy.SOURCE) 209 @StringDef({ 210 MESSAGE_BUTTON_REJECTED, 211 MESSAGE_BUTTON_ACCEPTED 212 }) 213 public @interface MessageButton { 214 } 215 216 /** Unknown entitlement protocol. This will not be appended to the request. */ 217 public static final String ENTITLEMENT_PROTOCOL_UNKNOWN = ""; 218 219 /** Device supports TS.43 entitlement protocol. */ 220 public static final String ENTITLEMENT_PROTOCOL_TS43 = "0"; 221 222 /** Device does not support TS.43 entitlement protocol. */ 223 public static final String ENTITLEMENT_PROTOCOL_OTHER = "1"; 224 225 @Retention(RetentionPolicy.SOURCE) 226 @StringDef({ 227 ENTITLEMENT_PROTOCOL_UNKNOWN, 228 ENTITLEMENT_PROTOCOL_TS43, 229 ENTITLEMENT_PROTOCOL_OTHER 230 }) 231 public @interface EntitlementProtocol { 232 } 233 234 /** Returns the ODSA operation. Used by HTTP parameter {@code operation}. */ operation()235 public abstract String operation(); 236 237 /** 238 * Returns the detailed type of the ODSA operation. Used by HTTP parameter 239 * {@code operation_type}. 240 */ operationType()241 public abstract int operationType(); 242 243 /** 244 * Returns the comma separated list of operation targets used with temporary token from 245 * AcquireTemporaryToken operation. Used by HTTP parameter {@code operation_targets}. 246 */ operationTargets()247 public abstract ImmutableList<String> operationTargets(); 248 249 /** 250 * Returns the unique identifier of the companion device, like IMEI. Used by HTTP parameter 251 * {@code 252 * companion_terminal_id}. 253 */ companionTerminalId()254 public abstract String companionTerminalId(); 255 256 /** 257 * Returns the OEM of the companion device. Used by HTTP parameter {@code 258 * companion_terminal_vendor}. 259 */ companionTerminalVendor()260 public abstract String companionTerminalVendor(); 261 262 /** 263 * Returns the model of the companion device. Used by HTTP parameter {@code 264 * companion_terminal_model}. 265 */ companionTerminalModel()266 public abstract String companionTerminalModel(); 267 268 /** 269 * Returns the software version of the companion device. Used by HTTP parameter {@code 270 * companion_terminal_sw_version}. 271 */ companionTerminalSoftwareVersion()272 public abstract String companionTerminalSoftwareVersion(); 273 274 /** 275 * Returns the user-friendly version of the companion device. Used by HTTP parameter {@code 276 * companion_terminal_friendly_name}. 277 */ companionTerminalFriendlyName()278 public abstract String companionTerminalFriendlyName(); 279 280 /** 281 * Returns the service type of the companion device, e.g. if the MSISDN is same as the primary 282 * device. Used by HTTP parameter {@code companion_terminal_service}. 283 */ companionTerminalService()284 public abstract String companionTerminalService(); 285 286 /** 287 * Returns the ICCID of the companion device. Used by HTTP parameter {@code 288 * companion_terminal_iccid}. 289 */ companionTerminalIccid()290 public abstract String companionTerminalIccid(); 291 292 /** 293 * Returns the EID of the companion device. Used by HTTP parameter 294 * {@code companion_terminal_eid}. 295 */ companionTerminalEid()296 public abstract String companionTerminalEid(); 297 298 /** 299 * Returns the ICCID of the primary device eSIM. Used by HTTP parameter {@code terminal_iccid}. 300 */ terminalIccid()301 public abstract String terminalIccid(); 302 303 /** 304 * Returns the eUICC identifier (EID) of the primary device eSIM. Used by HTTP parameter {@code 305 * terminal_eid}. 306 */ terminalEid()307 public abstract String terminalEid(); 308 309 /** 310 * Returns the unique identifier of the primary device eSIM, like the IMEI associated with the 311 * eSIM. Used by HTTP parameter {@code target_terminal_id}. 312 */ targetTerminalId()313 public abstract String targetTerminalId(); 314 315 /** 316 * Returns the unique identifiers of the primary device eSIM if more than one, like the IMEIs on 317 * dual-SIM devices. Used by HTTP parameter {@code target_terminal_imeis}. 318 * 319 * <p>This is a non-standard params required by some carriers. 320 */ 321 @NonNull targetTerminalIds()322 public abstract ImmutableList<String> targetTerminalIds(); 323 324 /** 325 * Returns the ICCID primary device eSIM. Used by HTTP parameter {@code target_terminal_iccid}. 326 */ targetTerminalIccid()327 public abstract String targetTerminalIccid(); 328 329 /** 330 * Returns the eUICC identifier (EID) of the primary device eSIM. Used by HTTP parameter {@code 331 * target_terminal_eid}. 332 */ targetTerminalEid()333 public abstract String targetTerminalEid(); 334 335 /** 336 * Returns the serial number of primary device. Used by HTTP parameter 337 * {@code target_terminal_sn}. 338 * 339 * <p>This is a non-standard params required by some carriers. 340 */ 341 @NonNull targetTerminalSerialNumber()342 public abstract String targetTerminalSerialNumber(); 343 344 /** 345 * Returns the model of primary device. Used by HTTP parameter {@code target_terminal_model}. 346 * 347 * <p>This is a non-standard params required by some carriers. 348 */ 349 @NonNull targetTerminalModel()350 public abstract String targetTerminalModel(); 351 352 /** 353 * Returns whether the subscription transfer is for cross-TS.43 platform. Used by HTTP parameter 354 * {@code target_terminal_entitlement_protocol}. 355 * 356 * <p>This is an optional param for cross-platform. 357 */ 358 @NonNull 359 @EntitlementProtocol targetTerminalEntitlementProtocol()360 public abstract String targetTerminalEntitlementProtocol(); 361 362 /** 363 * Returns the unique identifier of the old device eSIM, like the IMEI associated with the eSIM. 364 * Used by HTTP parameter {@code old_terminal_id}. 365 */ oldTerminalId()366 public abstract String oldTerminalId(); 367 368 /** Returns the ICCID of old device eSIM. Used by HTTP parameter {@code old_terminal_iccid}. */ oldTerminalIccid()369 public abstract String oldTerminalIccid(); 370 371 /** 372 * Returns whether the subscription transfer is for cross-TS.43 platform. Used by HTTP parameter 373 * {@code old_terminal_entitlement_protocol}. 374 * 375 * <p>This is an optional param for cross-platform. 376 */ 377 @NonNull 378 @EntitlementProtocol oldTerminalEntitlementProtocol()379 public abstract String oldTerminalEntitlementProtocol(); 380 381 /** 382 * Returns the user response to the MSG content. Used by HTTP parameter {@code MSG_response}. 383 */ messageResponse()384 public abstract String messageResponse(); 385 386 /** 387 * Returns whether the user has accepted or rejected the MSG content. 388 * Used by HTTP parameter {@code MSG_btn}. 389 */ 390 @MessageButton messageButton()391 public abstract String messageButton(); 392 393 /** Returns a new {@link Builder} object. */ builder()394 public static Builder builder() { 395 return new AutoValue_EsimOdsaOperation.Builder() 396 .setOperation(OPERATION_UNKNOWN) 397 .setOperationType(OPERATION_TYPE_NOT_SET) 398 .setOperationTargets(ImmutableList.of()) 399 .setCompanionTerminalId("") 400 .setCompanionTerminalVendor("") 401 .setCompanionTerminalModel("") 402 .setCompanionTerminalSoftwareVersion("") 403 .setCompanionTerminalFriendlyName("") 404 .setCompanionTerminalService(COMPANION_SERVICE_UNKNOWN) 405 .setCompanionTerminalIccid("") 406 .setCompanionTerminalEid("") 407 .setTerminalIccid("") 408 .setTerminalEid("") 409 .setTargetTerminalId("") 410 .setTargetTerminalIds(ImmutableList.of()) 411 .setTargetTerminalIccid("") 412 .setTargetTerminalEid("") 413 .setTargetTerminalSerialNumber("") 414 .setTargetTerminalModel("") 415 .setTargetTerminalEntitlementProtocol(ENTITLEMENT_PROTOCOL_UNKNOWN) 416 .setOldTerminalId("") 417 .setOldTerminalIccid("") 418 .setOldTerminalEntitlementProtocol(ENTITLEMENT_PROTOCOL_UNKNOWN) 419 .setMessageResponse("") 420 .setMessageButton(""); 421 } 422 423 /** 424 * Builder. 425 * 426 * <p>For ODSA, the rule of which parameters are required varies or each 427 * operation/operation_type. 428 * The Javadoc below gives high-level description, but please refer to GSMA spec TS.43 section 429 * 6.2 430 * for details. 431 */ 432 @AutoValue.Builder 433 public abstract static class Builder { 434 /** 435 * Sets the eSIM ODSA operation. Used by HTTP parameter {@code operation}. 436 * 437 * @param operation ODSA operation. 438 * @return The builder. 439 * @see #OPERATION_CHECK_ELIGIBILITY 440 * @see #OPERATION_MANAGE_SUBSCRIPTION 441 * @see #OPERATION_MANAGE_SERVICE 442 * @see #OPERATION_ACQUIRE_CONFIGURATION 443 * @see #OPERATION_ACQUIRE_TEMPORARY_TOKEN 444 * @see #OPERATION_GET_PHONE_NUMBER 445 * @see #OPERATION_ACQUIRE_PLAN 446 * @see #OPERATION_VERIFY_PHONE_NUMBER 447 */ 448 @NonNull setOperation(@onNull @dsaOperation String operation)449 public abstract Builder setOperation(@NonNull @OdsaOperation String operation); 450 451 /** 452 * Sets the detailed type of the eSIM ODSA operation. Used by HTTP parameter 453 * "operation_type" if 454 * set. 455 * 456 * <p>Required by some operation. 457 * 458 * @see #OPERATION_TYPE_SUBSCRIBE 459 * @see #OPERATION_TYPE_UNSUBSCRIBE 460 * @see #OPERATION_TYPE_CHANGE_SUBSCRIPTION 461 * @see #OPERATION_TYPE_TRANSFER_SUBSCRIPTION 462 * @see #OPERATION_TYPE_UPDATE_SUBSCRIPTION 463 * @see #OPERATION_TYPE_ACTIVATE_SERVICE 464 * @see #OPERATION_TYPE_DEACTIVATE_SERVICE 465 */ 466 @NonNull setOperationType(@dsaOperationType int operationType)467 public abstract Builder setOperationType(@OdsaOperationType int operationType); 468 469 /** 470 * Sets the operation targets to be used with temporary token from AcquireTemporaryToken 471 * operation. Used by HTTP parameter {@code operation_targets} if set. 472 */ 473 @NonNull setOperationTargets( @onNull @dsaOperation ImmutableList<String> operationTargets)474 public abstract Builder setOperationTargets( 475 @NonNull @OdsaOperation ImmutableList<String> operationTargets); 476 477 /** 478 * Sets the unique identifier of the companion device, like IMEI. Used by HTTP parameter 479 * {@code 480 * companion_terminal_id} if set. 481 * 482 * <p>Used by companion device ODSA operation. 483 * 484 * @param companionTerminalId The unique identifier of the companion device. 485 * @return The builder. 486 */ 487 @NonNull setCompanionTerminalId(@onNull String companionTerminalId)488 public abstract Builder setCompanionTerminalId(@NonNull String companionTerminalId); 489 490 /** 491 * Sets the OEM of the companion device. Used by HTTP parameter {@code 492 * companion_terminal_vendor} if set. 493 * 494 * <p>Used by companion device ODSA operation. 495 * 496 * @param companionTerminalVendor The OEM of the companion device. 497 * @return The builder. 498 */ 499 @NonNull setCompanionTerminalVendor(@onNull String companionTerminalVendor)500 public abstract Builder setCompanionTerminalVendor(@NonNull String companionTerminalVendor); 501 502 /** 503 * Sets the model of the companion device. Used by HTTP parameter {@code 504 * companion_terminal_model} if set. 505 * 506 * <p>Used by companion device ODSA operation. 507 * 508 * @param companionTerminalModel The model of the companion device. 509 * @return The builder. 510 */ 511 @NonNull setCompanionTerminalModel(@onNull String companionTerminalModel)512 public abstract Builder setCompanionTerminalModel(@NonNull String companionTerminalModel); 513 514 /** 515 * Sets the software version of the companion device. Used by HTTP parameter {@code 516 * companion_terminal_sw_version} if set. 517 * 518 * <p>Used by companion device ODSA operation. 519 * 520 * @param companionTerminalSoftwareVersion The software version of the companion device. 521 * @return The builder. 522 */ 523 @NonNull setCompanionTerminalSoftwareVersion( @onNull String companionTerminalSoftwareVersion)524 public abstract Builder setCompanionTerminalSoftwareVersion( 525 @NonNull String companionTerminalSoftwareVersion); 526 527 /** 528 * Sets the user-friendly version of the companion device. Used by HTTP parameter {@code 529 * companion_terminal_friendly_name} if set. 530 * 531 * <p>Used by companion device ODSA operation. 532 * 533 * @param companionTerminalFriendlyName The user-friendly version of the companion device. 534 * @return The builder. 535 */ 536 @NonNull setCompanionTerminalFriendlyName( @onNull String companionTerminalFriendlyName)537 public abstract Builder setCompanionTerminalFriendlyName( 538 @NonNull String companionTerminalFriendlyName); 539 540 /** 541 * Sets the service type of the companion device, e.g. if the MSISDN is same as the primary 542 * device. Used by HTTP parameter {@code companion_terminal_service} if set. 543 * 544 * <p>Used by companion device ODSA operation. 545 * 546 * @param companionTerminalService The service type of the companion device. 547 * @return The builder. 548 * @see #COMPANION_SERVICE_SHARED_NUMBER 549 * @see #COMPANION_SERVICE_DIFFERENT_NUMBER 550 */ 551 @NonNull setCompanionTerminalService( @onNull @ompanionService String companionTerminalService)552 public abstract Builder setCompanionTerminalService( 553 @NonNull @CompanionService String companionTerminalService); 554 555 /** 556 * Sets the ICCID of the companion device. Used by HTTP parameter {@code 557 * companion_terminal_iccid} if set. 558 * 559 * <p>Used by companion device ODSA operation. 560 * 561 * @param companionTerminalIccid The ICCID of the companion device. 562 * @return The builder. 563 */ 564 @NonNull setCompanionTerminalIccid(@onNull String companionTerminalIccid)565 public abstract Builder setCompanionTerminalIccid(@NonNull String companionTerminalIccid); 566 567 /** 568 * Sets the eUICC identifier (EID) of the companion device. Used by HTTP parameter {@code 569 * companion_terminal_eid} if set. 570 * 571 * <p>Used by companion device ODSA operation. 572 * 573 * @param companionTerminalEid The eUICC identifier (EID) of the companion device. 574 * @return The builder. 575 */ 576 @NonNull setCompanionTerminalEid(@onNull String companionTerminalEid)577 public abstract Builder setCompanionTerminalEid(@NonNull String companionTerminalEid); 578 579 /** 580 * Sets the ICCID of the primary device eSIM in case of primary SIM not present. Used by 581 * HTTP 582 * parameter {@code terminal_eid} if set. 583 * 584 * <p>Used by primary device ODSA operation. 585 * 586 * @param terminalIccid The ICCID of the primary device eSIM in case of primary SIM not 587 * present. 588 * @return The builder. 589 */ 590 @NonNull setTerminalIccid(@onNull String terminalIccid)591 public abstract Builder setTerminalIccid(@NonNull String terminalIccid); 592 593 /** 594 * Sets the eUICC identifier (EID) of the primary device eSIM in case of primary SIM not 595 * present. Used by HTTP parameter {@code terminal_eid} if set. 596 * 597 * <p>Used by primary device ODSA operation. 598 * 599 * @param terminalEid The eUICC identifier (EID) of the primary device eSIM in case of 600 * primary 601 * SIM not present. 602 * @return The builder. 603 */ 604 @NonNull setTerminalEid(@onNull String terminalEid)605 public abstract Builder setTerminalEid(@NonNull String terminalEid); 606 607 /** 608 * Sets the unique identifier of the primary device eSIM in case of multiple SIM, like the 609 * IMEI 610 * associated with the eSIM. Used by HTTP parameter {@code target_terminal_id} if set. 611 * 612 * <p>Used by primary device ODSA operation. 613 * 614 * @param targetTerminalId The unique identifier of the primary device eSIM in case of 615 * multiple 616 * SIM. 617 * @return The builder. 618 */ 619 @NonNull setTargetTerminalId(@onNull String targetTerminalId)620 public abstract Builder setTargetTerminalId(@NonNull String targetTerminalId); 621 622 /** 623 * Sets the unique identifiers of the primary device eSIM if more than one, like the IMEIs 624 * on 625 * dual-SIM devices. Used by HTTP parameter {@code target_terminal_imeis}. 626 * 627 * <p>This is a non-standard params required by some carriers. 628 * 629 * @param targetTerminalIds The unique identifiers of the primary device eSIM if more than 630 * one. 631 * @return The builder. 632 */ setTargetTerminalIds( @onNull ImmutableList<String> targetTerminalIds)633 public abstract Builder setTargetTerminalIds( 634 @NonNull ImmutableList<String> targetTerminalIds); 635 636 /** 637 * Sets the ICCID primary device eSIM in case of multiple SIM. Used by HTTP parameter {@code 638 * target_terminal_iccid} if set. 639 * 640 * <p>Used by primary device ODSA operation. 641 * 642 * @param targetTerminalIccid The ICCID primary device eSIM in case of multiple SIM. 643 * @return The builder. 644 */ 645 @NonNull setTargetTerminalIccid(@onNull String targetTerminalIccid)646 public abstract Builder setTargetTerminalIccid(@NonNull String targetTerminalIccid); 647 648 /** 649 * Sets the eUICC identifier (EID) of the primary device eSIM in case of multiple SIM. Used 650 * by 651 * HTTP parameter {@code target_terminal_eid} if set. 652 * 653 * <p>Used by primary device ODSA operation. 654 * 655 * @param terminalEid The eUICC identifier (EID) of the primary device eSIM in case of 656 * multiple 657 * SIM. 658 * @return The builder. 659 */ 660 @NonNull setTargetTerminalEid(@onNull String terminalEid)661 public abstract Builder setTargetTerminalEid(@NonNull String terminalEid); 662 663 /** 664 * Sets the serial number of primary device. Used by HTTP parameter 665 * {@code target_terminal_sn}. 666 * 667 * @param targetTerminalSerialNumber The serial number of primary device. 668 * <p>This is a non-standard params required by some 669 * carriers. 670 * @return The builder. 671 */ 672 @NonNull setTargetTerminalSerialNumber( @onNull String targetTerminalSerialNumber)673 public abstract Builder setTargetTerminalSerialNumber( 674 @NonNull String targetTerminalSerialNumber); 675 676 /** 677 * Sets the model of primary device. Used by HTTP parameter {@code target_terminal_model}. 678 * 679 * @param targetTerminalModel The model of primary device. 680 * <p>This is a non-standard params required by some carriers. 681 * @return The builder. 682 */ 683 @NonNull setTargetTerminalModel(@onNull String targetTerminalModel)684 public abstract Builder setTargetTerminalModel(@NonNull String targetTerminalModel); 685 686 /** 687 * Sets the entitlement protocol of primary device. Used by HTTP parameter 688 * {@code target_terminal_entitlement_protocol}. 689 * 690 * @param targetTerminalEntitlementProtocol The entitlement protocol of primary device. 691 * <p>This is an optional param for cross-platform. 692 * @return The builder. 693 */ 694 @NonNull setTargetTerminalEntitlementProtocol( @onNull @ntitlementProtocol String targetTerminalEntitlementProtocol)695 public abstract Builder setTargetTerminalEntitlementProtocol( 696 @NonNull @EntitlementProtocol String targetTerminalEntitlementProtocol); 697 698 /** 699 * Sets the unique identifier of the old device eSIM, like the IMEI associated with the 700 * eSIM. 701 * Used by HTTP parameter {@code old_terminal_id} if set. 702 * 703 * <p>Used by primary device ODSA operation. 704 * 705 * @param oldTerminalId The unique identifier of the old device eSIM. 706 * @return The builder. 707 */ 708 @NonNull setOldTerminalId(@onNull String oldTerminalId)709 public abstract Builder setOldTerminalId(@NonNull String oldTerminalId); 710 711 /** 712 * Sets the ICCID old device eSIM. Used by HTTP parameter {@code old_terminal_iccid} if set. 713 * 714 * <p>Used by primary device ODSA operation. 715 * 716 * @param oldTerminalIccid The ICCID old device eSIM. 717 * @return The builder. 718 */ 719 @NonNull setOldTerminalIccid(@onNull String oldTerminalIccid)720 public abstract Builder setOldTerminalIccid(@NonNull String oldTerminalIccid); 721 722 /** 723 * Sets the entitlement protocol of the old device. Used by HTTP parameter 724 * {@code old_terminal_entitlement_protocol}. 725 * 726 * @param oldTerminalEntitlementProtocol The entitlement protocol of the old device. 727 * <p>This is an optional param for cross-platform. 728 * @return The builder. 729 */ 730 @NonNull setOldTerminalEntitlementProtocol( @onNull @ntitlementProtocol String oldTerminalEntitlementProtocol)731 public abstract Builder setOldTerminalEntitlementProtocol( 732 @NonNull @EntitlementProtocol String oldTerminalEntitlementProtocol); 733 734 /** 735 * Sets the user response to the MSG content. Used by HTTP parameter {@code MSG_response} 736 * if set. 737 * 738 * <p>Used by primary device ODSA operation. 739 * 740 * @param messageResponse The response entered by the user on the device UI. 741 * @return The builder. 742 */ 743 @NonNull setMessageResponse(@onNull String messageResponse)744 public abstract Builder setMessageResponse(@NonNull String messageResponse); 745 746 /** 747 * Sets whether the user has accepted or rejected the MSG content. Used by HTTP parameter 748 * {@code MSG_btn} if set. 749 * 750 * <p>Used by primary device ODSA operation. 751 * 752 * @param messageButton Whether the user has accepted or rejected the MSG content. 753 * @return The builder. 754 */ 755 @NonNull setMessageButton(@onNull String messageButton)756 public abstract Builder setMessageButton(@NonNull String messageButton); 757 758 /** Returns the {@link EsimOdsaOperation} object. */ 759 @NonNull build()760 public abstract EsimOdsaOperation build(); 761 } 762 } 763