legnext-ruby-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +129 -0
  4. data/lib/openapi_client/api/account_management_api.rb +82 -0
  5. data/lib/openapi_client/api/image_api.rb +821 -0
  6. data/lib/openapi_client/api/video_api.rb +289 -0
  7. data/lib/openapi_client/api_client.rb +396 -0
  8. data/lib/openapi_client/api_error.rb +58 -0
  9. data/lib/openapi_client/api_model_base.rb +88 -0
  10. data/lib/openapi_client/configuration.rb +301 -0
  11. data/lib/openapi_client/models/api_v1_diffusion_post200_response.rb +205 -0
  12. data/lib/openapi_client/models/api_v1_diffusion_post200_response_config.rb +156 -0
  13. data/lib/openapi_client/models/api_v1_diffusion_post200_response_config_webhook_config.rb +156 -0
  14. data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta.rb +156 -0
  15. data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta_usage.rb +165 -0
  16. data/lib/openapi_client/models/api_v1_diffusion_post200_response_output.rb +168 -0
  17. data/lib/openapi_client/models/api_v1_edit_post200_response.rb +205 -0
  18. data/lib/openapi_client/models/api_v1_job_job_id_get200_response.rb +246 -0
  19. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_error.rb +175 -0
  20. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_meta.rb +174 -0
  21. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output.rb +177 -0
  22. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output_available_actions.rb +224 -0
  23. data/lib/openapi_client/models/api_v1_pan_post200_response.rb +205 -0
  24. data/lib/openapi_client/models/balance_response.rb +167 -0
  25. data/lib/openapi_client/models/balance_response_data.rb +208 -0
  26. data/lib/openapi_client/models/task_response.rb +206 -0
  27. data/lib/openapi_client/version.rb +15 -0
  28. data/lib/openapi_client.rb +59 -0
  29. metadata +115 -0
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Midjourney api-unofficial by Legnext.ai
3
+
4
+ ## **Legnext.ai Midjourney API: The Ultimate AI Image Generation Toolkit** Unlock the full creative potential of Midjourney directly within your applications and development workflows using the **Legnext.ai Midjourney API (Unofficial)**. This comprehensive collection offers a ready-to-integrate solution for professional image and video creation, manipulation, and high-fidelity upscaling. We provide developers with **stable, high-performance API access** to the Midjourney model. Crucially, integrating our service requires **no Midjourney account**, eliminating the hassle of managing official subscriptions or Discord interactions. Our toolkit simplifies the entire text-to-image process, supporting complex prompts, aspect ratio adjustments, and advanced style parameters. Focus on innovation while we handle the AI infrastructure. Start building scalable, visually stunning applications today with reliable access to the world’s leading generative AI model.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OpenapiClient
17
+ # Standard async task response for image/video generation operations
18
+ class TaskResponse < ApiModelBase
19
+ # Unique identifier for the created job
20
+ attr_accessor :job_id
21
+
22
+ # AI model used
23
+ attr_accessor :model
24
+
25
+ # Type of task
26
+ attr_accessor :task_type
27
+
28
+ # Initial status (typically 'pending')
29
+ attr_accessor :status
30
+
31
+ attr_accessor :config
32
+
33
+ attr_accessor :output
34
+
35
+ attr_accessor :meta
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'job_id' => :'job_id',
41
+ :'model' => :'model',
42
+ :'task_type' => :'task_type',
43
+ :'status' => :'status',
44
+ :'config' => :'config',
45
+ :'output' => :'output',
46
+ :'meta' => :'meta'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'job_id' => :'String',
64
+ :'model' => :'String',
65
+ :'task_type' => :'String',
66
+ :'status' => :'String',
67
+ :'config' => :'ApiV1DiffusionPost200ResponseConfig',
68
+ :'output' => :'ApiV1DiffusionPost200ResponseOutput',
69
+ :'meta' => :'ApiV1DiffusionPost200ResponseMeta'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TaskResponse` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TaskResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'job_id')
96
+ self.job_id = attributes[:'job_id']
97
+ end
98
+
99
+ if attributes.key?(:'model')
100
+ self.model = attributes[:'model']
101
+ end
102
+
103
+ if attributes.key?(:'task_type')
104
+ self.task_type = attributes[:'task_type']
105
+ end
106
+
107
+ if attributes.key?(:'status')
108
+ self.status = attributes[:'status']
109
+ end
110
+
111
+ if attributes.key?(:'config')
112
+ self.config = attributes[:'config']
113
+ end
114
+
115
+ if attributes.key?(:'output')
116
+ self.output = attributes[:'output']
117
+ end
118
+
119
+ if attributes.key?(:'meta')
120
+ self.meta = attributes[:'meta']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ job_id == o.job_id &&
145
+ model == o.model &&
146
+ task_type == o.task_type &&
147
+ status == o.status &&
148
+ config == o.config &&
149
+ output == o.output &&
150
+ meta == o.meta
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [job_id, model, task_type, status, config, output, meta].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ end
205
+
206
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #Midjourney api-unofficial by Legnext.ai
3
+
4
+ ## **Legnext.ai Midjourney API: The Ultimate AI Image Generation Toolkit** Unlock the full creative potential of Midjourney directly within your applications and development workflows using the **Legnext.ai Midjourney API (Unofficial)**. This comprehensive collection offers a ready-to-integrate solution for professional image and video creation, manipulation, and high-fidelity upscaling. We provide developers with **stable, high-performance API access** to the Midjourney model. Crucially, integrating our service requires **no Midjourney account**, eliminating the hassle of managing official subscriptions or Discord interactions. Our toolkit simplifies the entire text-to-image process, supporting complex prompts, aspect ratio adjustments, and advanced style parameters. Focus on innovation while we handle the AI infrastructure. Start building scalable, visually stunning applications today with reliable access to the world’s leading generative AI model.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0
10
+
11
+ =end
12
+
13
+ module OpenapiClient
14
+ VERSION = '1.0.0'
15
+ end
@@ -0,0 +1,59 @@
1
+ =begin
2
+ #Midjourney api-unofficial by Legnext.ai
3
+
4
+ ## **Legnext.ai Midjourney API: The Ultimate AI Image Generation Toolkit** Unlock the full creative potential of Midjourney directly within your applications and development workflows using the **Legnext.ai Midjourney API (Unofficial)**. This comprehensive collection offers a ready-to-integrate solution for professional image and video creation, manipulation, and high-fidelity upscaling. We provide developers with **stable, high-performance API access** to the Midjourney model. Crucially, integrating our service requires **no Midjourney account**, eliminating the hassle of managing official subscriptions or Discord interactions. Our toolkit simplifies the entire text-to-image process, supporting complex prompts, aspect ratio adjustments, and advanced style parameters. Focus on innovation while we handle the AI infrastructure. Start building scalable, visually stunning applications today with reliable access to the world’s leading generative AI model.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'openapi_client/api_client'
15
+ require 'openapi_client/api_error'
16
+ require 'openapi_client/api_model_base'
17
+ require 'openapi_client/version'
18
+ require 'openapi_client/configuration'
19
+
20
+ # Models
21
+ require 'openapi_client/models/api_v1_diffusion_post200_response'
22
+ require 'openapi_client/models/api_v1_diffusion_post200_response_config'
23
+ require 'openapi_client/models/api_v1_diffusion_post200_response_config_webhook_config'
24
+ require 'openapi_client/models/api_v1_diffusion_post200_response_meta'
25
+ require 'openapi_client/models/api_v1_diffusion_post200_response_meta_usage'
26
+ require 'openapi_client/models/api_v1_diffusion_post200_response_output'
27
+ require 'openapi_client/models/api_v1_edit_post200_response'
28
+ require 'openapi_client/models/api_v1_job_job_id_get200_response'
29
+ require 'openapi_client/models/api_v1_job_job_id_get200_response_error'
30
+ require 'openapi_client/models/api_v1_job_job_id_get200_response_meta'
31
+ require 'openapi_client/models/api_v1_job_job_id_get200_response_output'
32
+ require 'openapi_client/models/api_v1_job_job_id_get200_response_output_available_actions'
33
+ require 'openapi_client/models/api_v1_pan_post200_response'
34
+ require 'openapi_client/models/balance_response'
35
+ require 'openapi_client/models/balance_response_data'
36
+ require 'openapi_client/models/task_response'
37
+
38
+ # APIs
39
+ require 'openapi_client/api/account_management_api'
40
+ require 'openapi_client/api/image_api'
41
+ require 'openapi_client/api/video_api'
42
+
43
+ module OpenapiClient
44
+ class << self
45
+ # Customize default settings for the SDK using block.
46
+ # OpenapiClient.configure do |config|
47
+ # config.username = "xxx"
48
+ # config.password = "xxx"
49
+ # end
50
+ # If no block given, return the default Configuration object.
51
+ def configure
52
+ if block_given?
53
+ yield(Configuration.default)
54
+ else
55
+ Configuration.default
56
+ end
57
+ end
58
+ end
59
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: legnext-ruby-sdk
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Legnext AI
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-01-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: typhoeus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: rspec
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.6'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.6.0
43
+ type: :development
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '3.6'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.6.0
53
+ description: Official Ruby client for the Legnext.ai Midjourney API. Generate images,
54
+ videos, and more with AI.
55
+ email:
56
+ - support@legnext.ai
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - LICENSE
62
+ - README.md
63
+ - lib/openapi_client.rb
64
+ - lib/openapi_client/api/account_management_api.rb
65
+ - lib/openapi_client/api/image_api.rb
66
+ - lib/openapi_client/api/video_api.rb
67
+ - lib/openapi_client/api_client.rb
68
+ - lib/openapi_client/api_error.rb
69
+ - lib/openapi_client/api_model_base.rb
70
+ - lib/openapi_client/configuration.rb
71
+ - lib/openapi_client/models/api_v1_diffusion_post200_response.rb
72
+ - lib/openapi_client/models/api_v1_diffusion_post200_response_config.rb
73
+ - lib/openapi_client/models/api_v1_diffusion_post200_response_config_webhook_config.rb
74
+ - lib/openapi_client/models/api_v1_diffusion_post200_response_meta.rb
75
+ - lib/openapi_client/models/api_v1_diffusion_post200_response_meta_usage.rb
76
+ - lib/openapi_client/models/api_v1_diffusion_post200_response_output.rb
77
+ - lib/openapi_client/models/api_v1_edit_post200_response.rb
78
+ - lib/openapi_client/models/api_v1_job_job_id_get200_response.rb
79
+ - lib/openapi_client/models/api_v1_job_job_id_get200_response_error.rb
80
+ - lib/openapi_client/models/api_v1_job_job_id_get200_response_meta.rb
81
+ - lib/openapi_client/models/api_v1_job_job_id_get200_response_output.rb
82
+ - lib/openapi_client/models/api_v1_job_job_id_get200_response_output_available_actions.rb
83
+ - lib/openapi_client/models/api_v1_pan_post200_response.rb
84
+ - lib/openapi_client/models/balance_response.rb
85
+ - lib/openapi_client/models/balance_response_data.rb
86
+ - lib/openapi_client/models/task_response.rb
87
+ - lib/openapi_client/version.rb
88
+ homepage: https://github.com/legnext-ai/sdks
89
+ licenses:
90
+ - MIT
91
+ metadata:
92
+ homepage_uri: https://legnext.ai
93
+ bug_tracker_uri: https://github.com/legnext-ai/sdks/issues
94
+ documentation_uri: https://github.com/legnext-ai/sdks/tree/master/sdks/ruby
95
+ source_code_uri: https://github.com/legnext-ai/sdks/tree/master/sdks/ruby
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '2.7'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubygems_version: 3.4.20
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: Legnext.ai Midjourney API Ruby SDK
115
+ test_files: []