Skip to content

Commit

Permalink
update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Jun 26, 2024
1 parent 7dac40e commit 0da60de
Show file tree
Hide file tree
Showing 80 changed files with 646 additions and 609 deletions.
8 changes: 4 additions & 4 deletions samples/client/others/rust/hyper/oneOf/docs/Bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**bar_prop_a** | Option<**String**> | | [optional]
**foo_prop_b** | Option<**String**> | | [optional]
**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | **String** | |
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**bar_prop_a** | Option<**String**> | | [optional]
**foo_prop_b** | Option<**String**> | | [optional]
**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
6 changes: 3 additions & 3 deletions samples/client/others/rust/hyper/oneOf/docs/BarCreate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar_prop_a** | Option<**String**> | | [optional]
**foo_prop_b** | Option<**String**> | | [optional]
**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | Option<**String**> | unique identifier | [optional]
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**bar_prop_a** | Option<**String**> | | [optional]
**foo_prop_b** | Option<**String**> | | [optional]
**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/others/rust/hyper/oneOf/docs/BarRef.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | Option<**String**> | Name of the related entity. | [optional]
**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | Option<**String**> | unique identifier | [optional]
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**name** | Option<**String**> | Name of the related entity. | [optional]
**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/others/rust/hyper/oneOf/docs/Foo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo_prop_a** | Option<**String**> | | [optional]
**foo_prop_b** | Option<**String**> | | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | Option<**String**> | unique identifier | [optional]
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**foo_prop_a** | Option<**String**> | | [optional]
**foo_prop_b** | Option<**String**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
6 changes: 3 additions & 3 deletions samples/client/others/rust/hyper/oneOf/docs/FooRef.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**fooref_prop_a** | Option<**String**> | | [optional]
**name** | Option<**String**> | Name of the related entity. | [optional]
**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | Option<**String**> | unique identifier | [optional]
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**name** | Option<**String**> | Name of the related entity. | [optional]
**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional]
**fooref_prop_a** | Option<**String**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/others/rust/hyper/oneOf/docs/Pasta.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**vendor** | Option<**String**> | | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | Option<**String**> | unique identifier | [optional]
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**vendor** | Option<**String**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/others/rust/hyper/oneOf/docs/Pizza.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pizza_size** | Option<**f64**> | | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | Option<**String**> | unique identifier | [optional]
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**pizza_size** | Option<**f64**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
4 changes: 2 additions & 2 deletions samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**toppings** | Option<**String**> | | [optional]
**pizza_size** | Option<**f64**> | | [optional]
**href** | Option<**String**> | Hyperlink reference | [optional]
**id** | Option<**String**> | unique identifier | [optional]
**at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
**at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional]
**at_type** | **String** | When sub-classing, this defines the sub-class Extensible name |
**pizza_size** | Option<**f64**> | | [optional]
**toppings** | Option<**String**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
24 changes: 12 additions & 12 deletions samples/client/others/rust/hyper/oneOf/src/models/bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,11 @@ use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Bar {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")]
pub bar_prop_a: Option<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
#[serde(rename = "id")]
pub id: String,
/// A URI to a JSON-Schema file that defines additional attributes and relationships
#[serde(rename = "@schemaLocation", skip_serializing_if = "Option::is_none")]
pub at_schema_location: Option<String>,
Expand All @@ -33,19 +27,25 @@ pub struct Bar {
/// When sub-classing, this defines the sub-class Extensible name
#[serde(rename = "@type")]
pub at_type: String,
#[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")]
pub bar_prop_a: Option<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
}

impl Bar {
pub fn new(id: String, at_type: String) -> Bar {
Bar {
id,
bar_prop_a: None,
foo_prop_b: None,
foo: None,
href: None,
id,
at_schema_location: None,
at_base_type: None,
at_type,
bar_prop_a: None,
foo_prop_b: None,
foo: None,
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BarCreate {
#[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")]
pub bar_prop_a: Option<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
Expand All @@ -34,19 +28,25 @@ pub struct BarCreate {
/// When sub-classing, this defines the sub-class Extensible name
#[serde(rename = "@type")]
pub at_type: String,
#[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")]
pub bar_prop_a: Option<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
}

impl BarCreate {
pub fn new(at_type: String) -> BarCreate {
BarCreate {
bar_prop_a: None,
foo_prop_b: None,
foo: None,
href: None,
id: None,
at_schema_location: None,
at_base_type: None,
at_type,
bar_prop_a: None,
foo_prop_b: None,
foo: None,
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BarRef {
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
pub at_referred_type: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
Expand All @@ -34,18 +28,24 @@ pub struct BarRef {
/// When sub-classing, this defines the sub-class Extensible name
#[serde(rename = "@type")]
pub at_type: String,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
pub at_referred_type: Option<String>,
}

impl BarRef {
pub fn new(at_type: String) -> BarRef {
BarRef {
name: None,
at_referred_type: None,
href: None,
id: None,
at_schema_location: None,
at_base_type: None,
at_type,
name: None,
at_referred_type: None,
}
}
}
Expand Down
23 changes: 11 additions & 12 deletions samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@
use crate::models;
use serde::{Deserialize, Serialize};

/// EntityRef : Entity reference schema to be use for all entityRef class.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "@type")]
pub enum EntityRef {
#[serde(rename="BarRef")]
BarRef {
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
href: Option<String>,
Expand All @@ -35,15 +28,15 @@ pub enum EntityRef {
/// When sub-classing, this defines the super-class
#[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")]
at_base_type: Option<String>,
},
#[serde(rename="FooRef")]
FooRef {
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
},
#[serde(rename="FooRef")]
FooRef {
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
href: Option<String>,
Expand All @@ -56,18 +49,24 @@ pub enum EntityRef {
/// When sub-classing, this defines the super-class
#[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")]
at_base_type: Option<String>,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
},
}

impl Default for EntityRef {
fn default() -> Self {
Self::BarRef {
name: Default::default(),
at_referred_type: Default::default(),
href: Default::default(),
id: Default::default(),
at_schema_location: Default::default(),
at_base_type: Default::default(),
name: Default::default(),
at_referred_type: Default::default(),
}

}
Expand Down
12 changes: 6 additions & 6 deletions samples/client/others/rust/hyper/oneOf/src/models/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Foo {
#[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")]
pub foo_prop_a: Option<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
Expand All @@ -32,18 +28,22 @@ pub struct Foo {
/// When sub-classing, this defines the sub-class Extensible name
#[serde(rename = "@type")]
pub at_type: String,
#[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")]
pub foo_prop_a: Option<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
}

impl Foo {
pub fn new(at_type: String) -> Foo {
Foo {
foo_prop_a: None,
foo_prop_b: None,
href: None,
id: None,
at_schema_location: None,
at_base_type: None,
at_type,
foo_prop_a: None,
foo_prop_b: None,
}
}
}
Expand Down
Loading

0 comments on commit 0da60de

Please sign in to comment.