pub struct VpcPeeringCreateRequest {
pub provider: Option<String>,
pub command_type: Option<String>,
pub aws_region: Option<String>,
pub aws_account_id: Option<String>,
pub vpc_id: Option<String>,
pub vpc_cidr: Option<String>,
pub vpc_cidrs: Option<Vec<String>>,
pub gcp_project_id: Option<String>,
pub network_name: Option<String>,
}Expand description
VPC peering creation request.
The Redis Cloud API documents this as a oneOf between an AWS-shaped
body (requiring region, awsAccountId, vpcId) and a GCP-shaped body
(requiring vpcProjectUid, vpcNetworkName). This struct keeps both
providers in one type for caller flexibility, but uses
#[serde(rename = ...)] so the AWS and GCP fields serialize to the
exact wire names the spec requires. Use Self::for_aws or
Self::for_gcp to construct provider-targeted bodies that avoid
mixing fields.
A type-safe enum split that prevents AWS+GCP field mixing at compile time is tracked as a follow-on under #65.
Fields§
§provider: Option<String>Cloud provider discriminator (e.g. “AWS”, “GCP”).
command_type: Option<String>Read-only on the response; populated by the server.
aws_region: Option<String>AWS region. Wire name: region (spec required for AWS).
aws_account_id: Option<String>AWS account ID (spec required for AWS).
vpc_id: Option<String>AWS VPC ID (spec required for AWS).
vpc_cidr: Option<String>VPC CIDR. AWS only; optional.
vpc_cidrs: Option<Vec<String>>List of VPC CIDRs. AWS only; optional.
gcp_project_id: Option<String>GCP project UID. Wire name: vpcProjectUid (spec required for GCP).
network_name: Option<String>GCP network name. Wire name: vpcNetworkName (spec required for GCP).
Implementations§
Source§impl VpcPeeringCreateRequest
impl VpcPeeringCreateRequest
Sourcepub fn for_aws(
region: impl Into<String>,
aws_account_id: impl Into<String>,
vpc_id: impl Into<String>,
) -> Self
pub fn for_aws( region: impl Into<String>, aws_account_id: impl Into<String>, vpc_id: impl Into<String>, ) -> Self
Construct an AWS-targeted VPC peering creation body.
Pre-populates provider = "AWS" and the three required AWS fields
(region, awsAccountId, vpcId). Optional CIDR fields can be set
directly on the returned struct.
Trait Implementations§
Source§impl Clone for VpcPeeringCreateRequest
impl Clone for VpcPeeringCreateRequest
Source§fn clone(&self) -> VpcPeeringCreateRequest
fn clone(&self) -> VpcPeeringCreateRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more