Skip to content

Commit c741f6f

Browse files
committed
Generate Class#openapi_nullable methods
1 parent e6f0167 commit c741f6f

20 files changed

+220
-5
lines changed

lib/patch_ruby/models/allocation.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414

1515
module Patch
1616
class Allocation
17+
# A unique uid for the record. UIDs will be prepended by all_prod or all_test depending on the mode it was created in.
1718
attr_accessor :id
1819

20+
# A boolean indicating if this project is a production or test mode project.
1921
attr_accessor :production
2022

23+
# The amount (in grams) of allocated carbon offsets.
2124
attr_accessor :mass_g
2225

2326
# Attribute mapping from ruby-style variable name to JSON key.
@@ -38,6 +41,13 @@ def self.openapi_types
3841
}
3942
end
4043

44+
# Set with nullable attributes.
45+
def self.openapi_nullable
46+
nullable_properties = Set.new
47+
48+
nullable_properties
49+
end
50+
4151
# Allows models with corresponding API classes to delegate API operations to those API classes
4252
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
4353
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/create_mass_estimate_request.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ def self.openapi_types
3434
}
3535
end
3636

37+
# Set with nullable attributes.
38+
def self.openapi_nullable
39+
nullable_properties = Set.new
40+
41+
nullable_properties
42+
end
43+
3744
# Allows models with corresponding API classes to delegate API operations to those API classes
3845
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
3946
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/create_order_request.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ def self.openapi_types
4242
}
4343
end
4444

45+
# Set with nullable attributes.
46+
def self.openapi_nullable
47+
nullable_properties = Set.new
48+
49+
nullable_properties
50+
end
51+
4552
# Allows models with corresponding API classes to delegate API operations to those API classes
4653
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
4754
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/create_preference_request.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ def self.openapi_types
3030
}
3131
end
3232

33+
# Set with nullable attributes.
34+
def self.openapi_nullable
35+
nullable_properties = Set.new
36+
37+
nullable_properties
38+
end
39+
3340
# Allows models with corresponding API classes to delegate API operations to those API classes
3441
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
3542
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/error_response.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ def self.openapi_types
3838
}
3939
end
4040

41+
# Set with nullable attributes.
42+
def self.openapi_nullable
43+
nullable_properties = Set.new
44+
45+
nullable_properties.add("data")
46+
47+
nullable_properties
48+
end
49+
4150
# Allows models with corresponding API classes to delegate API operations to those API classes
4251
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
4352
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/estimate.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414

1515
module Patch
1616
class Estimate
17+
# A unique uid for the record. UIDs will be prepended by est_prod or est_test depending on the mode it was created in.
1718
attr_accessor :id
1819

20+
# A boolean indicating if this estimate is a production or test mode estimate.
1921
attr_accessor :production
2022

23+
# The type of estimate. Currently mass is the only supported value.
2124
attr_accessor :type
2225

26+
# An object returning the order associated with this estimate. See the [Order section](/?id=orders) for the full schema.
2327
attr_accessor :order
2428

2529
# Attribute mapping from ruby-style variable name to JSON key.
@@ -38,10 +42,19 @@ def self.openapi_types
3842
:'id' => :'String',
3943
:'production' => :'Boolean',
4044
:'type' => :'String',
41-
:'order' => :'Order'
45+
:'order' => :'AnyOforder'
4246
}
4347
end
4448

49+
# Set with nullable attributes.
50+
def self.openapi_nullable
51+
nullable_properties = Set.new
52+
53+
nullable_properties.add("order")
54+
55+
nullable_properties
56+
end
57+
4558
# Allows models with corresponding API classes to delegate API operations to those API classes
4659
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
4760
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/estimate_list_response.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ def self.openapi_types
4242
}
4343
end
4444

45+
# Set with nullable attributes.
46+
def self.openapi_nullable
47+
nullable_properties = Set.new
48+
49+
nullable_properties.add("error")
50+
51+
nullable_properties
52+
end
53+
4554
# Allows models with corresponding API classes to delegate API operations to those API classes
4655
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
4756
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/estimate_response.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ def self.openapi_types
3838
}
3939
end
4040

41+
# Set with nullable attributes.
42+
def self.openapi_nullable
43+
nullable_properties = Set.new
44+
45+
nullable_properties.add("error")
46+
47+
nullable_properties
48+
end
49+
4150
# Allows models with corresponding API classes to delegate API operations to those API classes
4251
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
4352
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/meta_index_object.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ def self.openapi_types
3434
}
3535
end
3636

37+
# Set with nullable attributes.
38+
def self.openapi_nullable
39+
nullable_properties = Set.new
40+
41+
nullable_properties.add("prev_page")
42+
43+
nullable_properties.add("next_page")
44+
45+
nullable_properties
46+
end
47+
3748
# Allows models with corresponding API classes to delegate API operations to those API classes
3849
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
3950
# Eg. Order.create_order delegates to OrdersApi.new.create_order

lib/patch_ruby/models/order.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,31 @@
1414

1515
module Patch
1616
class Order
17+
# A unique uid for the record. UIDs will be prepended by ord_prod or ord_test depending on the mode it was created in.
1718
attr_accessor :id
1819

20+
# The amount of carbon offsets in grams purchased through this order.
1921
attr_accessor :mass_g
2022

23+
# A boolean indicating if this order is a production or test mode order.
2124
attr_accessor :production
2225

26+
# The current state of the order.
2327
attr_accessor :state
2428

29+
# The current state of the allocated carbon offsets of the order.
2530
attr_accessor :allocation_state
2631

32+
# The total price in cents USD of the carbon offsets purchased through this order.
2733
attr_accessor :price_cents_usd
2834

35+
# The Patch Fee in cents USD for this order.
2936
attr_accessor :patch_fee_cents_usd
3037

38+
# An array containing the inventory allocations for this order.
3139
attr_accessor :allocations
3240

41+
# An optional JSON object containing metadata for this order.
3342
attr_accessor :metadata
3443

3544
class EnumAttributeValidator
@@ -84,6 +93,17 @@ def self.openapi_types
8493
}
8594
end
8695

96+
# Set with nullable attributes.
97+
def self.openapi_nullable
98+
nullable_properties = Set.new
99+
100+
nullable_properties.add("price_cents_usd")
101+
102+
nullable_properties.add("patch_fee_cents_usd")
103+
104+
nullable_properties
105+
end
106+
87107
# Allows models with corresponding API classes to delegate API operations to those API classes
88108
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
89109
# Eg. Order.create_order delegates to OrdersApi.new.create_order

0 commit comments

Comments
 (0)