Module: XTwitterScraper::Models::ComposeCreateParams::Body

Extended by:
Internal::Type::Union
Defined in:
lib/x_twitter_scraper/models/compose_create_params.rb,
sig/x_twitter_scraper/models/compose_create_params.rbs

Defined Under Namespace

Classes: ComposePrepareRequest, ComposeRefineRequest, ComposeScoreRequest

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, 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(body:, request_options: {}) ⇒ Object



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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/x_twitter_scraper/models/compose_create_params.rb', line 23

module Body
  extend XTwitterScraper::Internal::Type::Union

  variant -> { XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest }

  variant -> { XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest }

  variant -> { XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest }

  class ComposePrepareRequest < XTwitterScraper::Internal::Type::BaseModel
    # @!attribute step
    #
    #   @return [Symbol, :compose]
    required :step, const: :compose

    # @!attribute topic
    #   Subject for the post.
    #
    #   @return [String]
    required :topic, String

    # @!attribute goal
    #   Editorial goal used to order the rules and questions.
    #
    #   @return [Symbol, XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::Goal, nil]
    optional :goal, enum: -> { XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal }

    # @!attribute style_username
    #   Username from a style analysis saved to this account.
    #
    #   @return [String, nil]
    optional :style_username, String, api_name: :styleUsername

    # @!method initialize(topic:, goal: nil, style_username: nil, step: :compose)
    #   @param topic [String] Subject for the post.
    #
    #   @param goal [Symbol, XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::Goal] Editorial goal used to order the rules and questions.
    #
    #   @param style_username [String] Username from a style analysis saved to this account.
    #
    #   @param step [Symbol, :compose]

    # Editorial goal used to order the rules and questions.
    #
    # @see XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest#goal
    module Goal
      extend XTwitterScraper::Internal::Type::Enum

      ENGAGEMENT = :engagement
      FOLLOWERS = :followers
      AUTHORITY = :authority
      CONVERSATION = :conversation

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

  class ComposeRefineRequest < XTwitterScraper::Internal::Type::BaseModel
    # @!attribute goal
    #   Editorial goal for the guidance.
    #
    #   @return [Symbol, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::Goal]
    required :goal, enum: -> { XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal }

    # @!attribute step
    #
    #   @return [Symbol, :refine]
    required :step, const: :refine

    # @!attribute tone
    #   Requested writing tone.
    #
    #   @return [String]
    required :tone, String

    # @!attribute topic
    #   Subject for the post.
    #
    #   @return [String]
    required :topic, String

    # @!attribute additional_context
    #   Audience, constraints, sources, or other writing context.
    #
    #   @return [String, nil]
    optional :additional_context, String, api_name: :additionalContext

    # @!attribute call_to_action
    #   Specific action the draft should request.
    #
    #   @return [String, nil]
    optional :call_to_action, String, api_name: :callToAction

    # @!attribute media_type
    #   Planned media type.
    #
    #   @return [Symbol, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::MediaType, nil]
    optional :media_type,
             enum: -> { XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType },
             api_name: :mediaType

    # @!method initialize(goal:, tone:, topic:, additional_context: nil, call_to_action: nil, media_type: nil, step: :refine)
    #   @param goal [Symbol, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::Goal] Editorial goal for the guidance.
    #
    #   @param tone [String] Requested writing tone.
    #
    #   @param topic [String] Subject for the post.
    #
    #   @param additional_context [String] Audience, constraints, sources, or other writing context.
    #
    #   @param call_to_action [String] Specific action the draft should request.
    #
    #   @param media_type [Symbol, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::MediaType] Planned media type.
    #
    #   @param step [Symbol, :refine]

    # Editorial goal for the guidance.
    #
    # @see XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest#goal
    module Goal
      extend XTwitterScraper::Internal::Type::Enum

      ENGAGEMENT = :engagement
      FOLLOWERS = :followers
      AUTHORITY = :authority
      CONVERSATION = :conversation

      # @!method self.values
      #   @return [Array<Symbol>]
    end

    # Planned media type.
    #
    # @see XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest#media_type
    module MediaType
      extend XTwitterScraper::Internal::Type::Enum

      PHOTO = :photo
      VIDEO = :video
      NONE = :none

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

  class ComposeScoreRequest < XTwitterScraper::Internal::Type::BaseModel
    # @!attribute draft
    #   Full post text for deterministic editorial checks.
    #
    #   @return [String]
    required :draft, String

    # @!attribute step
    #
    #   @return [Symbol, :score]
    required :step, const: :score

    # @!attribute has_link
    #   True when a separate link card is attached.
    #
    #   @return [Boolean, nil]
    optional :has_link, XTwitterScraper::Internal::Type::Boolean, api_name: :hasLink

    # @!attribute has_media
    #   @deprecated Ignored. Remove this field. Use hasLink for a separate link card.
    #
    #   Accepted for backward compatibility. Text checks ignore this field.
    #
    #   @return [Boolean, nil]
    optional :has_media, XTwitterScraper::Internal::Type::Boolean, api_name: :hasMedia

    # @!method initialize(draft:, has_link: nil, has_media: nil, step: :score)
    #   Some parameter documentations has been truncated, see
    #   {XTwitterScraper::Models::ComposeCreateParams::Body::ComposeScoreRequest} for
    #   more details.
    #
    #   @param draft [String] Full post text for deterministic editorial checks.
    #
    #   @param has_link [Boolean] True when a separate link card is attached.
    #
    #   @param has_media [Boolean] Accepted for backward compatibility. Text checks ignore this field.
    #
    #   @param step [Symbol, :score]
  end

  # @!method self.variants
  #   @return [Array(XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeScoreRequest)]
end

#self?.variants::Array[XTwitterScraper::Models::ComposeCreateParams::body]

Returns:

  • (::Array[XTwitterScraper::Models::ComposeCreateParams::body])


197
# File 'sig/x_twitter_scraper/models/compose_create_params.rbs', line 197

def self?.variants: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::body]