Module: Telnyx::Models::MobilePushCredentialCreateParams::CreateMobilePushCredentialRequest

Extended by:
Internal::Type::Union
Defined in:
lib/telnyx/models/mobile_push_credential_create_params.rb

Defined Under Namespace

Classes: Android, Ios

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Instance Method Details

#initialize(alias_:, certificate:, private_key:, type: :ios) ⇒ Object

Parameters:

  • alias_ (String)

    Alias to uniquely identify the credential

  • certificate (String)

    Certificate as received from APNs

  • private_key (String)

    Corresponding private key to the certificate as received from APNs

  • type (Symbol, :ios) (defaults to: :ios)

    Type of mobile push credential. Should be ios here



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/telnyx/models/mobile_push_credential_create_params.rb', line 21

module CreateMobilePushCredentialRequest
  extend Telnyx::Internal::Type::Union

  discriminator :type

  variant :ios, -> { Telnyx::MobilePushCredentialCreateParams::CreateMobilePushCredentialRequest::Ios }

  variant :android,
          -> { Telnyx::MobilePushCredentialCreateParams::CreateMobilePushCredentialRequest::Android }

  class Ios < Telnyx::Internal::Type::BaseModel
    # @!attribute alias_
    #   Alias to uniquely identify the credential
    #
    #   @return [String]
    required :alias_, String, api_name: :alias

    # @!attribute certificate
    #   Certificate as received from APNs
    #
    #   @return [String]
    required :certificate, String

    # @!attribute private_key
    #   Corresponding private key to the certificate as received from APNs
    #
    #   @return [String]
    required :private_key, String

    # @!attribute type
    #   Type of mobile push credential. Should be <code>ios</code> here
    #
    #   @return [Symbol, :ios]
    required :type, const: :ios

    # @!method initialize(alias_:, certificate:, private_key:, type: :ios)
    #   @param alias_ [String] Alias to uniquely identify the credential
    #
    #   @param certificate [String] Certificate as received from APNs
    #
    #   @param private_key [String] Corresponding private key to the certificate as received from APNs
    #
    #   @param type [Symbol, :ios] Type of mobile push credential. Should be <code>ios</code> here
  end

  class Android < Telnyx::Internal::Type::BaseModel
    # @!attribute alias_
    #   Alias to uniquely identify the credential
    #
    #   @return [String]
    required :alias_, String, api_name: :alias

    # @!attribute project_account_json_file
    #   Private key file in JSON format
    #
    #   @return [Hash{Symbol=>Object}]
    required :project_account_json_file, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

    # @!attribute type
    #   Type of mobile push credential. Should be <code>android</code> here
    #
    #   @return [Symbol, :android]
    required :type, const: :android

    # @!method initialize(alias_:, project_account_json_file:, type: :android)
    #   @param alias_ [String] Alias to uniquely identify the credential
    #
    #   @param project_account_json_file [Hash{Symbol=>Object}] Private key file in JSON format
    #
    #   @param type [Symbol, :android] Type of mobile push credential. Should be <code>android</code> here
  end

  # @!method self.variants
  #   @return [Array(Telnyx::Models::MobilePushCredentialCreateParams::CreateMobilePushCredentialRequest::Ios, Telnyx::Models::MobilePushCredentialCreateParams::CreateMobilePushCredentialRequest::Android)]
end