diff --git a/codegenerator/openapi/cinder_schemas/attachment.py b/codegenerator/openapi/cinder_schemas/attachment.py index d4030ab..775c862 100644 --- a/codegenerator/openapi/cinder_schemas/attachment.py +++ b/codegenerator/openapi/cinder_schemas/attachment.py @@ -76,6 +76,7 @@ ATTACHMENT_DETAIL_SCHEMA: dict[str, Any] = { }, **ATTACHMENT_SCHEMA["properties"], }, + "required": ["id", "instance", "name", "status", "volume_id"], } ATTACHMENT_CONTAINER_SCHEMA: dict[str, Any] = { diff --git a/codegenerator/openapi/cinder_schemas/backup.py b/codegenerator/openapi/cinder_schemas/backup.py index e5cf470..8bc4e8b 100644 --- a/codegenerator/openapi/cinder_schemas/backup.py +++ b/codegenerator/openapi/cinder_schemas/backup.py @@ -87,6 +87,7 @@ BACKUP_SHORT_SCHEMA: dict[str, Any] = { "description": "The UUID of the backup.", }, }, + "required": ["id", "name"], } BACKUP_SCHEMA: dict[str, Any] = { @@ -170,6 +171,7 @@ BACKUP_SCHEMA: dict[str, Any] = { "description": "The UUID of the volume.", }, }, + "required": ["id", "name", "size", "status", "volume_id"], } BACKUPS_SCHEMA: dict[str, Any] = { diff --git a/codegenerator/openapi/cinder_schemas/group.py b/codegenerator/openapi/cinder_schemas/group.py index 6e74e56..9827aa1 100644 --- a/codegenerator/openapi/cinder_schemas/group.py +++ b/codegenerator/openapi/cinder_schemas/group.py @@ -136,6 +136,7 @@ GROUP_DETAIL_SCHEMA: dict[str, Any] = { }, **GROUP_SCHEMA["properties"], }, + "required": ["id", "name"], } GROUPS_SCHEMA: dict[str, Any] = { diff --git a/codegenerator/openapi/cinder_schemas/group_snapshot.py b/codegenerator/openapi/cinder_schemas/group_snapshot.py index 5c17cd9..d1748f7 100644 --- a/codegenerator/openapi/cinder_schemas/group_snapshot.py +++ b/codegenerator/openapi/cinder_schemas/group_snapshot.py @@ -117,6 +117,7 @@ GROUP_SNAPSHOT_DETAIL_SCHEMA: dict[str, Any] = { }, **GROUP_SNAPSHOT_SCHEMA["properties"], }, + "required": ["id", "name", "status"], } GROUP_SNAPSHOTS_SCHEMA: dict[str, Any] = { diff --git a/codegenerator/openapi/cinder_schemas/group_type.py b/codegenerator/openapi/cinder_schemas/group_type.py index d5abfa0..ad93b2f 100644 --- a/codegenerator/openapi/cinder_schemas/group_type.py +++ b/codegenerator/openapi/cinder_schemas/group_type.py @@ -95,6 +95,7 @@ GROUP_TYPE_SCHEMA: dict[str, Any] = { }, "group_specs": GROUP_SPEC_SCHEMA, }, + "required": ["id", "name"], } GROUP_TYPES_SCHEMA: dict[str, Any] = { diff --git a/codegenerator/openapi/cinder_schemas/snapshot.py b/codegenerator/openapi/cinder_schemas/snapshot.py index bdcebec..f7dcfb0 100644 --- a/codegenerator/openapi/cinder_schemas/snapshot.py +++ b/codegenerator/openapi/cinder_schemas/snapshot.py @@ -117,6 +117,7 @@ SNAPSHOT_DETAIL_SCHEMA: dict[str, Any] = { }, **SNAPSHOT_SCHEMA["properties"], }, + "required": ["created_at", "id", "name", "size", "status", "updated_at"], } SNAPSHOT_CONTAINER_SCHEMA: dict[str, Any] = { diff --git a/codegenerator/openapi/cinder_schemas/volume.py b/codegenerator/openapi/cinder_schemas/volume.py index d0a9f6e..b23daea 100644 --- a/codegenerator/openapi/cinder_schemas/volume.py +++ b/codegenerator/openapi/cinder_schemas/volume.py @@ -65,6 +65,7 @@ VOLUME_SHORT_SCHEMA: dict[str, Any] = { "description": "The UUID of the volume.", }, }, + "required": ["id", "name"], } VOLUME_SCHEMA: dict[str, Any] = { @@ -108,6 +109,10 @@ VOLUME_SCHEMA: dict[str, Any] = { "type": "string", "description": "The name of the availability zone.", }, + "bootable": { + "type": "boolean", + "description": "Enables or disables the bootable attribute. You can boot an instance from a bootable volume.", + }, "multiattach": { "type": "boolean", "description": "If true, this volume can attach to more than one instance.", @@ -193,6 +198,18 @@ VOLUME_SCHEMA: dict[str, Any] = { "x-openstack": {"min-ver": "3.65"}, }, }, + "required": [ + "attachments", + "bootable", + "encrypted", + "id", + "migration_status", + "name", + "replication_status", + "size", + "status", + "user_id", + ], "additionalProperties": True, } diff --git a/codegenerator/openapi/cinder_schemas/volume_type.py b/codegenerator/openapi/cinder_schemas/volume_type.py index f91609f..df9aa29 100644 --- a/codegenerator/openapi/cinder_schemas/volume_type.py +++ b/codegenerator/openapi/cinder_schemas/volume_type.py @@ -51,6 +51,7 @@ VOLUME_TYPE_SCHEMA: dict[str, Any] = { "description": "The QoS specifications ID.", }, }, + "required": ["id", "name"], } VOLUME_TYPE_CONTAINER_SCHEMA: dict[str, Any] = { diff --git a/codegenerator/templates/rust_tui/impl.rs.j2 b/codegenerator/templates/rust_tui/impl.rs.j2 index 1bdac31..6f17923 100644 --- a/codegenerator/templates/rust_tui/impl.rs.j2 +++ b/codegenerator/templates/rust_tui/impl.rs.j2 @@ -227,13 +227,13 @@ impl ConfirmableRequest for {{ class_name }} { /// {{ response_class_name }} response representation #[derive(Deserialize, Serialize)] #[derive(Clone, StructTable)] -struct {{ response_class_name }} { +pub struct {{ response_class_name }} { {%- for k, v in data_type.fields | dictsort %} {% if not (operation_type == "list" and k in ["links"]) %} {{ macros.docstring(v.description, indent=4) }} {{ v.serde_macros }} {{ v.get_structable_macros(data_type, sdk_service_name, resource_name, operation_type) }} - {{ v.local_name }}: {{ v.type_hint }}, + pub {{ v.local_name }}: {{ v.type_hint }}, {%- endif %} {%- endfor %}