diff --git a/cli/docs/cli.json b/cli/docs/cli.json index bc1d3740..69b7be9f 100644 --- a/cli/docs/cli.json +++ b/cli/docs/cli.json @@ -4339,6 +4339,111 @@ } ], "subcommands": [ + { + "name": "active-configuration", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "clear", + "about": "Clear switch port configuration", + "args": [ + { + "long": "port", + "help": "A name to use when selecting switch ports." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "rack-id", + "help": "A rack id to use when selecting switch ports." + }, + { + "long": "switch", + "values": [ + "switch0", + "switch1" + ], + "help": "A switch location to use when selecting switch ports." + } + ] + }, + { + "name": "set", + "about": "Set switch port configuration", + "args": [ + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "port", + "help": "A name to use when selecting switch ports." + }, + { + "long": "port-settings", + "help": "A name or id to use when applying switch port settings." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "rack-id", + "help": "A rack id to use when selecting switch ports." + }, + { + "long": "switch", + "values": [ + "switch0", + "switch1" + ], + "help": "A switch location to use when selecting switch ports." + } + ] + }, + { + "name": "view", + "about": "View switch port configuration", + "args": [ + { + "long": "port", + "help": "A name to use when selecting switch ports." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "rack-id", + "help": "A rack id to use when selecting switch ports." + }, + { + "long": "switch", + "values": [ + "switch0", + "switch1" + ], + "help": "A switch location to use when selecting switch ports." + } + ] + } + ] + }, { "name": "apply-settings", "about": "Apply switch port settings", @@ -4370,6 +4475,10 @@ }, { "long": "switch-location", + "values": [ + "switch0", + "switch1" + ], "help": "A switch location to use when selecting switch ports." } ] @@ -4393,6 +4502,10 @@ }, { "long": "switch-location", + "values": [ + "switch0", + "switch1" + ], "help": "A switch location to use when selecting switch ports." } ] @@ -4452,6 +4565,10 @@ }, { "long": "switch-location", + "values": [ + "switch0", + "switch1" + ], "help": "A switch location to use when selecting switch ports." } ] @@ -4641,6 +4758,37 @@ } ], "subcommands": [ + { + "name": "add", + "about": "Add block to address lot", + "args": [ + { + "long": "address-lot", + "help": "Name or ID of the address lot" + }, + { + "long": "first-address", + "help": "The first address in the lot (inclusive)." + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "last-address", + "help": "The last address in the lot (inclusive)." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, { "name": "list", "about": "List blocks in address lot", @@ -4665,6 +4813,37 @@ ] } ] + }, + { + "name": "remove", + "about": "Remove block from address lot", + "args": [ + { + "long": "address-lot", + "help": "Name or ID of the address lot" + }, + { + "long": "first-address", + "help": "The first address in the lot (inclusive)." + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "last-address", + "help": "The last address in the lot (inclusive)." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] } ] }, @@ -5151,7 +5330,7 @@ "about": "Delete BGP configuration", "args": [ { - "long": "name-or-id", + "long": "bgp-config", "help": "A name or id to use when selecting BGP config." }, { @@ -6095,7 +6274,7 @@ ] }, { - "name": "switch-port-settings", + "name": "switch-port", "args": [ { "long": "profile", @@ -6105,72 +6284,1012 @@ ], "subcommands": [ { - "name": "create", - "about": "Create switch port settings", + "name": "configuration", "args": [ { - "long": "description" - }, + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ { - "long": "json-body", - "help": "Path to a file that contains the full json body." + "name": "address", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "add", + "about": "Add address to an interface configuration", + "args": [ + { + "long": "address", + "help": "The address and subnet mask" + }, + { + "long": "address-lot", + "help": "The address lot this address is drawn from." + }, + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The name of the interface" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "vlan-id", + "help": "Optional VLAN ID for this address" + } + ] + }, + { + "name": "list", + "about": "List addresses assigned to a provided interface configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "remove", + "about": "Remove address from an interface configuration", + "args": [ + { + "long": "address", + "help": "The address and subnet mask" + }, + { + "long": "address-lot", + "help": "The address lot this address is drawn from." + }, + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The name of the interface" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "vlan-id", + "help": "Optional VLAN ID for this address" + } + ] + } + ] }, { - "long": "json-body-template", - "help": "XXX" + "name": "bgp", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "peer", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "add", + "about": "Add bgp peer to an interface configuration", + "args": [ + { + "long": "addr", + "help": "The address of the host to peer with." + }, + { + "long": "allow-export-list-active", + "values": [ + "true", + "false" + ], + "help": "Enable export policies" + }, + { + "long": "allow-import-list-active", + "values": [ + "true", + "false" + ], + "help": "Enable import policies" + }, + { + "long": "bgp-config", + "help": "The global BGP configuration used for establishing a session with this peer." + }, + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "connect-retry", + "help": "How long to to wait between TCP connection retries (seconds)." + }, + { + "long": "delay-open", + "help": "How long to delay sending an open request after establishing a TCP session (seconds)." + }, + { + "long": "enforce-first-as", + "values": [ + "true", + "false" + ], + "help": "Enforce that the first AS in paths received from this peer is the peer's AS." + }, + { + "long": "hold-time", + "help": "How long to hold peer connections between keepalives (seconds)." + }, + { + "long": "idle-hold-time", + "help": "How long to hold this peer in idle before attempting a new session (seconds)." + }, + { + "long": "interface-name", + "help": "The name of the interface to peer on. This is relative to the port configuration this BGP peer configuration is a part of. For example this value could be phy0 to refer to a primary physical interface. Or it could be vlan47 to refer to a VLAN interface." + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "keepalive", + "help": "How often to send keepalive requests (seconds)." + }, + { + "long": "local-pref", + "help": "Apply a local preference to routes received from this peer." + }, + { + "long": "md5-auth-key", + "help": "Use the given key for TCP-MD5 authentication with this peer." + }, + { + "long": "min-ttl", + "help": "Require messages from this peer to have a minimum IP time to live field." + }, + { + "long": "multi-exit-discriminator", + "help": "Apply a multi-exit discriminator (MED) in updates sent to this peer." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "remote-asn", + "help": "Require that this peer have a specified ASN." + }, + { + "long": "vlan-id", + "help": "Associate a VLAN ID with this peer." + } + ] + }, + { + "name": "allow", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "export", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "add", + "about": "Add prefix to bgp peer allowed export list", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The interface the peer is configured on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "peer-address", + "help": "An address identifying the target bgp peer" + }, + { + "long": "prefix", + "help": "The allowed prefix to add or remove" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "list", + "about": "List prefixes allowed to be exported by a given bgp peer", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "peer-address", + "help": "An address identifying a configured bgp peer." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "remove", + "about": "Remove prefix from bgp peer allowed export list", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The interface the peer is configured on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "peer-address", + "help": "An address identifying the target bgp peer" + }, + { + "long": "prefix", + "help": "The allowed prefix to add or remove" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + } + ] + }, + { + "name": "import", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "add", + "about": "Add prefix to bgp peer allowed import list", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The interface the peer is configured on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "peer-address", + "help": "An address identifying the target bgp peer" + }, + { + "long": "prefix", + "help": "The allowed prefix to add or remove" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "list", + "about": "List prefixes allowed to be imported by a given bgp peer", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "peer-address", + "help": "An address identifying a configured bgp peer." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "remove", + "about": "Remove prefix from bgp peer allowed import list", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The interface the peer is configured on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "peer-address", + "help": "An address identifying the target bgp peer" + }, + { + "long": "prefix", + "help": "The allowed prefix to add or remove" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + } + ] + } + ] + }, + { + "name": "community", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "add", + "about": "Add community to bgp peer", + "args": [ + { + "long": "community", + "help": "The community to add or remove" + }, + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The interface the peer is configured on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "peer-address", + "help": "An address identifying the target bgp peer" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "list", + "about": "List communities assigned to a bgp peer", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "peer-address", + "help": "An address identifying a configured bgp peer." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "remove", + "about": "Remove community from bgp peer", + "args": [ + { + "long": "community", + "help": "The community to add or remove" + }, + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface", + "help": "The interface the peer is configured on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "peer-address", + "help": "An address identifying the target bgp peer" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + } + ] + }, + { + "name": "list", + "about": "List bgp peers assigned to a provided interface configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "remove", + "about": "Remove bgp peer from an interface configuration", + "args": [ + { + "long": "addr", + "help": "The address of the host to peer with." + }, + { + "long": "bgp-config", + "help": "The global BGP configuration used for establishing a session with this peer." + }, + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "interface-name", + "help": "The name of the interface to peer on. This is relative to the port configuration this BGP peer configuration is a part of. For example this value could be phy0 to refer to a primary physical interface. Or it could be vlan47 to refer to a VLAN interface." + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + } + ] + } + ] }, { - "long": "name" + "name": "create", + "about": "Create switch port settings", + "args": [ + { + "long": "description" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "name" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] }, { - "long": "profile", - "help": "Configuration profile to use for commands", - "global": true - } - ] - }, - { - "name": "delete", - "about": "Delete switch port settings", - "args": [ - { - "long": "port-settings", - "help": "An optional name or id to use when selecting port settings." + "name": "delete", + "about": "Delete switch port settings", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] }, { - "long": "profile", - "help": "Configuration profile to use for commands", - "global": true - } - ] - }, - { - "name": "list", - "about": "List switch port settings", - "args": [ + "name": "geometry", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "set", + "about": "Set switch port geometry for a provided switch port configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "geometry", + "values": [ + "qsfp28x1", + "qsfp28x2", + "sfp28x4" + ], + "help": "Link geometry for the switch port." + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "view", + "about": "Get switch port geometry for a provided switch port configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + } + ] + }, { - "long": "limit", - "help": "Maximum number of items returned by a single call" + "name": "link", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "create", + "about": "Create a link for a provided switch port configuration", + "args": [ + { + "long": "autoneg", + "values": [ + "true", + "false" + ], + "help": "Whether or not to set autonegotiation" + }, + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "fec", + "values": [ + "firecode", + "none", + "rs" + ], + "help": "The forward error correction mode of the link." + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "lldp-config", + "help": "The optional link-layer discovery protocol (LLDP) configuration for the link." + }, + { + "long": "mtu", + "help": "Maximum transmission unit for the link." + }, + { + "long": "name", + "help": "Name of link" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "speed", + "values": [ + "speed0_g", + "speed1_g", + "speed10_g", + "speed25_g", + "speed40_g", + "speed50_g", + "speed100_g", + "speed200_g", + "speed400_g" + ], + "help": "The speed of the link." + } + ] + }, + { + "name": "delete", + "about": "Delete a link for a provided switch port configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "link", + "help": "Link name" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "list", + "about": "List links for a provided switch port configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "view", + "about": "View a link for a provided switch port configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "link", + "help": "Link name" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + } + ] }, { - "long": "port-settings", - "help": "An optional name or id to use when selecting port settings." + "name": "list", + "about": "List switch port settings", + "args": [ + { + "long": "configuration", + "help": "An optional name or id to use when selecting a switch port configuration." + }, + { + "long": "limit", + "help": "Maximum number of items returned by a single call" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "sort-by", + "values": [ + "name_ascending", + "name_descending", + "id_ascending" + ] + } + ] }, { - "long": "profile", - "help": "Configuration profile to use for commands", - "global": true + "name": "route", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "add", + "about": "Add route to an interface configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "dst", + "help": "The route destination." + }, + { + "long": "gw", + "help": "The route gateway." + }, + { + "long": "interface", + "help": "The interface to configure the route on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "rib-priority", + "help": "Local preference for route. Higher preference indicates precedence within and across protocols." + }, + { + "long": "vid", + "help": "VLAN id the gateway is reachable over." + } + ] + }, + { + "name": "list", + "about": "List routes assigned to a provided interface configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "remove", + "about": "Remove route from an interface configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "dst", + "help": "The route destination." + }, + { + "long": "gw", + "help": "The route gateway." + }, + { + "long": "interface", + "help": "The interface to configure the route on" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "rib-priority", + "help": "Local preference for route. Higher preference indicates precedence within and across protocols." + }, + { + "long": "vid", + "help": "VLAN id the gateway is reachable over." + } + ] + } + ] }, { - "long": "sort-by", - "values": [ - "name_ascending", - "name_descending", - "id_ascending" + "name": "view", + "about": "View a switch port configuration", + "args": [ + { + "long": "configuration", + "help": "A name or id to use when selecting a switch port configuration." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } ] } ] - }, + } + ] + }, + { + "name": "switch-port-settings", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ { "name": "show", "about": "Get the configuration of switch ports.", @@ -6181,21 +7300,6 @@ "global": true } ] - }, - { - "name": "view", - "about": "Get information about switch port", - "args": [ - { - "long": "port", - "help": "A name or id to use when selecting switch port settings info objects." - }, - { - "long": "profile", - "help": "Configuration profile to use for commands", - "global": true - } - ] } ] } diff --git a/cli/src/cli_builder.rs b/cli/src/cli_builder.rs index d029ed8d..7797d633 100644 --- a/cli/src/cli_builder.rs +++ b/cli/src/cli_builder.rs @@ -443,9 +443,15 @@ fn xxx<'a>(command: CliCommand) -> Option<&'a str> { CliCommand::NetworkingAddressLotList => Some("system networking address-lot list"), CliCommand::NetworkingAddressLotCreate => Some("system networking address-lot create"), CliCommand::NetworkingAddressLotDelete => Some("system networking address-lot delete"), + CliCommand::NetworkingAddressLotBlockList => { Some("system networking address-lot block list") } + CliCommand::NetworkingAddressLotBlockAdd => Some("system networking address-lot block add"), + CliCommand::NetworkingAddressLotBlockRemove => { + Some("system networking address-lot block remove") + } + CliCommand::NetworkingLoopbackAddressList => { Some("system networking loopback-address list") } @@ -456,25 +462,120 @@ fn xxx<'a>(command: CliCommand) -> Option<&'a str> { Some("system networking loopback-address delete") } + CliCommand::NetworkingSwitchPortList => Some("system hardware switch-port list"), + CliCommand::NetworkingSwitchPortStatus => Some("system hardware switch-port status"), + + // TODO: deprecate? + // how do we go about deprecating commands? CliCommand::NetworkingSwitchPortApplySettings => { Some("system hardware switch-port apply-settings") } CliCommand::NetworkingSwitchPortClearSettings => { Some("system hardware switch-port clear-settings") } - CliCommand::NetworkingSwitchPortList => Some("system hardware switch-port list"), - CliCommand::NetworkingSwitchPortStatus => Some("system hardware switch-port status"), - CliCommand::NetworkingSwitchPortSettingsList => { - Some("system networking switch-port-settings list") + + // Use these instead + CliCommand::NetworkingSwitchPortActiveConfigurationView => { + Some("system hardware switch-port active-configuration view") + } + CliCommand::NetworkingSwitchPortActiveConfigurationSet => { + Some("system hardware switch-port active-configuration set") + } + CliCommand::NetworkingSwitchPortActiveConfigurationClear => { + Some("system hardware switch-port active-configuration clear") + } + + CliCommand::NetworkingSwitchPortConfigurationList => { + Some("system networking switch-port configuration list") + } + CliCommand::NetworkingSwitchPortConfigurationCreate => { + Some("system networking switch-port configuration create") + } + CliCommand::NetworkingSwitchPortConfigurationDelete => { + Some("system networking switch-port configuration delete") + } + CliCommand::NetworkingSwitchPortConfigurationView => { + Some("system networking switch-port configuration view") + } + + CliCommand::NetworkingSwitchPortConfigurationGeometryView => { + Some("system networking switch-port configuration geometry view") + } + CliCommand::NetworkingSwitchPortConfigurationGeometrySet => { + Some("system networking switch-port configuration geometry set") + } + + CliCommand::NetworkingSwitchPortConfigurationAddressList => { + Some("system networking switch-port configuration address list") + } + CliCommand::NetworkingSwitchPortConfigurationAddressAdd => { + Some("system networking switch-port configuration address add") + } + CliCommand::NetworkingSwitchPortConfigurationAddressRemove => { + Some("system networking switch-port configuration address remove") + } + + CliCommand::NetworkingSwitchPortConfigurationBgpPeerList => { + Some("system networking switch-port configuration bgp peer list") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAdd => { + Some("system networking switch-port configuration bgp peer add") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerRemove => { + Some("system networking switch-port configuration bgp peer remove") + } + + CliCommand::NetworkingSwitchPortConfigurationRouteList => { + Some("system networking switch-port configuration route list") + } + CliCommand::NetworkingSwitchPortConfigurationRouteAdd => { + Some("system networking switch-port configuration route add") + } + CliCommand::NetworkingSwitchPortConfigurationRouteRemove => { + Some("system networking switch-port configuration route remove") + } + + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportList => { + Some("system networking switch-port configuration bgp peer allow import list") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd => { + Some("system networking switch-port configuration bgp peer allow import add") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove => { + Some("system networking switch-port configuration bgp peer allow import remove") + } + + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportList => { + Some("system networking switch-port configuration bgp peer allow export list") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd => { + Some("system networking switch-port configuration bgp peer allow export add") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove => { + Some("system networking switch-port configuration bgp peer allow export remove") + } + + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityList => { + Some("system networking switch-port configuration bgp peer community list") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd => { + Some("system networking switch-port configuration bgp peer community add") + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove => { + Some("system networking switch-port configuration bgp peer community remove") + } + + CliCommand::NetworkingSwitchPortConfigurationLinkList => { + Some("system networking switch-port configuration link list") } - CliCommand::NetworkingSwitchPortSettingsCreate => { - Some("system networking switch-port-settings create") + CliCommand::NetworkingSwitchPortConfigurationLinkCreate => { + Some("system networking switch-port configuration link create") } - CliCommand::NetworkingSwitchPortSettingsDelete => { - Some("system networking switch-port-settings delete") + CliCommand::NetworkingSwitchPortConfigurationLinkView => { + Some("system networking switch-port configuration link view") } - CliCommand::NetworkingSwitchPortSettingsView => { - Some("system networking switch-port-settings view") + CliCommand::NetworkingSwitchPortConfigurationLinkDelete => { + Some("system networking switch-port configuration link delete") } CliCommand::NetworkingBfdStatus => Some("system networking bfd status"), diff --git a/cli/src/cmd_net.rs b/cli/src/cmd_net.rs index ecabc13f..05807337 100644 --- a/cli/src/cmd_net.rs +++ b/cli/src/cmd_net.rs @@ -14,7 +14,7 @@ use colored::*; use futures::TryStreamExt; use oxide::{ types::{ - Address, AddressConfig, BgpAnnounceSetCreate, BgpAnnouncementCreate, BgpPeer, + Address, AddressConfig, BgpAnnounceSetCreate, BgpAnnouncementCreate, BgpPeerCombined, BgpPeerConfig, BgpPeerStatus, ImportExportPolicy, IpNet, LinkConfigCreate, LinkFec, LinkSpeed, LldpLinkConfigCreate, Name, NameOrId, Route, RouteConfig, SwitchInterfaceConfigCreate, SwitchInterfaceKind, SwitchInterfaceKind2, SwitchLocation, @@ -148,7 +148,7 @@ impl AuthenticatedCmd for CmdLinkAdd { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -185,7 +185,7 @@ impl AuthenticatedCmd for CmdLinkDel { current_port_settings(client, &self.rack, &self.switch, &self.port).await?; settings.links.clear(); client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -443,7 +443,7 @@ impl AuthenticatedCmd for CmdBgpFilter { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -500,7 +500,7 @@ impl AuthenticatedCmd for CmdBgpAuth { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -558,7 +558,7 @@ impl AuthenticatedCmd for CmdBgpLocalPref { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -681,7 +681,7 @@ impl AuthenticatedCmd for CmdStaticRouteSet { } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -747,7 +747,7 @@ impl AuthenticatedCmd for CmdStaticRouteDelete { } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -841,7 +841,7 @@ impl AuthenticatedCmd for CmdAddrAdd { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -892,7 +892,7 @@ impl AuthenticatedCmd for CmdAddrDel { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -1060,7 +1060,7 @@ impl AuthenticatedCmd for CmdBgpPeerSet { async fn run(&self, client: &Client) -> Result<()> { let mut settings = current_port_settings(client, &self.rack, &self.switch, &self.port).await?; - let peer = BgpPeer { + let peer = BgpPeerCombined { addr: self.addr, allowed_import: if self.allowed_imports.is_empty() { ImportExportPolicy::NoFiltering @@ -1112,7 +1112,7 @@ impl AuthenticatedCmd for CmdBgpPeerSet { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -1160,7 +1160,7 @@ impl AuthenticatedCmd for CmdBgpPeerDel { } } client - .networking_switch_port_settings_create() + .networking_switch_port_configuration_create() .body(settings) .send() .await?; @@ -1210,8 +1210,8 @@ impl AuthenticatedCmd for CmdPortConfig { for p in &ports { if let Some(id) = p.port_settings_id { let config = client - .networking_switch_port_settings_view() - .port(id) + .networking_switch_port_configuration_view() + .configuration(id) .send() .await? .into_inner(); @@ -1614,7 +1614,7 @@ impl CmdPortStatus { // modify-write operation. async fn create_current(settings_id: Uuid, client: &Client) -> Result { let list = client - .networking_switch_port_settings_list() + .networking_switch_port_configuration_list() .stream() .try_collect::>() .await?; @@ -1627,8 +1627,8 @@ async fn create_current(settings_id: Uuid, client: &Client) -> Result Cli { CliCommand::PhysicalDiskView => Self::cli_physical_disk_view(), CliCommand::RackList => Self::cli_rack_list(), CliCommand::RackView => Self::cli_rack_view(), + CliCommand::NetworkingSwitchPortActiveConfigurationView => { + Self::cli_networking_switch_port_active_configuration_view() + } + CliCommand::NetworkingSwitchPortActiveConfigurationSet => { + Self::cli_networking_switch_port_active_configuration_set() + } + CliCommand::NetworkingSwitchPortActiveConfigurationClear => { + Self::cli_networking_switch_port_active_configuration_clear() + } CliCommand::SledList => Self::cli_sled_list(), CliCommand::SledAdd => Self::cli_sled_add(), CliCommand::SledView => Self::cli_sled_view(), @@ -169,6 +178,12 @@ impl Cli { CliCommand::NetworkingAddressLotBlockList => { Self::cli_networking_address_lot_block_list() } + CliCommand::NetworkingAddressLotBlockAdd => { + Self::cli_networking_address_lot_block_add() + } + CliCommand::NetworkingAddressLotBlockRemove => { + Self::cli_networking_address_lot_block_remove() + } CliCommand::NetworkingAllowListView => Self::cli_networking_allow_list_view(), CliCommand::NetworkingAllowListUpdate => Self::cli_networking_allow_list_update(), CliCommand::NetworkingBfdDisable => Self::cli_networking_bfd_disable(), @@ -204,17 +219,89 @@ impl Cli { CliCommand::NetworkingLoopbackAddressDelete => { Self::cli_networking_loopback_address_delete() } - CliCommand::NetworkingSwitchPortSettingsList => { - Self::cli_networking_switch_port_settings_list() + CliCommand::NetworkingSwitchPortConfigurationList => { + Self::cli_networking_switch_port_configuration_list() + } + CliCommand::NetworkingSwitchPortConfigurationCreate => { + Self::cli_networking_switch_port_configuration_create() + } + CliCommand::NetworkingSwitchPortConfigurationView => { + Self::cli_networking_switch_port_configuration_view() + } + CliCommand::NetworkingSwitchPortConfigurationDelete => { + Self::cli_networking_switch_port_configuration_delete() + } + CliCommand::NetworkingSwitchPortConfigurationAddressList => { + Self::cli_networking_switch_port_configuration_address_list() + } + CliCommand::NetworkingSwitchPortConfigurationAddressAdd => { + Self::cli_networking_switch_port_configuration_address_add() + } + CliCommand::NetworkingSwitchPortConfigurationAddressRemove => { + Self::cli_networking_switch_port_configuration_address_remove() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerList => { + Self::cli_networking_switch_port_configuration_bgp_peer_list() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAdd => { + Self::cli_networking_switch_port_configuration_bgp_peer_add() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportList => { + Self::cli_networking_switch_port_configuration_bgp_peer_allow_export_list() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd => { + Self::cli_networking_switch_port_configuration_bgp_peer_allow_export_add() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove => { + Self::cli_networking_switch_port_configuration_bgp_peer_allow_export_remove() } - CliCommand::NetworkingSwitchPortSettingsCreate => { - Self::cli_networking_switch_port_settings_create() + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportList => { + Self::cli_networking_switch_port_configuration_bgp_peer_allow_import_list() } - CliCommand::NetworkingSwitchPortSettingsDelete => { - Self::cli_networking_switch_port_settings_delete() + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd => { + Self::cli_networking_switch_port_configuration_bgp_peer_allow_import_add() } - CliCommand::NetworkingSwitchPortSettingsView => { - Self::cli_networking_switch_port_settings_view() + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove => { + Self::cli_networking_switch_port_configuration_bgp_peer_allow_import_remove() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityList => { + Self::cli_networking_switch_port_configuration_bgp_peer_community_list() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd => { + Self::cli_networking_switch_port_configuration_bgp_peer_community_add() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove => { + Self::cli_networking_switch_port_configuration_bgp_peer_community_remove() + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerRemove => { + Self::cli_networking_switch_port_configuration_bgp_peer_remove() + } + CliCommand::NetworkingSwitchPortConfigurationGeometryView => { + Self::cli_networking_switch_port_configuration_geometry_view() + } + CliCommand::NetworkingSwitchPortConfigurationGeometrySet => { + Self::cli_networking_switch_port_configuration_geometry_set() + } + CliCommand::NetworkingSwitchPortConfigurationLinkList => { + Self::cli_networking_switch_port_configuration_link_list() + } + CliCommand::NetworkingSwitchPortConfigurationLinkCreate => { + Self::cli_networking_switch_port_configuration_link_create() + } + CliCommand::NetworkingSwitchPortConfigurationLinkView => { + Self::cli_networking_switch_port_configuration_link_view() + } + CliCommand::NetworkingSwitchPortConfigurationLinkDelete => { + Self::cli_networking_switch_port_configuration_link_delete() + } + CliCommand::NetworkingSwitchPortConfigurationRouteList => { + Self::cli_networking_switch_port_configuration_route_list() + } + CliCommand::NetworkingSwitchPortConfigurationRouteAdd => { + Self::cli_networking_switch_port_configuration_route_add() + } + CliCommand::NetworkingSwitchPortConfigurationRouteRemove => { + Self::cli_networking_switch_port_configuration_route_remove() } CliCommand::SystemPolicyView => Self::cli_system_policy_view(), CliCommand::SystemPolicyUpdate => Self::cli_system_policy_update(), @@ -3344,6 +3431,123 @@ impl Cli { .about("Fetch rack") } + pub fn cli_networking_switch_port_active_configuration_view() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("port") + .long("port") + .value_parser(clap::value_parser!(types::Name)) + .required(true) + .help("A name to use when selecting switch ports."), + ) + .arg( + clap::Arg::new("rack-id") + .long("rack-id") + .value_parser(clap::value_parser!(uuid::Uuid)) + .required(true) + .help("A rack id to use when selecting switch ports."), + ) + .arg( + clap::Arg::new("switch") + .long("switch") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SwitchLocation::Switch0.to_string(), + types::SwitchLocation::Switch1.to_string(), + ]), + |s| types::SwitchLocation::try_from(s).unwrap(), + )) + .required(true) + .help("A switch location to use when selecting switch ports."), + ) + .about("View switch port configuration") + } + + pub fn cli_networking_switch_port_active_configuration_set() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("port") + .long("port") + .value_parser(clap::value_parser!(types::Name)) + .required(true) + .help("A name to use when selecting switch ports."), + ) + .arg( + clap::Arg::new("port-settings") + .long("port-settings") + .value_parser(clap::value_parser!(types::NameOrId)) + .required_unless_present("json-body") + .help("A name or id to use when applying switch port settings."), + ) + .arg( + clap::Arg::new("rack-id") + .long("rack-id") + .value_parser(clap::value_parser!(uuid::Uuid)) + .required(true) + .help("A rack id to use when selecting switch ports."), + ) + .arg( + clap::Arg::new("switch") + .long("switch") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SwitchLocation::Switch0.to_string(), + types::SwitchLocation::Switch1.to_string(), + ]), + |s| types::SwitchLocation::try_from(s).unwrap(), + )) + .required(true) + .help("A switch location to use when selecting switch ports."), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Set switch port configuration") + } + + pub fn cli_networking_switch_port_active_configuration_clear() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("port") + .long("port") + .value_parser(clap::value_parser!(types::Name)) + .required(true) + .help("A name to use when selecting switch ports."), + ) + .arg( + clap::Arg::new("rack-id") + .long("rack-id") + .value_parser(clap::value_parser!(uuid::Uuid)) + .required(true) + .help("A rack id to use when selecting switch ports."), + ) + .arg( + clap::Arg::new("switch") + .long("switch") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SwitchLocation::Switch0.to_string(), + types::SwitchLocation::Switch1.to_string(), + ]), + |s| types::SwitchLocation::try_from(s).unwrap(), + )) + .required(true) + .help("A switch location to use when selecting switch ports."), + ) + .about("Clear switch port configuration") + } + pub fn cli_sled_list() -> clap::Command { clap::Command::new("") .arg( @@ -3577,7 +3781,13 @@ impl Cli { .arg( clap::Arg::new("switch-location") .long("switch-location") - .value_parser(clap::value_parser!(types::Name)) + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SwitchLocation::Switch0.to_string(), + types::SwitchLocation::Switch1.to_string(), + ]), + |s| types::SwitchLocation::try_from(s).unwrap(), + )) .required(true) .help("A switch location to use when selecting switch ports."), ) @@ -3617,7 +3827,13 @@ impl Cli { .arg( clap::Arg::new("switch-location") .long("switch-location") - .value_parser(clap::value_parser!(types::Name)) + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SwitchLocation::Switch0.to_string(), + types::SwitchLocation::Switch1.to_string(), + ]), + |s| types::SwitchLocation::try_from(s).unwrap(), + )) .required(true) .help("A switch location to use when selecting switch ports."), ) @@ -3643,7 +3859,13 @@ impl Cli { .arg( clap::Arg::new("switch-location") .long("switch-location") - .value_parser(clap::value_parser!(types::Name)) + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SwitchLocation::Switch0.to_string(), + types::SwitchLocation::Switch1.to_string(), + ]), + |s| types::SwitchLocation::try_from(s).unwrap(), + )) .required(true) .help("A switch location to use when selecting switch ports."), ) @@ -4436,7 +4658,7 @@ impl Cli { clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(true) + .required(false) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -4491,6 +4713,86 @@ impl Cli { .about("List blocks in address lot") } + pub fn cli_networking_address_lot_block_add() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("address-lot") + .long("address-lot") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the address lot"), + ) + .arg( + clap::Arg::new("first-address") + .long("first-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("The first address in the lot (inclusive)."), + ) + .arg( + clap::Arg::new("last-address") + .long("last-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("The last address in the lot (inclusive)."), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Add block to address lot") + } + + pub fn cli_networking_address_lot_block_remove() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("address-lot") + .long("address-lot") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the address lot"), + ) + .arg( + clap::Arg::new("first-address") + .long("first-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("The first address in the lot (inclusive)."), + ) + .arg( + clap::Arg::new("last-address") + .long("last-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("The last address in the lot (inclusive)."), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Remove block from address lot") + } + pub fn cli_networking_allow_list_view() -> clap::Command { clap::Command::new("").about("Get user-facing services IP allowlist") } @@ -4710,8 +5012,8 @@ impl Cli { pub fn cli_networking_bgp_config_delete() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("name-or-id") - .long("name-or-id") + clap::Arg::new("bgp-config") + .long("bgp-config") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) .help("A name or id to use when selecting BGP config."), @@ -4974,8 +5276,17 @@ impl Cli { .about("Delete loopback address") } - pub fn cli_networking_switch_port_settings_list() -> clap::Command { + pub fn cli_networking_switch_port_configuration_list() -> clap::Command { clap::Command::new("") + .arg( + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "An optional name or id to use when selecting a switch port configuration.", + ), + ) .arg( clap::Arg::new("limit") .long("limit") @@ -4983,13 +5294,6 @@ impl Cli { .required(false) .help("Maximum number of items returned by a single call"), ) - .arg( - clap::Arg::new("port-settings") - .long("port-settings") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("An optional name or id to use when selecting port settings."), - ) .arg( clap::Arg::new("sort-by") .long("sort-by") @@ -5006,7 +5310,7 @@ impl Cli { .about("List switch port settings") } - pub fn cli_networking_switch_port_settings_create() -> clap::Command { + pub fn cli_networking_switch_port_configuration_create() -> clap::Command { clap::Command::new("") .arg( clap::Arg::new("description") @@ -5037,177 +5341,138 @@ impl Cli { .about("Create switch port settings") } - pub fn cli_networking_switch_port_settings_delete() -> clap::Command { + pub fn cli_networking_switch_port_configuration_view() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("port-settings") - .long("port-settings") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("An optional name or id to use when selecting port settings."), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Delete switch port settings") + .about("View a switch port configuration") } - pub fn cli_networking_switch_port_settings_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_delete() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("port") - .long("port") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("A name or id to use when selecting switch port settings info objects."), + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Get information about switch port") - } - - pub fn cli_system_policy_view() -> clap::Command { - clap::Command::new("").about("Fetch top-level IAM policy") + .about("Delete switch port settings") } - pub fn cli_system_policy_update() -> clap::Command { + pub fn cli_networking_switch_port_configuration_address_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("json-body") - .long("json-body") - .value_name("JSON-FILE") + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .value_parser(clap::value_parser!(std::path::PathBuf)) - .help("Path to a file that contains the full json body."), - ) - .arg( - clap::Arg::new("json-body-template") - .long("json-body-template") - .action(clap::ArgAction::SetTrue) - .help("XXX"), + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Update top-level IAM policy") + .about("List addresses assigned to a provided interface configuration") } - pub fn cli_role_list() -> clap::Command { + pub fn cli_networking_switch_port_configuration_address_add() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) - .required(false) - .help("Maximum number of items returned by a single call"), + clap::Arg::new("address") + .long("address") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The address and subnet mask"), ) - .about("List built-in roles") - } - - pub fn cli_role_view() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("role-name") - .long("role-name") - .value_parser(clap::value_parser!(String)) + clap::Arg::new("address-lot") + .long("address-lot") + .value_parser(clap::value_parser!(types::NameOrId)) + .required_unless_present("json-body") + .help("The address lot this address is drawn from."), + ) + .arg( + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("The built-in role's unique name."), + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Fetch built-in role") - } - - pub fn cli_system_quotas_list() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) - .required(false) - .help("Maximum number of items returned by a single call"), + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The name of the interface"), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::IdSortMode::IdAscending.to_string() - ]), - |s| types::IdSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("vlan-id") + .long("vlan-id") + .value_parser(clap::value_parser!(u16)) + .required(false) + .help("Optional VLAN ID for this address"), ) - .about("Lists resource quotas for all silos") - } - - pub fn cli_silo_list() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") .required(false) - .help("Maximum number of items returned by a single call"), + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::NameOrIdSortMode::NameAscending.to_string(), - types::NameOrIdSortMode::NameDescending.to_string(), - types::NameOrIdSortMode::IdAscending.to_string(), - ]), - |s| types::NameOrIdSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), ) - .about("List silos") - .long_about("Lists silos that are discoverable based on the current permissions.") + .about("Add address to an interface configuration") } - pub fn cli_silo_create() -> clap::Command { + pub fn cli_networking_switch_port_configuration_address_remove() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("admin-group-name") - .long("admin-group-name") - .value_parser(clap::value_parser!(String)) - .required(false) - .help( - "If set, this group will be created during Silo creation and granted the \ - \"Silo Admin\" role. Identity providers can assert that users belong to \ - this group and those users can log in and further initialize the \ - Silo.\n\nNote that if configuring a SAML based identity provider, \ - group_attribute_name must be set for users to be considered part of a \ - group. See `SamlIdentityProviderCreate` for more information.", - ), + clap::Arg::new("address") + .long("address") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The address and subnet mask"), ) .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required_unless_present("json-body"), + clap::Arg::new("address-lot") + .long("address-lot") + .value_parser(clap::value_parser!(types::NameOrId)) + .required_unless_present("json-body") + .help("The address lot this address is drawn from."), ) .arg( - clap::Arg::new("discoverable") - .long("discoverable") - .value_parser(clap::value_parser!(bool)) - .required_unless_present("json-body"), + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("identity-mode") - .long("identity-mode") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::SiloIdentityMode::SamlJit.to_string(), - types::SiloIdentityMode::LocalOnly.to_string(), - ]), - |s| types::SiloIdentityMode::try_from(s).unwrap(), - )) - .required_unless_present("json-body"), + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The name of the interface"), ) .arg( - clap::Arg::new("name") - .long("name") - .value_parser(clap::value_parser!(types::Name)) - .required_unless_present("json-body"), + clap::Arg::new("vlan-id") + .long("vlan-id") + .value_parser(clap::value_parser!(u16)) + .required(false) + .help("Optional VLAN ID for this address"), ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(true) + .required(false) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -5217,98 +5482,173 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Create a silo") + .about("Remove address from an interface configuration") } - pub fn cli_silo_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("silo") - .long("silo") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the silo"), + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Fetch silo") - .long_about("Fetch silo by name or ID.") + .about("List bgp peers assigned to a provided interface configuration") } - pub fn cli_silo_delete() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_add() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("silo") - .long("silo") + clap::Arg::new("addr") + .long("addr") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The address of the host to peer with."), + ) + .arg( + clap::Arg::new("allow-export-list-active") + .long("allow-export-list-active") + .value_parser(clap::value_parser!(bool)) + .required_unless_present("json-body") + .help("Enable export policies"), + ) + .arg( + clap::Arg::new("allow-import-list-active") + .long("allow-import-list-active") + .value_parser(clap::value_parser!(bool)) + .required_unless_present("json-body") + .help("Enable import policies"), + ) + .arg( + clap::Arg::new("bgp-config") + .long("bgp-config") + .value_parser(clap::value_parser!(types::NameOrId)) + .required_unless_present("json-body") + .help( + "The global BGP configuration used for establishing a session with this \ + peer.", + ), + ) + .arg( + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the silo"), + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Delete a silo") - .long_about("Delete a silo by name or ID.") - } - - pub fn cli_silo_ip_pool_list() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) + clap::Arg::new("connect-retry") + .long("connect-retry") + .value_parser(clap::value_parser!(u32)) + .required_unless_present("json-body") + .help("How long to to wait between TCP connection retries (seconds)."), + ) + .arg( + clap::Arg::new("delay-open") + .long("delay-open") + .value_parser(clap::value_parser!(u32)) + .required_unless_present("json-body") + .help( + "How long to delay sending an open request after establishing a TCP \ + session (seconds).", + ), + ) + .arg( + clap::Arg::new("enforce-first-as") + .long("enforce-first-as") + .value_parser(clap::value_parser!(bool)) + .required_unless_present("json-body") + .help( + "Enforce that the first AS in paths received from this peer is the peer's \ + AS.", + ), + ) + .arg( + clap::Arg::new("hold-time") + .long("hold-time") + .value_parser(clap::value_parser!(u32)) + .required_unless_present("json-body") + .help("How long to hold peer connections between keepalives (seconds)."), + ) + .arg( + clap::Arg::new("idle-hold-time") + .long("idle-hold-time") + .value_parser(clap::value_parser!(u32)) + .required_unless_present("json-body") + .help( + "How long to hold this peer in idle before attempting a new session \ + (seconds).", + ), + ) + .arg( + clap::Arg::new("interface-name") + .long("interface-name") + .value_parser(clap::value_parser!(String)) + .required_unless_present("json-body") + .help( + "The name of the interface to peer on. This is relative to the port \ + configuration this BGP peer configuration is a part of. For example this \ + value could be phy0 to refer to a primary physical interface. Or it \ + could be vlan47 to refer to a VLAN interface.", + ), + ) + .arg( + clap::Arg::new("keepalive") + .long("keepalive") + .value_parser(clap::value_parser!(u32)) + .required_unless_present("json-body") + .help("How often to send keepalive requests (seconds)."), + ) + .arg( + clap::Arg::new("local-pref") + .long("local-pref") + .value_parser(clap::value_parser!(u32)) .required(false) - .help("Maximum number of items returned by a single call"), + .help("Apply a local preference to routes received from this peer."), ) .arg( - clap::Arg::new("silo") - .long("silo") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the silo"), + clap::Arg::new("md5-auth-key") + .long("md5-auth-key") + .value_parser(clap::value_parser!(String)) + .required(false) + .help("Use the given key for TCP-MD5 authentication with this peer."), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::NameOrIdSortMode::NameAscending.to_string(), - types::NameOrIdSortMode::NameDescending.to_string(), - types::NameOrIdSortMode::IdAscending.to_string(), - ]), - |s| types::NameOrIdSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("min-ttl") + .long("min-ttl") + .value_parser(clap::value_parser!(u8)) + .required(false) + .help( + "Require messages from this peer to have a minimum IP time to live field.", + ), ) - .about("List IP pools linked to silo") - .long_about( - "Linked IP pools are available to users in the specified silo. A silo can have at \ - most one default pool. IPs are allocated from the default pool when users ask \ - for one without specifying a pool.", + .arg( + clap::Arg::new("multi-exit-discriminator") + .long("multi-exit-discriminator") + .value_parser(clap::value_parser!(u32)) + .required(false) + .help("Apply a multi-exit discriminator (MED) in updates sent to this peer."), ) - } - - pub fn cli_silo_policy_view() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("silo") - .long("silo") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the silo"), + clap::Arg::new("remote-asn") + .long("remote-asn") + .value_parser(clap::value_parser!(u32)) + .required(false) + .help("Require that this peer have a specified ASN."), ) - .about("Fetch silo IAM policy") - } - - pub fn cli_silo_policy_update() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("silo") - .long("silo") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the silo"), + clap::Arg::new("vlan-id") + .long("vlan-id") + .value_parser(clap::value_parser!(u16)) + .required(false) + .help("Associate a VLAN ID with this peer."), ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(true) + .required(false) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -5318,52 +5658,57 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Update silo IAM policy") + .about("Add bgp peer to an interface configuration") } - pub fn cli_silo_quotas_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_allow_export_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("silo") - .long("silo") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the silo"), + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Fetch resource quotas for silo") + .arg( + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required(true) + .help("An address identifying a configured bgp peer."), + ) + .about("List prefixes allowed to be exported by a given bgp peer") } - pub fn cli_silo_quotas_update() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_allow_export_add() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("cpus") - .long("cpus") - .value_parser(clap::value_parser!(i64)) - .required(false) - .help("The amount of virtual CPUs available for running instances in the Silo"), + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("memory") - .long("memory") - .value_parser(clap::value_parser!(types::ByteCount)) - .required(false) - .help( - "The amount of RAM (in bytes) available for running instances in the Silo", - ), + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The interface the peer is configured on"), ) .arg( - clap::Arg::new("silo") - .long("silo") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the silo"), + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("An address identifying the target bgp peer"), ) .arg( - clap::Arg::new("storage") - .long("storage") - .value_parser(clap::value_parser!(types::ByteCount)) - .required(false) - .help("The amount of storage (in bytes) available for disks or snapshots"), + clap::Arg::new("prefix") + .long("prefix") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The allowed prefix to add or remove"), ) .arg( clap::Arg::new("json-body") @@ -5379,138 +5724,105 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Update resource quotas for silo") - .long_about("If a quota value is not specified, it will remain unchanged.") + .about("Add prefix to bgp peer allowed export list") } - pub fn cli_silo_user_list() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_allow_export_remove() -> clap::Command + { clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) - .required(false) - .help("Maximum number of items returned by a single call"), - ) - .arg( - clap::Arg::new("silo") - .long("silo") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the silo"), + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::IdSortMode::IdAscending.to_string() - ]), - |s| types::IdSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The interface the peer is configured on"), ) - .about("List built-in (system) users in silo") - } - - pub fn cli_silo_user_view() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("silo") - .long("silo") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the silo"), + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("An address identifying the target bgp peer"), ) .arg( - clap::Arg::new("user-id") - .long("user-id") - .value_parser(clap::value_parser!(uuid::Uuid)) - .required(true) - .help("The user's internal ID"), + clap::Arg::new("prefix") + .long("prefix") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The allowed prefix to add or remove"), ) - .about("Fetch built-in (system) user") - } - - pub fn cli_user_builtin_list() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") .required(false) - .help("Maximum number of items returned by a single call"), + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::NameSortMode::NameAscending.to_string(), - ]), - |s| types::NameSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), ) - .about("List built-in users") + .about("Remove prefix from bgp peer allowed export list") } - pub fn cli_user_builtin_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_allow_import_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("user") - .long("user") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(true), - ) - .about("Fetch built-in user") - } - - pub fn cli_silo_utilization_list() -> clap::Command { - clap::Command::new("") - .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) - .required(false) - .help("Maximum number of items returned by a single call"), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::NameOrIdSortMode::NameAscending.to_string(), - types::NameOrIdSortMode::NameDescending.to_string(), - types::NameOrIdSortMode::IdAscending.to_string(), - ]), - |s| types::NameOrIdSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required(true) + .help("An address identifying a configured bgp peer."), ) - .about("List current utilization state for all silos") + .about("List prefixes allowed to be imported by a given bgp peer") } - pub fn cli_silo_utilization_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_allow_import_add() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("silo") - .long("silo") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the silo"), + .help("A name or id to use when selecting a switch port configuration."), ) - .about("Fetch current utilization for given silo") - } - - pub fn cli_timeseries_query() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("query") - .long("query") - .value_parser(clap::value_parser!(String)) + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) .required_unless_present("json-body") - .help("A timeseries query string, written in the Oximeter query language."), + .help("The interface the peer is configured on"), + ) + .arg( + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("An address identifying the target bgp peer"), + ) + .arg( + clap::Arg::new("prefix") + .long("prefix") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The allowed prefix to add or remove"), ) .arg( clap::Arg::new("json-body") @@ -5526,101 +5838,113 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Run timeseries query") - .long_about("Queries are written in OxQL.") + .about("Add prefix to bgp peer allowed import list") } - pub fn cli_timeseries_schema_list() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_allow_import_remove() -> clap::Command + { clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) - .required(false) - .help("Maximum number of items returned by a single call"), + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) - .about("List timeseries schemas") - } - - pub fn cli_user_list() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("group") - .long("group") - .value_parser(clap::value_parser!(uuid::Uuid)) - .required(false), + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The interface the peer is configured on"), ) .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("An address identifying the target bgp peer"), + ) + .arg( + clap::Arg::new("prefix") + .long("prefix") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The allowed prefix to add or remove"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") .required(false) - .help("Maximum number of items returned by a single call"), + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::IdSortMode::IdAscending.to_string() - ]), - |s| types::IdSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), ) - .about("List users") - } - - pub fn cli_utilization_view() -> clap::Command { - clap::Command::new("").about("Fetch resource utilization for user's current silo") + .about("Remove prefix from bgp peer allowed import list") } - pub fn cli_vpc_firewall_rules_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_community_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) .required(true) - .help("Name or ID of the VPC"), + .help("An address identifying a configured bgp peer."), ) - .about("List firewall rules") + .about("List communities assigned to a bgp peer") } - pub fn cli_vpc_firewall_rules_update() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_community_add() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + clap::Arg::new("community") + .long("community") + .value_parser(clap::value_parser!(u32)) + .required_unless_present("json-body") + .help("The community to add or remove"), ) .arg( - clap::Arg::new("vpc") - .long("vpc") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the VPC"), + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("json-body") - .long("json-body") - .value_name("JSON-FILE") - .required(true) - .value_parser(clap::value_parser!(std::path::PathBuf)) - .help("Path to a file that contains the full json body."), + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The interface the peer is configured on"), + ) + .arg( + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("An address identifying the target bgp peer"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), ) .arg( clap::Arg::new("json-body-template") @@ -5628,115 +5952,99 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Replace firewall rules") - .long_about( - "The maximum number of rules per VPC is 1024.\n\nTargets are used to specify the \ - set of instances to which a firewall rule applies. You can target instances \ - directly by name, or specify a VPC, VPC subnet, IP, or IP subnet, which will \ - apply the rule to traffic going to all matching instances. Targets are additive: \ - the rule applies to instances matching ANY target. The maximum number of targets \ - is 256.\n\nFilters reduce the scope of a firewall rule. Without filters, the \ - rule applies to all packets to the targets (or from the targets, if it's an \ - outbound rule). With multiple filters, the rule applies only to packets matching \ - ALL filters. The maximum number of each type of filter is 256.", - ) + .about("Add community to bgp peer") } - pub fn cli_vpc_router_route_list() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_community_remove() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) - .required(false) - .help("Maximum number of items returned by a single call"), + clap::Arg::new("community") + .long("community") + .value_parser(clap::value_parser!(u32)) + .required_unless_present("json-body") + .help("The community to add or remove"), ) .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("router") - .long("router") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the router"), + clap::Arg::new("interface") + .long("interface") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The interface the peer is configured on"), ) .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::NameOrIdSortMode::NameAscending.to_string(), - types::NameOrIdSortMode::NameDescending.to_string(), - types::NameOrIdSortMode::IdAscending.to_string(), - ]), - |s| types::NameOrIdSortMode::try_from(s).unwrap(), - )) - .required(false), + clap::Arg::new("peer-address") + .long("peer-address") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("An address identifying the target bgp peer"), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") .required(false) - .help( - "Name or ID of the VPC, only required if `router` is provided as a `Name`", - ), + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), ) - .about("List routes") - .long_about("List the routes associated with a router in a particular VPC.") + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Remove community from bgp peer") } - pub fn cli_vpc_router_route_create() -> clap::Command { + pub fn cli_networking_switch_port_configuration_bgp_peer_remove() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required_unless_present("json-body"), - ) - .arg( - clap::Arg::new("name") - .long("name") - .value_parser(clap::value_parser!(types::Name)) - .required_unless_present("json-body"), + clap::Arg::new("addr") + .long("addr") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("The address of the host to peer with."), ) .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("bgp-config") + .long("bgp-config") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) + .required_unless_present("json-body") .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", + "The global BGP configuration used for establishing a session with this \ + peer.", ), ) .arg( - clap::Arg::new("router") - .long("router") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the router"), + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) + clap::Arg::new("interface-name") + .long("interface-name") + .value_parser(clap::value_parser!(String)) + .required_unless_present("json-body") .help( - "Name or ID of the VPC, only required if `router` is provided as a `Name`", + "The name of the interface to peer on. This is relative to the port \ + configuration this BGP peer configuration is a part of. For example this \ + value could be phy0 to refer to a primary physical interface. Or it \ + could be vlan47 to refer to a VLAN interface.", ), ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(true) + .required(false) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -5746,97 +6054,152 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Create route") + .about("Remove bgp peer from an interface configuration") } - pub fn cli_vpc_router_route_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_geometry_view() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) + .about("Get switch port geometry for a provided switch port configuration") + } + + pub fn cli_networking_switch_port_configuration_geometry_set() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("route") - .long("route") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the route"), + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("router") - .long("router") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the router"), + clap::Arg::new("geometry") + .long("geometry") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SwitchPortGeometry::Qsfp28x1.to_string(), + types::SwitchPortGeometry::Qsfp28x2.to_string(), + types::SwitchPortGeometry::Sfp28x4.to_string(), + ]), + |s| types::SwitchPortGeometry::try_from(s).unwrap(), + )) + .required_unless_present("json-body") + .help("Link geometry for the switch port."), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") .required(false) - .help( - "Name or ID of the VPC, only required if `router` is provided as a `Name`", - ), + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), ) - .about("Fetch route") + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Set switch port geometry for a provided switch port configuration") } - pub fn cli_vpc_router_route_update() -> clap::Command { + pub fn cli_networking_switch_port_configuration_link_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required(false), - ) - .arg( - clap::Arg::new("name") - .long("name") - .value_parser(clap::value_parser!(types::Name)) - .required(false), + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) + .about("List links for a provided switch port configuration") + } + + pub fn cli_networking_switch_port_configuration_link_create() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + clap::Arg::new("autoneg") + .long("autoneg") + .value_parser(clap::value_parser!(bool)) + .required_unless_present("json-body") + .help("Whether or not to set autonegotiation"), ) .arg( - clap::Arg::new("route") - .long("route") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the route"), + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("router") - .long("router") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("Name or ID of the router"), + clap::Arg::new("fec") + .long("fec") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::LinkFec::Firecode.to_string(), + types::LinkFec::None.to_string(), + types::LinkFec::Rs.to_string(), + ]), + |s| types::LinkFec::try_from(s).unwrap(), + )) + .required_unless_present("json-body") + .help("The forward error correction mode of the link."), ) .arg( - clap::Arg::new("vpc") - .long("vpc") + clap::Arg::new("lldp-config") + .long("lldp-config") .value_parser(clap::value_parser!(types::NameOrId)) .required(false) .help( - "Name or ID of the VPC, only required if `router` is provided as a `Name`", + "The optional link-layer discovery protocol (LLDP) configuration for the \ + link.", ), ) + .arg( + clap::Arg::new("mtu") + .long("mtu") + .value_parser(clap::value_parser!(u16)) + .required_unless_present("json-body") + .help("Maximum transmission unit for the link."), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("Name of link"), + ) + .arg( + clap::Arg::new("speed") + .long("speed") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::LinkSpeed::Speed0G.to_string(), + types::LinkSpeed::Speed1G.to_string(), + types::LinkSpeed::Speed10G.to_string(), + types::LinkSpeed::Speed25G.to_string(), + types::LinkSpeed::Speed40G.to_string(), + types::LinkSpeed::Speed50G.to_string(), + types::LinkSpeed::Speed100G.to_string(), + types::LinkSpeed::Speed200G.to_string(), + types::LinkSpeed::Speed400G.to_string(), + ]), + |s| types::LinkSpeed::try_from(s).unwrap(), + )) + .required_unless_present("json-body") + .help("The speed of the link."), + ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(true) + .required(false) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -5846,116 +6209,105 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Update route") + .about("Create a link for a provided switch port configuration") } - pub fn cli_vpc_router_route_delete() -> clap::Command { + pub fn cli_networking_switch_port_configuration_link_view() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("route") - .long("route") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("link") + .long("link") + .value_parser(clap::value_parser!(types::Name)) .required(true) - .help("Name or ID of the route"), + .help("Link name"), ) + .about("View a link for a provided switch port configuration") + } + + pub fn cli_networking_switch_port_configuration_link_delete() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("router") - .long("router") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("Name or ID of the router"), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the VPC, only required if `router` is provided as a `Name`", - ), + clap::Arg::new("link") + .long("link") + .value_parser(clap::value_parser!(types::Name)) + .required(true) + .help("Link name"), ) - .about("Delete route") + .about("Delete a link for a provided switch port configuration") } - pub fn cli_vpc_router_list() -> clap::Command { + pub fn cli_networking_switch_port_configuration_route_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("limit") - .long("limit") - .value_parser(clap::value_parser!(std::num::NonZeroU32)) - .required(false) - .help("Maximum number of items returned by a single call"), + clap::Arg::new("configuration") + .long("configuration") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) + .about("List routes assigned to a provided interface configuration") + } + + pub fn cli_networking_switch_port_configuration_route_add() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), - ) - .arg( - clap::Arg::new("sort-by") - .long("sort-by") - .value_parser(clap::builder::TypedValueParser::map( - clap::builder::PossibleValuesParser::new([ - types::NameOrIdSortMode::NameAscending.to_string(), - types::NameOrIdSortMode::NameDescending.to_string(), - types::NameOrIdSortMode::IdAscending.to_string(), - ]), - |s| types::NameOrIdSortMode::try_from(s).unwrap(), - )) - .required(false), + .required(true) + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the VPC"), + clap::Arg::new("dst") + .long("dst") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The route destination."), ) - .about("List routers") - } - - pub fn cli_vpc_router_create() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required_unless_present("json-body"), + clap::Arg::new("gw") + .long("gw") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("The route gateway."), ) .arg( - clap::Arg::new("name") - .long("name") + clap::Arg::new("interface") + .long("interface") .value_parser(clap::value_parser!(types::Name)) - .required_unless_present("json-body"), + .required_unless_present("json-body") + .help("The interface to configure the route on"), ) .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("rib-priority") + .long("rib-priority") + .value_parser(clap::value_parser!(u8)) .required(false) .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", + "Local preference for route. Higher preference indicates precedence \ + within and across protocols.", ), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the VPC"), + clap::Arg::new("vid") + .long("vid") + .value_parser(clap::value_parser!(u16)) + .required(false) + .help("VLAN id the gateway is reachable over."), ) .arg( clap::Arg::new("json-body") @@ -5971,73 +6323,55 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Create VPC router") + .about("Add route to an interface configuration") } - pub fn cli_vpc_router_view() -> clap::Command { + pub fn cli_networking_switch_port_configuration_route_remove() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), - ) - .arg( - clap::Arg::new("router") - .long("router") + clap::Arg::new("configuration") + .long("configuration") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the router"), + .help("A name or id to use when selecting a switch port configuration."), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("Name or ID of the VPC"), + clap::Arg::new("dst") + .long("dst") + .value_parser(clap::value_parser!(types::IpNet)) + .required_unless_present("json-body") + .help("The route destination."), ) - .about("Fetch router") - } - - pub fn cli_vpc_router_update() -> clap::Command { - clap::Command::new("") .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required(false), + clap::Arg::new("gw") + .long("gw") + .value_parser(clap::value_parser!(std::net::IpAddr)) + .required_unless_present("json-body") + .help("The route gateway."), ) .arg( - clap::Arg::new("name") - .long("name") + clap::Arg::new("interface") + .long("interface") .value_parser(clap::value_parser!(types::Name)) - .required(false), + .required_unless_present("json-body") + .help("The interface to configure the route on"), ) .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("rib-priority") + .long("rib-priority") + .value_parser(clap::value_parser!(u8)) .required(false) .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", + "Local preference for route. Higher preference indicates precedence \ + within and across protocols.", ), ) .arg( - clap::Arg::new("router") - .long("router") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the router"), - ) - .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("vid") + .long("vid") + .value_parser(clap::value_parser!(u16)) .required(false) - .help("Name or ID of the VPC"), + .help("VLAN id the gateway is reachable over."), ) .arg( clap::Arg::new("json-body") @@ -6053,38 +6387,57 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Update router") + .about("Remove route from an interface configuration") } - pub fn cli_vpc_router_delete() -> clap::Command { + pub fn cli_system_policy_view() -> clap::Command { + clap::Command::new("").about("Fetch top-level IAM policy") + } + + pub fn cli_system_policy_update() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(true) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), ) .arg( - clap::Arg::new("router") - .long("router") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the router"), + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), ) + .about("Update top-level IAM policy") + } + + pub fn cli_role_list() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) .required(false) - .help("Name or ID of the VPC"), + .help("Maximum number of items returned by a single call"), ) - .about("Delete router") + .about("List built-in roles") } - pub fn cli_vpc_subnet_list() -> clap::Command { + pub fn cli_role_view() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("role-name") + .long("role-name") + .value_parser(clap::value_parser!(String)) + .required(true) + .help("The built-in role's unique name."), + ) + .about("Fetch built-in role") + } + + pub fn cli_system_quotas_list() -> clap::Command { clap::Command::new("") .arg( clap::Arg::new("limit") @@ -6094,13 +6447,27 @@ impl Cli { .help("Maximum number of items returned by a single call"), ) .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::IdSortMode::IdAscending.to_string() + ]), + |s| types::IdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .about("Lists resource quotas for all silos") + } + + pub fn cli_silo_list() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + .help("Maximum number of items returned by a single call"), ) .arg( clap::Arg::new("sort-by") @@ -6115,28 +6482,24 @@ impl Cli { )) .required(false), ) - .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the VPC"), - ) - .about("List subnets") + .about("List silos") + .long_about("Lists silos that are discoverable based on the current permissions.") } - pub fn cli_vpc_subnet_create() -> clap::Command { + pub fn cli_silo_create() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("custom-router") - .long("custom-router") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("admin-group-name") + .long("admin-group-name") + .value_parser(clap::value_parser!(String)) .required(false) .help( - "An optional router, used to direct packets sent from hosts in this \ - subnet to any destination address.\n\nCustom routers apply in addition \ - to the VPC-wide *system* router, and have higher priority than the \ - system router for an otherwise equal-prefix-length match.", + "If set, this group will be created during Silo creation and granted the \ + \"Silo Admin\" role. Identity providers can assert that users belong to \ + this group and those users can log in and further initialize the \ + Silo.\n\nNote that if configuring a SAML based identity provider, \ + group_attribute_name must be set for users to be considered part of a \ + group. See `SamlIdentityProviderCreate` for more information.", ), ) .arg( @@ -6146,27 +6509,22 @@ impl Cli { .required_unless_present("json-body"), ) .arg( - clap::Arg::new("ipv4-block") - .long("ipv4-block") - .value_parser(clap::value_parser!(types::Ipv4Net)) - .required_unless_present("json-body") - .help( - "The IPv4 address range for this subnet.\n\nIt must be allocated from an \ - RFC 1918 private address range, and must not overlap with any other \ - existing subnet in the VPC.", - ), + clap::Arg::new("discoverable") + .long("discoverable") + .value_parser(clap::value_parser!(bool)) + .required_unless_present("json-body"), ) .arg( - clap::Arg::new("ipv6-block") - .long("ipv6-block") - .value_parser(clap::value_parser!(types::Ipv6Net)) - .required(false) - .help( - "The IPv6 address range for this subnet.\n\nIt must be allocated from the \ - RFC 4193 Unique Local Address range, with the prefix equal to the parent \ - VPC's prefix. A random `/64` block will be assigned if one is not \ - provided. It must not overlap with any existing subnet in the VPC.", - ), + clap::Arg::new("identity-mode") + .long("identity-mode") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::SiloIdentityMode::SamlJit.to_string(), + types::SiloIdentityMode::LocalOnly.to_string(), + ]), + |s| types::SiloIdentityMode::try_from(s).unwrap(), + )) + .required_unless_present("json-body"), ) .arg( clap::Arg::new("name") @@ -6174,27 +6532,11 @@ impl Cli { .value_parser(clap::value_parser!(types::Name)) .required_unless_present("json-body"), ) - .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), - ) - .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the VPC"), - ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(false) + .required(true) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -6204,89 +6546,98 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Create subnet") + .about("Create a silo") } - pub fn cli_vpc_subnet_view() -> clap::Command { + pub fn cli_silo_view() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), - ) - .arg( - clap::Arg::new("subnet") - .long("subnet") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the subnet"), + .help("Name or ID of the silo"), ) + .about("Fetch silo") + .long_about("Fetch silo by name or ID.") + } + + pub fn cli_silo_delete() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("vpc") - .long("vpc") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("Name or ID of the VPC"), + .required(true) + .help("Name or ID of the silo"), ) - .about("Fetch subnet") + .about("Delete a silo") + .long_about("Delete a silo by name or ID.") } - pub fn cli_vpc_subnet_update() -> clap::Command { + pub fn cli_silo_ip_pool_list() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("custom-router") - .long("custom-router") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) .required(false) - .help( - "An optional router, used to direct packets sent from hosts in this \ - subnet to any destination address.", - ), + .help("Maximum number of items returned by a single call"), ) .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required(false), + clap::Arg::new("silo") + .long("silo") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the silo"), ) .arg( - clap::Arg::new("name") - .long("name") - .value_parser(clap::value_parser!(types::Name)) + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) .required(false), ) - .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + .about("List IP pools linked to silo") + .long_about( + "Linked IP pools are available to users in the specified silo. A silo can have at \ + most one default pool. IPs are allocated from the default pool when users ask \ + for one without specifying a pool.", ) + } + + pub fn cli_silo_policy_view() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("subnet") - .long("subnet") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the subnet"), + .help("Name or ID of the silo"), ) + .about("Fetch silo IAM policy") + } + + pub fn cli_silo_policy_update() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("vpc") - .long("vpc") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("Name or ID of the VPC"), + .required(true) + .help("Name or ID of the silo"), ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(false) + .required(true) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -6296,38 +6647,72 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Update subnet") + .about("Update silo IAM policy") } - pub fn cli_vpc_subnet_delete() -> clap::Command { + pub fn cli_silo_quotas_view() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the silo"), + ) + .about("Fetch resource quotas for silo") + } + + pub fn cli_silo_quotas_update() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("cpus") + .long("cpus") + .value_parser(clap::value_parser!(i64)) + .required(false) + .help("The amount of virtual CPUs available for running instances in the Silo"), + ) + .arg( + clap::Arg::new("memory") + .long("memory") + .value_parser(clap::value_parser!(types::ByteCount)) .required(false) .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", + "The amount of RAM (in bytes) available for running instances in the Silo", ), ) .arg( - clap::Arg::new("subnet") - .long("subnet") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the subnet"), + .help("Name or ID of the silo"), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) + clap::Arg::new("storage") + .long("storage") + .value_parser(clap::value_parser!(types::ByteCount)) .required(false) - .help("Name or ID of the VPC"), + .help("The amount of storage (in bytes) available for disks or snapshots"), ) - .about("Delete subnet") + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Update resource quotas for silo") + .long_about("If a quota value is not specified, it will remain unchanged.") } - pub fn cli_vpc_subnet_list_network_interfaces() -> clap::Command { + pub fn cli_silo_user_list() -> clap::Command { clap::Command::new("") .arg( clap::Arg::new("limit") @@ -6337,45 +6722,46 @@ impl Cli { .help("Maximum number of items returned by a single call"), ) .arg( - clap::Arg::new("project") - .long("project") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `vpc` is provided as a `Name`", - ), + .required(true) + .help("Name or ID of the silo"), ) .arg( clap::Arg::new("sort-by") .long("sort-by") .value_parser(clap::builder::TypedValueParser::map( clap::builder::PossibleValuesParser::new([ - types::NameOrIdSortMode::NameAscending.to_string(), - types::NameOrIdSortMode::NameDescending.to_string(), - types::NameOrIdSortMode::IdAscending.to_string(), + types::IdSortMode::IdAscending.to_string() ]), - |s| types::NameOrIdSortMode::try_from(s).unwrap(), + |s| types::IdSortMode::try_from(s).unwrap(), )) .required(false), ) + .about("List built-in (system) users in silo") + } + + pub fn cli_silo_user_view() -> clap::Command { + clap::Command::new("") .arg( - clap::Arg::new("subnet") - .long("subnet") + clap::Arg::new("silo") + .long("silo") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the subnet"), + .help("Name or ID of the silo"), ) .arg( - clap::Arg::new("vpc") - .long("vpc") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(false) - .help("Name or ID of the VPC"), + clap::Arg::new("user-id") + .long("user-id") + .value_parser(clap::value_parser!(uuid::Uuid)) + .required(true) + .help("The user's internal ID"), ) - .about("List network interfaces") + .about("Fetch built-in (system) user") } - pub fn cli_vpc_list() -> clap::Command { + pub fn cli_user_builtin_list() -> clap::Command { clap::Command::new("") .arg( clap::Arg::new("limit") @@ -6384,73 +6770,184 @@ impl Cli { .required(false) .help("Maximum number of items returned by a single call"), ) - .arg( - clap::Arg::new("project") - .long("project") - .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the project"), - ) .arg( clap::Arg::new("sort-by") .long("sort-by") .value_parser(clap::builder::TypedValueParser::map( clap::builder::PossibleValuesParser::new([ - types::NameOrIdSortMode::NameAscending.to_string(), - types::NameOrIdSortMode::NameDescending.to_string(), - types::NameOrIdSortMode::IdAscending.to_string(), + types::NameSortMode::NameAscending.to_string(), ]), - |s| types::NameOrIdSortMode::try_from(s).unwrap(), + |s| types::NameSortMode::try_from(s).unwrap(), )) .required(false), ) - .about("List VPCs") + .about("List built-in users") } - pub fn cli_vpc_create() -> clap::Command { + pub fn cli_user_builtin_view() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required_unless_present("json-body"), + clap::Arg::new("user") + .long("user") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true), ) - .arg( - clap::Arg::new("dns-name") - .long("dns-name") - .value_parser(clap::value_parser!(types::Name)) - .required_unless_present("json-body"), + .about("Fetch built-in user") + } + + pub fn cli_silo_utilization_list() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), ) .arg( - clap::Arg::new("ipv6-prefix") - .long("ipv6-prefix") - .value_parser(clap::value_parser!(types::Ipv6Net)) + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .about("List current utilization state for all silos") + } + + pub fn cli_silo_utilization_view() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("silo") + .long("silo") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the silo"), + ) + .about("Fetch current utilization for given silo") + } + + pub fn cli_timeseries_query() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("query") + .long("query") + .value_parser(clap::value_parser!(String)) + .required_unless_present("json-body") + .help("A timeseries query string, written in the Oximeter query language."), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Run timeseries query") + .long_about("Queries are written in OxQL.") + } + + pub fn cli_timeseries_schema_list() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .about("List timeseries schemas") + } + + pub fn cli_user_list() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("group") + .long("group") + .value_parser(clap::value_parser!(uuid::Uuid)) + .required(false), + ) + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::IdSortMode::IdAscending.to_string() + ]), + |s| types::IdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .about("List users") + } + + pub fn cli_utilization_view() -> clap::Command { + clap::Command::new("").about("Fetch resource utilization for user's current silo") + } + + pub fn cli_vpc_firewall_rules_view() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) .required(false) .help( - "The IPv6 prefix for this VPC\n\nAll IPv6 subnets created from this VPC \ - must be taken from this range, which should be a Unique Local Address in \ - the range `fd00::/48`. The default VPC Subnet will have the first `/64` \ - range from this prefix.", + "Name or ID of the project, only required if `vpc` is provided as a `Name`", ), ) .arg( - clap::Arg::new("name") - .long("name") - .value_parser(clap::value_parser!(types::Name)) - .required_unless_present("json-body"), + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), ) + .about("List firewall rules") + } + + pub fn cli_vpc_firewall_rules_update() -> clap::Command { + clap::Command::new("") .arg( clap::Arg::new("project") .long("project") .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the project"), + .help("Name or ID of the VPC"), ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(false) + .required(true) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -6460,67 +6957,115 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Create VPC") + .about("Replace firewall rules") + .long_about( + "The maximum number of rules per VPC is 1024.\n\nTargets are used to specify the \ + set of instances to which a firewall rule applies. You can target instances \ + directly by name, or specify a VPC, VPC subnet, IP, or IP subnet, which will \ + apply the rule to traffic going to all matching instances. Targets are additive: \ + the rule applies to instances matching ANY target. The maximum number of targets \ + is 256.\n\nFilters reduce the scope of a firewall rule. Without filters, the \ + rule applies to all packets to the targets (or from the targets, if it's an \ + outbound rule). With multiple filters, the rule applies only to packets matching \ + ALL filters. The maximum number of each type of filter is 256.", + ) } - pub fn cli_vpc_view() -> clap::Command { + pub fn cli_vpc_router_route_list() -> clap::Command { clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) .arg( clap::Arg::new("project") .long("project") .value_parser(clap::value_parser!(types::NameOrId)) .required(false) - .help("Name or ID of the project"), + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the router"), + ) + .arg( + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) + .required(false), ) .arg( clap::Arg::new("vpc") .long("vpc") .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the VPC"), + .required(false) + .help( + "Name or ID of the VPC, only required if `router` is provided as a `Name`", + ), ) - .about("Fetch VPC") + .about("List routes") + .long_about("List the routes associated with a router in a particular VPC.") } - pub fn cli_vpc_update() -> clap::Command { + pub fn cli_vpc_router_route_create() -> clap::Command { clap::Command::new("") .arg( clap::Arg::new("description") .long("description") .value_parser(clap::value_parser!(String)) - .required(false), - ) - .arg( - clap::Arg::new("dns-name") - .long("dns-name") - .value_parser(clap::value_parser!(types::Name)) - .required(false), + .required_unless_present("json-body"), ) .arg( clap::Arg::new("name") .long("name") .value_parser(clap::value_parser!(types::Name)) - .required(false), + .required_unless_present("json-body"), ) .arg( clap::Arg::new("project") .long("project") .value_parser(clap::value_parser!(types::NameOrId)) .required(false) - .help("Name or ID of the project"), + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the router"), ) .arg( clap::Arg::new("vpc") .long("vpc") .value_parser(clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the VPC"), + .required(false) + .help( + "Name or ID of the VPC, only required if `router` is provided as a `Name`", + ), ) .arg( clap::Arg::new("json-body") .long("json-body") .value_name("JSON-FILE") - .required(false) + .required(true) .value_parser(clap::value_parser!(std::path::PathBuf)) .help("Path to a file that contains the full json body."), ) @@ -6530,436 +7075,2591 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Update a VPC") + .about("Create route") } - pub fn cli_vpc_delete() -> clap::Command { + pub fn cli_vpc_router_route_view() -> clap::Command { clap::Command::new("") .arg( clap::Arg::new("project") .long("project") .value_parser(clap::value_parser!(types::NameOrId)) .required(false) - .help("Name or ID of the project"), + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), ) .arg( - clap::Arg::new("vpc") - .long("vpc") + clap::Arg::new("route") + .long("route") .value_parser(clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the VPC"), + .help("Name or ID of the route"), ) - .about("Delete VPC") - } + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the router"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the VPC, only required if `router` is provided as a `Name`", + ), + ) + .about("Fetch route") + } + + pub fn cli_vpc_router_route_update() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required(false), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required(false), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("route") + .long("route") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the route"), + ) + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the router"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the VPC, only required if `router` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(true) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Update route") + } + + pub fn cli_vpc_router_route_delete() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("route") + .long("route") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the route"), + ) + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the router"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the VPC, only required if `router` is provided as a `Name`", + ), + ) + .about("Delete route") + } + + pub fn cli_vpc_router_list() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), + ) + .about("List routers") + } + + pub fn cli_vpc_router_create() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Create VPC router") + } + + pub fn cli_vpc_router_view() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the router"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the VPC"), + ) + .about("Fetch router") + } + + pub fn cli_vpc_router_update() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required(false), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required(false), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the router"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the VPC"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Update router") + } + + pub fn cli_vpc_router_delete() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("router") + .long("router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the router"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the VPC"), + ) + .about("Delete router") + } + + pub fn cli_vpc_subnet_list() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), + ) + .about("List subnets") + } + + pub fn cli_vpc_subnet_create() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("custom-router") + .long("custom-router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "An optional router, used to direct packets sent from hosts in this \ + subnet to any destination address.\n\nCustom routers apply in addition \ + to the VPC-wide *system* router, and have higher priority than the \ + system router for an otherwise equal-prefix-length match.", + ), + ) + .arg( + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("ipv4-block") + .long("ipv4-block") + .value_parser(clap::value_parser!(types::Ipv4Net)) + .required_unless_present("json-body") + .help( + "The IPv4 address range for this subnet.\n\nIt must be allocated from an \ + RFC 1918 private address range, and must not overlap with any other \ + existing subnet in the VPC.", + ), + ) + .arg( + clap::Arg::new("ipv6-block") + .long("ipv6-block") + .value_parser(clap::value_parser!(types::Ipv6Net)) + .required(false) + .help( + "The IPv6 address range for this subnet.\n\nIt must be allocated from the \ + RFC 4193 Unique Local Address range, with the prefix equal to the parent \ + VPC's prefix. A random `/64` block will be assigned if one is not \ + provided. It must not overlap with any existing subnet in the VPC.", + ), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Create subnet") + } + + pub fn cli_vpc_subnet_view() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("subnet") + .long("subnet") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the subnet"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the VPC"), + ) + .about("Fetch subnet") + } + + pub fn cli_vpc_subnet_update() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("custom-router") + .long("custom-router") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "An optional router, used to direct packets sent from hosts in this \ + subnet to any destination address.", + ), + ) + .arg( + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required(false), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required(false), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("subnet") + .long("subnet") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the subnet"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the VPC"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Update subnet") + } + + pub fn cli_vpc_subnet_delete() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("subnet") + .long("subnet") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the subnet"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the VPC"), + ) + .about("Delete subnet") + } + + pub fn cli_vpc_subnet_list_network_interfaces() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `vpc` is provided as a `Name`", + ), + ) + .arg( + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .arg( + clap::Arg::new("subnet") + .long("subnet") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the subnet"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the VPC"), + ) + .about("List network interfaces") + } + + pub fn cli_vpc_list() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("limit") + .long("limit") + .value_parser(clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the project"), + ) + .arg( + clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(clap::builder::TypedValueParser::map( + clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .about("List VPCs") + } + + pub fn cli_vpc_create() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("dns-name") + .long("dns-name") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("ipv6-prefix") + .long("ipv6-prefix") + .value_parser(clap::value_parser!(types::Ipv6Net)) + .required(false) + .help( + "The IPv6 prefix for this VPC\n\nAll IPv6 subnets created from this VPC \ + must be taken from this range, which should be a Unique Local Address in \ + the range `fd00::/48`. The default VPC Subnet will have the first `/64` \ + range from this prefix.", + ), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the project"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Create VPC") + } + + pub fn cli_vpc_view() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the project"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), + ) + .about("Fetch VPC") + } + + pub fn cli_vpc_update() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required(false), + ) + .arg( + clap::Arg::new("dns-name") + .long("dns-name") + .value_parser(clap::value_parser!(types::Name)) + .required(false), + ) + .arg( + clap::Arg::new("name") + .long("name") + .value_parser(clap::value_parser!(types::Name)) + .required(false), + ) + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the project"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), + ) + .arg( + clap::Arg::new("json-body") + .long("json-body") + .value_name("JSON-FILE") + .required(false) + .value_parser(clap::value_parser!(std::path::PathBuf)) + .help("Path to a file that contains the full json body."), + ) + .arg( + clap::Arg::new("json-body-template") + .long("json-body-template") + .action(clap::ArgAction::SetTrue) + .help("XXX"), + ) + .about("Update a VPC") + } + + pub fn cli_vpc_delete() -> clap::Command { + clap::Command::new("") + .arg( + clap::Arg::new("project") + .long("project") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the project"), + ) + .arg( + clap::Arg::new("vpc") + .long("vpc") + .value_parser(clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the VPC"), + ) + .about("Delete VPC") + } + + pub async fn execute(&self, cmd: CliCommand, matches: &clap::ArgMatches) -> anyhow::Result<()> { + match cmd { + CliCommand::DeviceAuthRequest => self.execute_device_auth_request(matches).await, + CliCommand::DeviceAuthConfirm => self.execute_device_auth_confirm(matches).await, + CliCommand::DeviceAccessToken => self.execute_device_access_token(matches).await, + CliCommand::ProbeList => self.execute_probe_list(matches).await, + CliCommand::ProbeCreate => self.execute_probe_create(matches).await, + CliCommand::ProbeView => self.execute_probe_view(matches).await, + CliCommand::ProbeDelete => self.execute_probe_delete(matches).await, + CliCommand::LoginSaml => self.execute_login_saml(matches).await, + CliCommand::CertificateList => self.execute_certificate_list(matches).await, + CliCommand::CertificateCreate => self.execute_certificate_create(matches).await, + CliCommand::CertificateView => self.execute_certificate_view(matches).await, + CliCommand::CertificateDelete => self.execute_certificate_delete(matches).await, + CliCommand::DiskList => self.execute_disk_list(matches).await, + CliCommand::DiskCreate => self.execute_disk_create(matches).await, + CliCommand::DiskView => self.execute_disk_view(matches).await, + CliCommand::DiskDelete => self.execute_disk_delete(matches).await, + CliCommand::DiskBulkWriteImport => self.execute_disk_bulk_write_import(matches).await, + CliCommand::DiskBulkWriteImportStart => { + self.execute_disk_bulk_write_import_start(matches).await + } + CliCommand::DiskBulkWriteImportStop => { + self.execute_disk_bulk_write_import_stop(matches).await + } + CliCommand::DiskFinalizeImport => self.execute_disk_finalize_import(matches).await, + CliCommand::DiskMetricsList => self.execute_disk_metrics_list(matches).await, + CliCommand::FloatingIpList => self.execute_floating_ip_list(matches).await, + CliCommand::FloatingIpCreate => self.execute_floating_ip_create(matches).await, + CliCommand::FloatingIpView => self.execute_floating_ip_view(matches).await, + CliCommand::FloatingIpUpdate => self.execute_floating_ip_update(matches).await, + CliCommand::FloatingIpDelete => self.execute_floating_ip_delete(matches).await, + CliCommand::FloatingIpAttach => self.execute_floating_ip_attach(matches).await, + CliCommand::FloatingIpDetach => self.execute_floating_ip_detach(matches).await, + CliCommand::GroupList => self.execute_group_list(matches).await, + CliCommand::GroupView => self.execute_group_view(matches).await, + CliCommand::ImageList => self.execute_image_list(matches).await, + CliCommand::ImageCreate => self.execute_image_create(matches).await, + CliCommand::ImageView => self.execute_image_view(matches).await, + CliCommand::ImageDelete => self.execute_image_delete(matches).await, + CliCommand::ImageDemote => self.execute_image_demote(matches).await, + CliCommand::ImagePromote => self.execute_image_promote(matches).await, + CliCommand::InstanceList => self.execute_instance_list(matches).await, + CliCommand::InstanceCreate => self.execute_instance_create(matches).await, + CliCommand::InstanceView => self.execute_instance_view(matches).await, + CliCommand::InstanceUpdate => self.execute_instance_update(matches).await, + CliCommand::InstanceDelete => self.execute_instance_delete(matches).await, + CliCommand::InstanceDiskList => self.execute_instance_disk_list(matches).await, + CliCommand::InstanceDiskAttach => self.execute_instance_disk_attach(matches).await, + CliCommand::InstanceDiskDetach => self.execute_instance_disk_detach(matches).await, + CliCommand::InstanceExternalIpList => { + self.execute_instance_external_ip_list(matches).await + } + CliCommand::InstanceEphemeralIpAttach => { + self.execute_instance_ephemeral_ip_attach(matches).await + } + CliCommand::InstanceEphemeralIpDetach => { + self.execute_instance_ephemeral_ip_detach(matches).await + } + CliCommand::InstanceReboot => self.execute_instance_reboot(matches).await, + CliCommand::InstanceSerialConsole => { + self.execute_instance_serial_console(matches).await + } + CliCommand::InstanceSerialConsoleStream => { + self.execute_instance_serial_console_stream(matches).await + } + CliCommand::InstanceSshPublicKeyList => { + self.execute_instance_ssh_public_key_list(matches).await + } + CliCommand::InstanceStart => self.execute_instance_start(matches).await, + CliCommand::InstanceStop => self.execute_instance_stop(matches).await, + CliCommand::InternetGatewayIpAddressList => { + self.execute_internet_gateway_ip_address_list(matches).await + } + CliCommand::InternetGatewayIpAddressCreate => { + self.execute_internet_gateway_ip_address_create(matches) + .await + } + CliCommand::InternetGatewayIpAddressDelete => { + self.execute_internet_gateway_ip_address_delete(matches) + .await + } + CliCommand::InternetGatewayIpPoolList => { + self.execute_internet_gateway_ip_pool_list(matches).await + } + CliCommand::InternetGatewayIpPoolCreate => { + self.execute_internet_gateway_ip_pool_create(matches).await + } + CliCommand::InternetGatewayIpPoolDelete => { + self.execute_internet_gateway_ip_pool_delete(matches).await + } + CliCommand::InternetGatewayList => self.execute_internet_gateway_list(matches).await, + CliCommand::InternetGatewayCreate => { + self.execute_internet_gateway_create(matches).await + } + CliCommand::InternetGatewayView => self.execute_internet_gateway_view(matches).await, + CliCommand::InternetGatewayDelete => { + self.execute_internet_gateway_delete(matches).await + } + CliCommand::ProjectIpPoolList => self.execute_project_ip_pool_list(matches).await, + CliCommand::ProjectIpPoolView => self.execute_project_ip_pool_view(matches).await, + CliCommand::LoginLocal => self.execute_login_local(matches).await, + CliCommand::Logout => self.execute_logout(matches).await, + CliCommand::CurrentUserView => self.execute_current_user_view(matches).await, + CliCommand::CurrentUserGroups => self.execute_current_user_groups(matches).await, + CliCommand::CurrentUserSshKeyList => { + self.execute_current_user_ssh_key_list(matches).await + } + CliCommand::CurrentUserSshKeyCreate => { + self.execute_current_user_ssh_key_create(matches).await + } + CliCommand::CurrentUserSshKeyView => { + self.execute_current_user_ssh_key_view(matches).await + } + CliCommand::CurrentUserSshKeyDelete => { + self.execute_current_user_ssh_key_delete(matches).await + } + CliCommand::SiloMetric => self.execute_silo_metric(matches).await, + CliCommand::InstanceNetworkInterfaceList => { + self.execute_instance_network_interface_list(matches).await + } + CliCommand::InstanceNetworkInterfaceCreate => { + self.execute_instance_network_interface_create(matches) + .await + } + CliCommand::InstanceNetworkInterfaceView => { + self.execute_instance_network_interface_view(matches).await + } + CliCommand::InstanceNetworkInterfaceUpdate => { + self.execute_instance_network_interface_update(matches) + .await + } + CliCommand::InstanceNetworkInterfaceDelete => { + self.execute_instance_network_interface_delete(matches) + .await + } + CliCommand::Ping => self.execute_ping(matches).await, + CliCommand::PolicyView => self.execute_policy_view(matches).await, + CliCommand::PolicyUpdate => self.execute_policy_update(matches).await, + CliCommand::ProjectList => self.execute_project_list(matches).await, + CliCommand::ProjectCreate => self.execute_project_create(matches).await, + CliCommand::ProjectView => self.execute_project_view(matches).await, + CliCommand::ProjectUpdate => self.execute_project_update(matches).await, + CliCommand::ProjectDelete => self.execute_project_delete(matches).await, + CliCommand::ProjectPolicyView => self.execute_project_policy_view(matches).await, + CliCommand::ProjectPolicyUpdate => self.execute_project_policy_update(matches).await, + CliCommand::SnapshotList => self.execute_snapshot_list(matches).await, + CliCommand::SnapshotCreate => self.execute_snapshot_create(matches).await, + CliCommand::SnapshotView => self.execute_snapshot_view(matches).await, + CliCommand::SnapshotDelete => self.execute_snapshot_delete(matches).await, + CliCommand::PhysicalDiskList => self.execute_physical_disk_list(matches).await, + CliCommand::PhysicalDiskView => self.execute_physical_disk_view(matches).await, + CliCommand::RackList => self.execute_rack_list(matches).await, + CliCommand::RackView => self.execute_rack_view(matches).await, + CliCommand::NetworkingSwitchPortActiveConfigurationView => { + self.execute_networking_switch_port_active_configuration_view(matches) + .await + } + CliCommand::NetworkingSwitchPortActiveConfigurationSet => { + self.execute_networking_switch_port_active_configuration_set(matches) + .await + } + CliCommand::NetworkingSwitchPortActiveConfigurationClear => { + self.execute_networking_switch_port_active_configuration_clear(matches) + .await + } + CliCommand::SledList => self.execute_sled_list(matches).await, + CliCommand::SledAdd => self.execute_sled_add(matches).await, + CliCommand::SledView => self.execute_sled_view(matches).await, + CliCommand::SledPhysicalDiskList => self.execute_sled_physical_disk_list(matches).await, + CliCommand::SledInstanceList => self.execute_sled_instance_list(matches).await, + CliCommand::SledSetProvisionPolicy => { + self.execute_sled_set_provision_policy(matches).await + } + CliCommand::SledListUninitialized => { + self.execute_sled_list_uninitialized(matches).await + } + CliCommand::NetworkingSwitchPortList => { + self.execute_networking_switch_port_list(matches).await + } + CliCommand::NetworkingSwitchPortApplySettings => { + self.execute_networking_switch_port_apply_settings(matches) + .await + } + CliCommand::NetworkingSwitchPortClearSettings => { + self.execute_networking_switch_port_clear_settings(matches) + .await + } + CliCommand::NetworkingSwitchPortStatus => { + self.execute_networking_switch_port_status(matches).await + } + CliCommand::SwitchList => self.execute_switch_list(matches).await, + CliCommand::SwitchView => self.execute_switch_view(matches).await, + CliCommand::SiloIdentityProviderList => { + self.execute_silo_identity_provider_list(matches).await + } + CliCommand::LocalIdpUserCreate => self.execute_local_idp_user_create(matches).await, + CliCommand::LocalIdpUserDelete => self.execute_local_idp_user_delete(matches).await, + CliCommand::LocalIdpUserSetPassword => { + self.execute_local_idp_user_set_password(matches).await + } + CliCommand::SamlIdentityProviderCreate => { + self.execute_saml_identity_provider_create(matches).await + } + CliCommand::SamlIdentityProviderView => { + self.execute_saml_identity_provider_view(matches).await + } + CliCommand::IpPoolList => self.execute_ip_pool_list(matches).await, + CliCommand::IpPoolCreate => self.execute_ip_pool_create(matches).await, + CliCommand::IpPoolView => self.execute_ip_pool_view(matches).await, + CliCommand::IpPoolUpdate => self.execute_ip_pool_update(matches).await, + CliCommand::IpPoolDelete => self.execute_ip_pool_delete(matches).await, + CliCommand::IpPoolRangeList => self.execute_ip_pool_range_list(matches).await, + CliCommand::IpPoolRangeAdd => self.execute_ip_pool_range_add(matches).await, + CliCommand::IpPoolRangeRemove => self.execute_ip_pool_range_remove(matches).await, + CliCommand::IpPoolSiloList => self.execute_ip_pool_silo_list(matches).await, + CliCommand::IpPoolSiloLink => self.execute_ip_pool_silo_link(matches).await, + CliCommand::IpPoolSiloUpdate => self.execute_ip_pool_silo_update(matches).await, + CliCommand::IpPoolSiloUnlink => self.execute_ip_pool_silo_unlink(matches).await, + CliCommand::IpPoolUtilizationView => { + self.execute_ip_pool_utilization_view(matches).await + } + CliCommand::IpPoolServiceView => self.execute_ip_pool_service_view(matches).await, + CliCommand::IpPoolServiceRangeList => { + self.execute_ip_pool_service_range_list(matches).await + } + CliCommand::IpPoolServiceRangeAdd => { + self.execute_ip_pool_service_range_add(matches).await + } + CliCommand::IpPoolServiceRangeRemove => { + self.execute_ip_pool_service_range_remove(matches).await + } + CliCommand::SystemMetric => self.execute_system_metric(matches).await, + CliCommand::NetworkingAddressLotList => { + self.execute_networking_address_lot_list(matches).await + } + CliCommand::NetworkingAddressLotCreate => { + self.execute_networking_address_lot_create(matches).await + } + CliCommand::NetworkingAddressLotDelete => { + self.execute_networking_address_lot_delete(matches).await + } + CliCommand::NetworkingAddressLotBlockList => { + self.execute_networking_address_lot_block_list(matches) + .await + } + CliCommand::NetworkingAddressLotBlockAdd => { + self.execute_networking_address_lot_block_add(matches).await + } + CliCommand::NetworkingAddressLotBlockRemove => { + self.execute_networking_address_lot_block_remove(matches) + .await + } + CliCommand::NetworkingAllowListView => { + self.execute_networking_allow_list_view(matches).await + } + CliCommand::NetworkingAllowListUpdate => { + self.execute_networking_allow_list_update(matches).await + } + CliCommand::NetworkingBfdDisable => self.execute_networking_bfd_disable(matches).await, + CliCommand::NetworkingBfdEnable => self.execute_networking_bfd_enable(matches).await, + CliCommand::NetworkingBfdStatus => self.execute_networking_bfd_status(matches).await, + CliCommand::NetworkingBgpConfigList => { + self.execute_networking_bgp_config_list(matches).await + } + CliCommand::NetworkingBgpConfigCreate => { + self.execute_networking_bgp_config_create(matches).await + } + CliCommand::NetworkingBgpConfigDelete => { + self.execute_networking_bgp_config_delete(matches).await + } + CliCommand::NetworkingBgpAnnounceSetList => { + self.execute_networking_bgp_announce_set_list(matches).await + } + CliCommand::NetworkingBgpAnnounceSetUpdate => { + self.execute_networking_bgp_announce_set_update(matches) + .await + } + CliCommand::NetworkingBgpAnnounceSetDelete => { + self.execute_networking_bgp_announce_set_delete(matches) + .await + } + CliCommand::NetworkingBgpAnnouncementList => { + self.execute_networking_bgp_announcement_list(matches).await + } + CliCommand::NetworkingBgpExported => { + self.execute_networking_bgp_exported(matches).await + } + CliCommand::NetworkingBgpMessageHistory => { + self.execute_networking_bgp_message_history(matches).await + } + CliCommand::NetworkingBgpImportedRoutesIpv4 => { + self.execute_networking_bgp_imported_routes_ipv4(matches) + .await + } + CliCommand::NetworkingBgpStatus => self.execute_networking_bgp_status(matches).await, + CliCommand::NetworkingLoopbackAddressList => { + self.execute_networking_loopback_address_list(matches).await + } + CliCommand::NetworkingLoopbackAddressCreate => { + self.execute_networking_loopback_address_create(matches) + .await + } + CliCommand::NetworkingLoopbackAddressDelete => { + self.execute_networking_loopback_address_delete(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationList => { + self.execute_networking_switch_port_configuration_list(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationCreate => { + self.execute_networking_switch_port_configuration_create(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationView => { + self.execute_networking_switch_port_configuration_view(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationDelete => { + self.execute_networking_switch_port_configuration_delete(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationAddressList => { + self.execute_networking_switch_port_configuration_address_list(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationAddressAdd => { + self.execute_networking_switch_port_configuration_address_add(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationAddressRemove => { + self.execute_networking_switch_port_configuration_address_remove(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerList => { + self.execute_networking_switch_port_configuration_bgp_peer_list(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAdd => { + self.execute_networking_switch_port_configuration_bgp_peer_add(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportList => { + self.execute_networking_switch_port_configuration_bgp_peer_allow_export_list( + matches, + ) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd => { + self.execute_networking_switch_port_configuration_bgp_peer_allow_export_add(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove => { + self.execute_networking_switch_port_configuration_bgp_peer_allow_export_remove( + matches, + ) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportList => { + self.execute_networking_switch_port_configuration_bgp_peer_allow_import_list( + matches, + ) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd => { + self.execute_networking_switch_port_configuration_bgp_peer_allow_import_add(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove => { + self.execute_networking_switch_port_configuration_bgp_peer_allow_import_remove( + matches, + ) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityList => { + self.execute_networking_switch_port_configuration_bgp_peer_community_list(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd => { + self.execute_networking_switch_port_configuration_bgp_peer_community_add(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove => { + self.execute_networking_switch_port_configuration_bgp_peer_community_remove(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationBgpPeerRemove => { + self.execute_networking_switch_port_configuration_bgp_peer_remove(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationGeometryView => { + self.execute_networking_switch_port_configuration_geometry_view(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationGeometrySet => { + self.execute_networking_switch_port_configuration_geometry_set(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationLinkList => { + self.execute_networking_switch_port_configuration_link_list(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationLinkCreate => { + self.execute_networking_switch_port_configuration_link_create(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationLinkView => { + self.execute_networking_switch_port_configuration_link_view(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationLinkDelete => { + self.execute_networking_switch_port_configuration_link_delete(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationRouteList => { + self.execute_networking_switch_port_configuration_route_list(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationRouteAdd => { + self.execute_networking_switch_port_configuration_route_add(matches) + .await + } + CliCommand::NetworkingSwitchPortConfigurationRouteRemove => { + self.execute_networking_switch_port_configuration_route_remove(matches) + .await + } + CliCommand::SystemPolicyView => self.execute_system_policy_view(matches).await, + CliCommand::SystemPolicyUpdate => self.execute_system_policy_update(matches).await, + CliCommand::RoleList => self.execute_role_list(matches).await, + CliCommand::RoleView => self.execute_role_view(matches).await, + CliCommand::SystemQuotasList => self.execute_system_quotas_list(matches).await, + CliCommand::SiloList => self.execute_silo_list(matches).await, + CliCommand::SiloCreate => self.execute_silo_create(matches).await, + CliCommand::SiloView => self.execute_silo_view(matches).await, + CliCommand::SiloDelete => self.execute_silo_delete(matches).await, + CliCommand::SiloIpPoolList => self.execute_silo_ip_pool_list(matches).await, + CliCommand::SiloPolicyView => self.execute_silo_policy_view(matches).await, + CliCommand::SiloPolicyUpdate => self.execute_silo_policy_update(matches).await, + CliCommand::SiloQuotasView => self.execute_silo_quotas_view(matches).await, + CliCommand::SiloQuotasUpdate => self.execute_silo_quotas_update(matches).await, + CliCommand::SiloUserList => self.execute_silo_user_list(matches).await, + CliCommand::SiloUserView => self.execute_silo_user_view(matches).await, + CliCommand::UserBuiltinList => self.execute_user_builtin_list(matches).await, + CliCommand::UserBuiltinView => self.execute_user_builtin_view(matches).await, + CliCommand::SiloUtilizationList => self.execute_silo_utilization_list(matches).await, + CliCommand::SiloUtilizationView => self.execute_silo_utilization_view(matches).await, + CliCommand::TimeseriesQuery => self.execute_timeseries_query(matches).await, + CliCommand::TimeseriesSchemaList => self.execute_timeseries_schema_list(matches).await, + CliCommand::UserList => self.execute_user_list(matches).await, + CliCommand::UtilizationView => self.execute_utilization_view(matches).await, + CliCommand::VpcFirewallRulesView => self.execute_vpc_firewall_rules_view(matches).await, + CliCommand::VpcFirewallRulesUpdate => { + self.execute_vpc_firewall_rules_update(matches).await + } + CliCommand::VpcRouterRouteList => self.execute_vpc_router_route_list(matches).await, + CliCommand::VpcRouterRouteCreate => self.execute_vpc_router_route_create(matches).await, + CliCommand::VpcRouterRouteView => self.execute_vpc_router_route_view(matches).await, + CliCommand::VpcRouterRouteUpdate => self.execute_vpc_router_route_update(matches).await, + CliCommand::VpcRouterRouteDelete => self.execute_vpc_router_route_delete(matches).await, + CliCommand::VpcRouterList => self.execute_vpc_router_list(matches).await, + CliCommand::VpcRouterCreate => self.execute_vpc_router_create(matches).await, + CliCommand::VpcRouterView => self.execute_vpc_router_view(matches).await, + CliCommand::VpcRouterUpdate => self.execute_vpc_router_update(matches).await, + CliCommand::VpcRouterDelete => self.execute_vpc_router_delete(matches).await, + CliCommand::VpcSubnetList => self.execute_vpc_subnet_list(matches).await, + CliCommand::VpcSubnetCreate => self.execute_vpc_subnet_create(matches).await, + CliCommand::VpcSubnetView => self.execute_vpc_subnet_view(matches).await, + CliCommand::VpcSubnetUpdate => self.execute_vpc_subnet_update(matches).await, + CliCommand::VpcSubnetDelete => self.execute_vpc_subnet_delete(matches).await, + CliCommand::VpcSubnetListNetworkInterfaces => { + self.execute_vpc_subnet_list_network_interfaces(matches) + .await + } + CliCommand::VpcList => self.execute_vpc_list(matches).await, + CliCommand::VpcCreate => self.execute_vpc_create(matches).await, + CliCommand::VpcView => self.execute_vpc_view(matches).await, + CliCommand::VpcUpdate => self.execute_vpc_update(matches).await, + CliCommand::VpcDelete => self.execute_vpc_delete(matches).await, + } + } - pub async fn execute(&self, cmd: CliCommand, matches: &clap::ArgMatches) -> anyhow::Result<()> { - match cmd { - CliCommand::DeviceAuthRequest => self.execute_device_auth_request(matches).await, - CliCommand::DeviceAuthConfirm => self.execute_device_auth_confirm(matches).await, - CliCommand::DeviceAccessToken => self.execute_device_access_token(matches).await, - CliCommand::ProbeList => self.execute_probe_list(matches).await, - CliCommand::ProbeCreate => self.execute_probe_create(matches).await, - CliCommand::ProbeView => self.execute_probe_view(matches).await, - CliCommand::ProbeDelete => self.execute_probe_delete(matches).await, - CliCommand::LoginSaml => self.execute_login_saml(matches).await, - CliCommand::CertificateList => self.execute_certificate_list(matches).await, - CliCommand::CertificateCreate => self.execute_certificate_create(matches).await, - CliCommand::CertificateView => self.execute_certificate_view(matches).await, - CliCommand::CertificateDelete => self.execute_certificate_delete(matches).await, - CliCommand::DiskList => self.execute_disk_list(matches).await, - CliCommand::DiskCreate => self.execute_disk_create(matches).await, - CliCommand::DiskView => self.execute_disk_view(matches).await, - CliCommand::DiskDelete => self.execute_disk_delete(matches).await, - CliCommand::DiskBulkWriteImport => self.execute_disk_bulk_write_import(matches).await, - CliCommand::DiskBulkWriteImportStart => { - self.execute_disk_bulk_write_import_start(matches).await + pub async fn execute_device_auth_request( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.device_auth_request(); + if let Some(value) = matches.get_one::("client-id") { + request = request.body_map(|body| body.client_id(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_device_auth_request(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() } - CliCommand::DiskBulkWriteImportStop => { - self.execute_disk_bulk_write_import_stop(matches).await + Err(r) => { + todo!() } - CliCommand::DiskFinalizeImport => self.execute_disk_finalize_import(matches).await, - CliCommand::DiskMetricsList => self.execute_disk_metrics_list(matches).await, - CliCommand::FloatingIpList => self.execute_floating_ip_list(matches).await, - CliCommand::FloatingIpCreate => self.execute_floating_ip_create(matches).await, - CliCommand::FloatingIpView => self.execute_floating_ip_view(matches).await, - CliCommand::FloatingIpUpdate => self.execute_floating_ip_update(matches).await, - CliCommand::FloatingIpDelete => self.execute_floating_ip_delete(matches).await, - CliCommand::FloatingIpAttach => self.execute_floating_ip_attach(matches).await, - CliCommand::FloatingIpDetach => self.execute_floating_ip_detach(matches).await, - CliCommand::GroupList => self.execute_group_list(matches).await, - CliCommand::GroupView => self.execute_group_view(matches).await, - CliCommand::ImageList => self.execute_image_list(matches).await, - CliCommand::ImageCreate => self.execute_image_create(matches).await, - CliCommand::ImageView => self.execute_image_view(matches).await, - CliCommand::ImageDelete => self.execute_image_delete(matches).await, - CliCommand::ImageDemote => self.execute_image_demote(matches).await, - CliCommand::ImagePromote => self.execute_image_promote(matches).await, - CliCommand::InstanceList => self.execute_instance_list(matches).await, - CliCommand::InstanceCreate => self.execute_instance_create(matches).await, - CliCommand::InstanceView => self.execute_instance_view(matches).await, - CliCommand::InstanceUpdate => self.execute_instance_update(matches).await, - CliCommand::InstanceDelete => self.execute_instance_delete(matches).await, - CliCommand::InstanceDiskList => self.execute_instance_disk_list(matches).await, - CliCommand::InstanceDiskAttach => self.execute_instance_disk_attach(matches).await, - CliCommand::InstanceDiskDetach => self.execute_instance_disk_detach(matches).await, - CliCommand::InstanceExternalIpList => { - self.execute_instance_external_ip_list(matches).await + } + } + + pub async fn execute_device_auth_confirm( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.device_auth_confirm(); + if let Some(value) = matches.get_one::("user-code") { + request = request.body_map(|body| body.user_code(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_device_auth_confirm(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::InstanceEphemeralIpAttach => { - self.execute_instance_ephemeral_ip_attach(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::InstanceEphemeralIpDetach => { - self.execute_instance_ephemeral_ip_detach(matches).await + } + } + + pub async fn execute_device_access_token( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.device_access_token(); + if let Some(value) = matches.get_one::("client-id") { + request = request.body_map(|body| body.client_id(value.clone())) + } + + if let Some(value) = matches.get_one::("device-code") { + request = request.body_map(|body| body.device_code(value.clone())) + } + + if let Some(value) = matches.get_one::("grant-type") { + request = request.body_map(|body| body.grant_type(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_device_access_token(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() } - CliCommand::InstanceReboot => self.execute_instance_reboot(matches).await, - CliCommand::InstanceSerialConsole => { - self.execute_instance_serial_console(matches).await + Err(r) => { + todo!() } - CliCommand::InstanceSerialConsoleStream => { - self.execute_instance_serial_console_stream(matches).await + } + } + + pub async fn execute_probe_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.probe_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config.execute_probe_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } + } + } + } + + pub async fn execute_probe_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.probe_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("ip-pool") { + request = request.body_map(|body| body.ip_pool(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("sled") { + request = request.body_map(|body| body.sled(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config.execute_probe_create(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::InstanceSshPublicKeyList => { - self.execute_instance_ssh_public_key_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::InstanceStart => self.execute_instance_start(matches).await, - CliCommand::InstanceStop => self.execute_instance_stop(matches).await, - CliCommand::InternetGatewayIpAddressList => { - self.execute_internet_gateway_ip_address_list(matches).await + } + } + + pub async fn execute_probe_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.probe_view(); + if let Some(value) = matches.get_one::("probe") { + request = request.probe(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_probe_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::InternetGatewayIpAddressCreate => { - self.execute_internet_gateway_ip_address_create(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::InternetGatewayIpAddressDelete => { - self.execute_internet_gateway_ip_address_delete(matches) - .await + } + } + + pub async fn execute_probe_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.probe_delete(); + if let Some(value) = matches.get_one::("probe") { + request = request.probe(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_probe_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::InternetGatewayIpPoolList => { - self.execute_internet_gateway_ip_pool_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::InternetGatewayIpPoolCreate => { - self.execute_internet_gateway_ip_pool_create(matches).await + } + } + + pub async fn execute_login_saml(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.login_saml(); + if let Some(value) = matches.get_one::("provider-name") { + request = request.provider_name(value.clone()); + } + + if let Some(value) = matches.get_one::("silo-name") { + request = request.silo_name(value.clone()); + } + + self.config.execute_login_saml(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() } - CliCommand::InternetGatewayIpPoolDelete => { - self.execute_internet_gateway_ip_pool_delete(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::InternetGatewayList => self.execute_internet_gateway_list(matches).await, - CliCommand::InternetGatewayCreate => { - self.execute_internet_gateway_create(matches).await + } + } + + pub async fn execute_certificate_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.certificate_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config + .execute_certificate_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } - CliCommand::InternetGatewayView => self.execute_internet_gateway_view(matches).await, - CliCommand::InternetGatewayDelete => { - self.execute_internet_gateway_delete(matches).await + } + } + + pub async fn execute_certificate_create( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.certificate_create(); + if let Some(value) = matches.get_one::("cert") { + request = request.body_map(|body| body.cert(value.clone())) + } + + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("key") { + request = request.body_map(|body| body.key(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("service") { + request = request.body_map(|body| body.service(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_certificate_create(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::ProjectIpPoolList => self.execute_project_ip_pool_list(matches).await, - CliCommand::ProjectIpPoolView => self.execute_project_ip_pool_view(matches).await, - CliCommand::LoginLocal => self.execute_login_local(matches).await, - CliCommand::Logout => self.execute_logout(matches).await, - CliCommand::CurrentUserView => self.execute_current_user_view(matches).await, - CliCommand::CurrentUserGroups => self.execute_current_user_groups(matches).await, - CliCommand::CurrentUserSshKeyList => { - self.execute_current_user_ssh_key_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::CurrentUserSshKeyCreate => { - self.execute_current_user_ssh_key_create(matches).await + } + } + + pub async fn execute_certificate_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.certificate_view(); + if let Some(value) = matches.get_one::("certificate") { + request = request.certificate(value.clone()); + } + + self.config + .execute_certificate_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::CurrentUserSshKeyView => { - self.execute_current_user_ssh_key_view(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::CurrentUserSshKeyDelete => { - self.execute_current_user_ssh_key_delete(matches).await + } + } + + pub async fn execute_certificate_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.certificate_delete(); + if let Some(value) = matches.get_one::("certificate") { + request = request.certificate(value.clone()); + } + + self.config + .execute_certificate_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::SiloMetric => self.execute_silo_metric(matches).await, - CliCommand::InstanceNetworkInterfaceList => { - self.execute_instance_network_interface_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::InstanceNetworkInterfaceCreate => { - self.execute_instance_network_interface_create(matches) - .await + } + } + + pub async fn execute_disk_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.disk_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config.execute_disk_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config.list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } - CliCommand::InstanceNetworkInterfaceView => { - self.execute_instance_network_interface_view(matches).await + } + } + + pub async fn execute_disk_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.disk_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("size") { + request = request.body_map(|body| body.size(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config.execute_disk_create(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::InstanceNetworkInterfaceUpdate => { - self.execute_instance_network_interface_update(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::InstanceNetworkInterfaceDelete => { - self.execute_instance_network_interface_delete(matches) - .await + } + } + + pub async fn execute_disk_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.disk_view(); + if let Some(value) = matches.get_one::("disk") { + request = request.disk(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_disk_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::Ping => self.execute_ping(matches).await, - CliCommand::PolicyView => self.execute_policy_view(matches).await, - CliCommand::PolicyUpdate => self.execute_policy_update(matches).await, - CliCommand::ProjectList => self.execute_project_list(matches).await, - CliCommand::ProjectCreate => self.execute_project_create(matches).await, - CliCommand::ProjectView => self.execute_project_view(matches).await, - CliCommand::ProjectUpdate => self.execute_project_update(matches).await, - CliCommand::ProjectDelete => self.execute_project_delete(matches).await, - CliCommand::ProjectPolicyView => self.execute_project_policy_view(matches).await, - CliCommand::ProjectPolicyUpdate => self.execute_project_policy_update(matches).await, - CliCommand::SnapshotList => self.execute_snapshot_list(matches).await, - CliCommand::SnapshotCreate => self.execute_snapshot_create(matches).await, - CliCommand::SnapshotView => self.execute_snapshot_view(matches).await, - CliCommand::SnapshotDelete => self.execute_snapshot_delete(matches).await, - CliCommand::PhysicalDiskList => self.execute_physical_disk_list(matches).await, - CliCommand::PhysicalDiskView => self.execute_physical_disk_view(matches).await, - CliCommand::RackList => self.execute_rack_list(matches).await, - CliCommand::RackView => self.execute_rack_view(matches).await, - CliCommand::SledList => self.execute_sled_list(matches).await, - CliCommand::SledAdd => self.execute_sled_add(matches).await, - CliCommand::SledView => self.execute_sled_view(matches).await, - CliCommand::SledPhysicalDiskList => self.execute_sled_physical_disk_list(matches).await, - CliCommand::SledInstanceList => self.execute_sled_instance_list(matches).await, - CliCommand::SledSetProvisionPolicy => { - self.execute_sled_set_provision_policy(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::SledListUninitialized => { - self.execute_sled_list_uninitialized(matches).await + } + } + + pub async fn execute_disk_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.disk_delete(); + if let Some(value) = matches.get_one::("disk") { + request = request.disk(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_disk_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::NetworkingSwitchPortList => { - self.execute_networking_switch_port_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingSwitchPortApplySettings => { - self.execute_networking_switch_port_apply_settings(matches) - .await + } + } + + pub async fn execute_disk_bulk_write_import( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.disk_bulk_write_import(); + if let Some(value) = matches.get_one::("base64-encoded-data") { + request = request.body_map(|body| body.base64_encoded_data(value.clone())) + } + + if let Some(value) = matches.get_one::("disk") { + request = request.disk(value.clone()); + } + + if let Some(value) = matches.get_one::("offset") { + request = request.body_map(|body| body.offset(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_disk_bulk_write_import(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::NetworkingSwitchPortClearSettings => { - self.execute_networking_switch_port_clear_settings(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingSwitchPortStatus => { - self.execute_networking_switch_port_status(matches).await + } + } + + pub async fn execute_disk_bulk_write_import_start( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.disk_bulk_write_import_start(); + if let Some(value) = matches.get_one::("disk") { + request = request.disk(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_disk_bulk_write_import_start(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::SwitchList => self.execute_switch_list(matches).await, - CliCommand::SwitchView => self.execute_switch_view(matches).await, - CliCommand::SiloIdentityProviderList => { - self.execute_silo_identity_provider_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_disk_bulk_write_import_stop( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.disk_bulk_write_import_stop(); + if let Some(value) = matches.get_one::("disk") { + request = request.disk(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_disk_bulk_write_import_stop(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::LocalIdpUserCreate => self.execute_local_idp_user_create(matches).await, - CliCommand::LocalIdpUserDelete => self.execute_local_idp_user_delete(matches).await, - CliCommand::LocalIdpUserSetPassword => { - self.execute_local_idp_user_set_password(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::SamlIdentityProviderCreate => { - self.execute_saml_identity_provider_create(matches).await + } + } + + pub async fn execute_disk_finalize_import( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.disk_finalize_import(); + if let Some(value) = matches.get_one::("disk") { + request = request.disk(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("snapshot-name") { + request = request.body_map(|body| body.snapshot_name(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_disk_finalize_import(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::SamlIdentityProviderView => { - self.execute_saml_identity_provider_view(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::IpPoolList => self.execute_ip_pool_list(matches).await, - CliCommand::IpPoolCreate => self.execute_ip_pool_create(matches).await, - CliCommand::IpPoolView => self.execute_ip_pool_view(matches).await, - CliCommand::IpPoolUpdate => self.execute_ip_pool_update(matches).await, - CliCommand::IpPoolDelete => self.execute_ip_pool_delete(matches).await, - CliCommand::IpPoolRangeList => self.execute_ip_pool_range_list(matches).await, - CliCommand::IpPoolRangeAdd => self.execute_ip_pool_range_add(matches).await, - CliCommand::IpPoolRangeRemove => self.execute_ip_pool_range_remove(matches).await, - CliCommand::IpPoolSiloList => self.execute_ip_pool_silo_list(matches).await, - CliCommand::IpPoolSiloLink => self.execute_ip_pool_silo_link(matches).await, - CliCommand::IpPoolSiloUpdate => self.execute_ip_pool_silo_update(matches).await, - CliCommand::IpPoolSiloUnlink => self.execute_ip_pool_silo_unlink(matches).await, - CliCommand::IpPoolUtilizationView => { - self.execute_ip_pool_utilization_view(matches).await + } + } + + pub async fn execute_disk_metrics_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.disk_metrics_list(); + if let Some(value) = matches.get_one::("disk") { + request = request.disk(value.clone()); + } + + if let Some(value) = matches.get_one::>("end-time") { + request = request.end_time(value.clone()); + } + + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("metric") { + request = request.metric(value.clone()); + } + + if let Some(value) = matches.get_one::("order") { + request = request.order(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::>("start-time") + { + request = request.start_time(value.clone()); + } + + self.config + .execute_disk_metrics_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } - CliCommand::IpPoolServiceView => self.execute_ip_pool_service_view(matches).await, - CliCommand::IpPoolServiceRangeList => { - self.execute_ip_pool_service_range_list(matches).await + } + } + + pub async fn execute_floating_ip_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.floating_ip_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config + .execute_floating_ip_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } - CliCommand::IpPoolServiceRangeAdd => { - self.execute_ip_pool_service_range_add(matches).await + } + } + + pub async fn execute_floating_ip_create( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.floating_ip_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("ip") { + request = request.body_map(|body| body.ip(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("pool") { + request = request.body_map(|body| body.pool(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_floating_ip_create(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::IpPoolServiceRangeRemove => { - self.execute_ip_pool_service_range_remove(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::SystemMetric => self.execute_system_metric(matches).await, - CliCommand::NetworkingAddressLotList => { - self.execute_networking_address_lot_list(matches).await + } + } + + pub async fn execute_floating_ip_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.floating_ip_view(); + if let Some(value) = matches.get_one::("floating-ip") { + request = request.floating_ip(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_floating_ip_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingAddressLotCreate => { - self.execute_networking_address_lot_create(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingAddressLotDelete => { - self.execute_networking_address_lot_delete(matches).await + } + } + + pub async fn execute_floating_ip_update( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.floating_ip_update(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("floating-ip") { + request = request.floating_ip(value.clone()); + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_floating_ip_update(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingAddressLotBlockList => { - self.execute_networking_address_lot_block_list(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingAllowListView => { - self.execute_networking_allow_list_view(matches).await + } + } + + pub async fn execute_floating_ip_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.floating_ip_delete(); + if let Some(value) = matches.get_one::("floating-ip") { + request = request.floating_ip(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_floating_ip_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::NetworkingAllowListUpdate => { - self.execute_networking_allow_list_update(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingBfdDisable => self.execute_networking_bfd_disable(matches).await, - CliCommand::NetworkingBfdEnable => self.execute_networking_bfd_enable(matches).await, - CliCommand::NetworkingBfdStatus => self.execute_networking_bfd_status(matches).await, - CliCommand::NetworkingBgpConfigList => { - self.execute_networking_bgp_config_list(matches).await + } + } + + pub async fn execute_floating_ip_attach( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.floating_ip_attach(); + if let Some(value) = matches.get_one::("floating-ip") { + request = request.floating_ip(value.clone()); + } + + if let Some(value) = matches.get_one::("kind") { + request = request.body_map(|body| body.kind(value.clone())) + } + + if let Some(value) = matches.get_one::("parent") { + request = request.body_map(|body| body.parent(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_floating_ip_attach(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingBgpConfigCreate => { - self.execute_networking_bgp_config_create(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingBgpConfigDelete => { - self.execute_networking_bgp_config_delete(matches).await + } + } + + pub async fn execute_floating_ip_detach( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.floating_ip_detach(); + if let Some(value) = matches.get_one::("floating-ip") { + request = request.floating_ip(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_floating_ip_detach(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingBgpAnnounceSetList => { - self.execute_networking_bgp_announce_set_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingBgpAnnounceSetUpdate => { - self.execute_networking_bgp_announce_set_update(matches) - .await + } + } + + pub async fn execute_group_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.group_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config.execute_group_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config.list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } - CliCommand::NetworkingBgpAnnounceSetDelete => { - self.execute_networking_bgp_announce_set_delete(matches) - .await + } + } + + pub async fn execute_group_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.group_view(); + if let Some(value) = matches.get_one::("group-id") { + request = request.group_id(value.clone()); + } + + self.config.execute_group_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingBgpAnnouncementList => { - self.execute_networking_bgp_announcement_list(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingBgpExported => { - self.execute_networking_bgp_exported(matches).await + } + } + + pub async fn execute_image_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.image_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config.execute_image_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config.list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } - CliCommand::NetworkingBgpMessageHistory => { - self.execute_networking_bgp_message_history(matches).await + } + } + + pub async fn execute_image_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.image_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("os") { + request = request.body_map(|body| body.os(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("version") { + request = request.body_map(|body| body.version(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config.execute_image_create(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingBgpImportedRoutesIpv4 => { - self.execute_networking_bgp_imported_routes_ipv4(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingBgpStatus => self.execute_networking_bgp_status(matches).await, - CliCommand::NetworkingLoopbackAddressList => { - self.execute_networking_loopback_address_list(matches).await + } + } + + pub async fn execute_image_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.image_view(); + if let Some(value) = matches.get_one::("image") { + request = request.image(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_image_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingLoopbackAddressCreate => { - self.execute_networking_loopback_address_create(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingLoopbackAddressDelete => { - self.execute_networking_loopback_address_delete(matches) - .await + } + } + + pub async fn execute_image_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.image_delete(); + if let Some(value) = matches.get_one::("image") { + request = request.image(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_image_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) } - CliCommand::NetworkingSwitchPortSettingsList => { - self.execute_networking_switch_port_settings_list(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingSwitchPortSettingsCreate => { - self.execute_networking_switch_port_settings_create(matches) - .await + } + } + + pub async fn execute_image_demote(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.image_demote(); + if let Some(value) = matches.get_one::("image") { + request = request.image(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_image_demote(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::NetworkingSwitchPortSettingsDelete => { - self.execute_networking_switch_port_settings_delete(matches) - .await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::NetworkingSwitchPortSettingsView => { - self.execute_networking_switch_port_settings_view(matches) - .await + } + } + + pub async fn execute_image_promote(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.image_promote(); + if let Some(value) = matches.get_one::("image") { + request = request.image(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_image_promote(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) } - CliCommand::SystemPolicyView => self.execute_system_policy_view(matches).await, - CliCommand::SystemPolicyUpdate => self.execute_system_policy_update(matches).await, - CliCommand::RoleList => self.execute_role_list(matches).await, - CliCommand::RoleView => self.execute_role_view(matches).await, - CliCommand::SystemQuotasList => self.execute_system_quotas_list(matches).await, - CliCommand::SiloList => self.execute_silo_list(matches).await, - CliCommand::SiloCreate => self.execute_silo_create(matches).await, - CliCommand::SiloView => self.execute_silo_view(matches).await, - CliCommand::SiloDelete => self.execute_silo_delete(matches).await, - CliCommand::SiloIpPoolList => self.execute_silo_ip_pool_list(matches).await, - CliCommand::SiloPolicyView => self.execute_silo_policy_view(matches).await, - CliCommand::SiloPolicyUpdate => self.execute_silo_policy_update(matches).await, - CliCommand::SiloQuotasView => self.execute_silo_quotas_view(matches).await, - CliCommand::SiloQuotasUpdate => self.execute_silo_quotas_update(matches).await, - CliCommand::SiloUserList => self.execute_silo_user_list(matches).await, - CliCommand::SiloUserView => self.execute_silo_user_view(matches).await, - CliCommand::UserBuiltinList => self.execute_user_builtin_list(matches).await, - CliCommand::UserBuiltinView => self.execute_user_builtin_view(matches).await, - CliCommand::SiloUtilizationList => self.execute_silo_utilization_list(matches).await, - CliCommand::SiloUtilizationView => self.execute_silo_utilization_view(matches).await, - CliCommand::TimeseriesQuery => self.execute_timeseries_query(matches).await, - CliCommand::TimeseriesSchemaList => self.execute_timeseries_schema_list(matches).await, - CliCommand::UserList => self.execute_user_list(matches).await, - CliCommand::UtilizationView => self.execute_utilization_view(matches).await, - CliCommand::VpcFirewallRulesView => self.execute_vpc_firewall_rules_view(matches).await, - CliCommand::VpcFirewallRulesUpdate => { - self.execute_vpc_firewall_rules_update(matches).await + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } - CliCommand::VpcRouterRouteList => self.execute_vpc_router_route_list(matches).await, - CliCommand::VpcRouterRouteCreate => self.execute_vpc_router_route_create(matches).await, - CliCommand::VpcRouterRouteView => self.execute_vpc_router_route_view(matches).await, - CliCommand::VpcRouterRouteUpdate => self.execute_vpc_router_route_update(matches).await, - CliCommand::VpcRouterRouteDelete => self.execute_vpc_router_route_delete(matches).await, - CliCommand::VpcRouterList => self.execute_vpc_router_list(matches).await, - CliCommand::VpcRouterCreate => self.execute_vpc_router_create(matches).await, - CliCommand::VpcRouterView => self.execute_vpc_router_view(matches).await, - CliCommand::VpcRouterUpdate => self.execute_vpc_router_update(matches).await, - CliCommand::VpcRouterDelete => self.execute_vpc_router_delete(matches).await, - CliCommand::VpcSubnetList => self.execute_vpc_subnet_list(matches).await, - CliCommand::VpcSubnetCreate => self.execute_vpc_subnet_create(matches).await, - CliCommand::VpcSubnetView => self.execute_vpc_subnet_view(matches).await, - CliCommand::VpcSubnetUpdate => self.execute_vpc_subnet_update(matches).await, - CliCommand::VpcSubnetDelete => self.execute_vpc_subnet_delete(matches).await, - CliCommand::VpcSubnetListNetworkInterfaces => { - self.execute_vpc_subnet_list_network_interfaces(matches) - .await + } + } + + pub async fn execute_instance_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config.execute_instance_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config.list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } - CliCommand::VpcList => self.execute_vpc_list(matches).await, - CliCommand::VpcCreate => self.execute_vpc_create(matches).await, - CliCommand::VpcView => self.execute_vpc_view(matches).await, - CliCommand::VpcUpdate => self.execute_vpc_update(matches).await, - CliCommand::VpcDelete => self.execute_vpc_delete(matches).await, } - } + } + + pub async fn execute_instance_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_create(); + if let Some(value) = + matches.get_one::("auto-restart-policy") + { + request = request.body_map(|body| body.auto_restart_policy(value.clone())) + } + + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("hostname") { + request = request.body_map(|body| body.hostname(value.clone())) + } + + if let Some(value) = matches.get_one::("memory") { + request = request.body_map(|body| body.memory(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("ncpus") { + request = request.body_map(|body| body.ncpus(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("start") { + request = request.body_map(|body| body.start(value.clone())) + } - pub async fn execute_device_auth_request( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.device_auth_request(); - if let Some(value) = matches.get_one::("client-id") { - request = request.body_map(|body| body.client_id(value.clone())) + if let Some(value) = matches.get_one::("user-data") { + request = request.body_map(|body| body.user_data(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config - .execute_device_auth_request(matches, &mut request)?; + self.config.execute_instance_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - todo!() + self.config.success_item(&r); + Ok(()) } Err(r) => { - todo!() + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_device_auth_confirm( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.device_auth_confirm(); - if let Some(value) = matches.get_one::("user-code") { - request = request.body_map(|body| body.user_code(value.clone())) + pub async fn execute_instance_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_view(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } - self.config - .execute_device_auth_confirm(matches, &mut request)?; + self.config.execute_instance_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -6969,45 +9669,79 @@ impl Cli { } } - pub async fn execute_device_access_token( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.device_access_token(); - if let Some(value) = matches.get_one::("client-id") { - request = request.body_map(|body| body.client_id(value.clone())) + pub async fn execute_instance_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_update(); + if let Some(value) = + matches.get_one::("auto-restart-policy") + { + request = request.body_map(|body| body.auto_restart_policy(value.clone())) } - if let Some(value) = matches.get_one::("device-code") { - request = request.body_map(|body| body.device_code(value.clone())) + if let Some(value) = matches.get_one::("boot-disk") { + request = request.body_map(|body| body.boot_disk(value.clone())) } - if let Some(value) = matches.get_one::("grant-type") { - request = request.body_map(|body| body.grant_type(value.clone())) + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config - .execute_device_access_token(matches, &mut request)?; + self.config.execute_instance_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - todo!() + self.config.success_item(&r); + Ok(()) } Err(r) => { - todo!() + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_probe_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.probe_list(); + pub async fn execute_instance_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_delete(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_instance_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_instance_disk_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_disk_list(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } @@ -7020,8 +9754,9 @@ impl Cli { request = request.sort_by(value.clone()); } - self.config.execute_probe_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_instance_disk_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -7035,8 +9770,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config - .list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -7046,35 +9780,31 @@ impl Cli { } } - pub async fn execute_probe_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.probe_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("ip-pool") { - request = request.body_map(|body| body.ip_pool(value.clone())) + pub async fn execute_instance_disk_attach( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_disk_attach(); + if let Some(value) = matches.get_one::("disk") { + request = request.body_map(|body| body.disk(value.clone())) } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("sled") { - request = request.body_map(|body| body.sled(value.clone())) - } - if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_probe_create(matches, &mut request)?; + self.config + .execute_instance_disk_attach(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7088,17 +9818,31 @@ impl Cli { } } - pub async fn execute_probe_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.probe_view(); - if let Some(value) = matches.get_one::("probe") { - request = request.probe(value.clone()); + pub async fn execute_instance_disk_detach( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_disk_detach(); + if let Some(value) = matches.get_one::("disk") { + request = request.body_map(|body| body.disk(value.clone())) + } + + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - self.config.execute_probe_view(matches, &mut request)?; + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_instance_disk_detach(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7112,21 +9856,25 @@ impl Cli { } } - pub async fn execute_probe_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.probe_delete(); - if let Some(value) = matches.get_one::("probe") { - request = request.probe(value.clone()); + pub async fn execute_instance_external_ip_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_external_ip_list(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - self.config.execute_probe_delete(matches, &mut request)?; + self.config + .execute_instance_external_ip_list(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -7136,99 +9884,83 @@ impl Cli { } } - pub async fn execute_login_saml(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.login_saml(); - if let Some(value) = matches.get_one::("provider-name") { - request = request.provider_name(value.clone()); - } - - if let Some(value) = matches.get_one::("silo-name") { - request = request.silo_name(value.clone()); + pub async fn execute_instance_ephemeral_ip_attach( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_ephemeral_ip_attach(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } - self.config.execute_login_saml(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - todo!() - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + if let Some(value) = matches.get_one::("pool") { + request = request.body_map(|body| body.pool(value.clone())) } - } - pub async fn execute_certificate_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.certificate_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } - - self.config - .execute_certificate_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + + self.config + .execute_instance_ephemeral_ip_attach(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_certificate_create( + pub async fn execute_instance_ephemeral_ip_detach( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.certificate_create(); - if let Some(value) = matches.get_one::("cert") { - request = request.body_map(|body| body.cert(value.clone())) - } - - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) + let mut request = self.client.instance_ephemeral_ip_detach(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } - if let Some(value) = matches.get_one::("key") { - request = request.body_map(|body| body.key(value.clone())) + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + self.config + .execute_instance_ephemeral_ip_detach(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } } + } - if let Some(value) = matches.get_one::("service") { - request = request.body_map(|body| body.service(value.clone())) + pub async fn execute_instance_reboot(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_reboot(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } - self.config - .execute_certificate_create(matches, &mut request)?; + self.config.execute_instance_reboot(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7242,14 +9974,33 @@ impl Cli { } } - pub async fn execute_certificate_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.certificate_view(); - if let Some(value) = matches.get_one::("certificate") { - request = request.certificate(value.clone()); + pub async fn execute_instance_serial_console( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_serial_console(); + if let Some(value) = matches.get_one::("from-start") { + request = request.from_start(value.clone()); + } + + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("max-bytes") { + request = request.max_bytes(value.clone()); + } + + if let Some(value) = matches.get_one::("most-recent") { + request = request.most_recent(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } self.config - .execute_certificate_view(matches, &mut request)?; + .execute_instance_serial_console(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7263,32 +10014,45 @@ impl Cli { } } - pub async fn execute_certificate_delete( + pub async fn execute_instance_serial_console_stream( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.certificate_delete(); - if let Some(value) = matches.get_one::("certificate") { - request = request.certificate(value.clone()); + let mut request = self.client.instance_serial_console_stream(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("most-recent") { + request = request.most_recent(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } self.config - .execute_certificate_delete(matches, &mut request)?; + .execute_instance_serial_console_stream(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); - Ok(()) + todo!() } Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) + todo!() } } } - pub async fn execute_disk_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.disk_list(); + pub async fn execute_instance_ssh_public_key_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_ssh_public_key_list(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } @@ -7301,8 +10065,9 @@ impl Cli { request = request.sort_by(value.clone()); } - self.config.execute_disk_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_instance_ssh_public_key_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -7316,7 +10081,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -7326,31 +10091,17 @@ impl Cli { } } - pub async fn execute_disk_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.disk_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + pub async fn execute_instance_start(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_start(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("size") { - request = request.body_map(|body| body.size(value.clone())) - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); - } - - self.config.execute_disk_create(matches, &mut request)?; + self.config.execute_instance_start(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7364,17 +10115,17 @@ impl Cli { } } - pub async fn execute_disk_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.disk_view(); - if let Some(value) = matches.get_one::("disk") { - request = request.disk(value.clone()); + pub async fn execute_instance_stop(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.instance_stop(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - self.config.execute_disk_view(matches, &mut request)?; + self.config.execute_instance_stop(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7388,158 +10139,101 @@ impl Cli { } } - pub async fn execute_disk_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.disk_delete(); - if let Some(value) = matches.get_one::("disk") { - request = request.disk(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config.execute_disk_delete(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_disk_bulk_write_import( + pub async fn execute_internet_gateway_ip_address_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.disk_bulk_write_import(); - if let Some(value) = matches.get_one::("base64-encoded-data") { - request = request.body_map(|body| body.base64_encoded_data(value.clone())) - } - - if let Some(value) = matches.get_one::("disk") { - request = request.disk(value.clone()); + let mut request = self.client.internet_gateway_ip_address_list(); + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); } - if let Some(value) = matches.get_one::("offset") { - request = request.body_map(|body| body.offset(value.clone())) + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); - } - - self.config - .execute_disk_bulk_write_import(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_disk_bulk_write_import_start( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.disk_bulk_write_import_start(); - if let Some(value) = matches.get_one::("disk") { - request = request.disk(value.clone()); + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); } self.config - .execute_disk_bulk_write_import_start(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) + .execute_internet_gateway_ip_address_list(matches, &mut request)?; + self.config + .list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } } } - pub async fn execute_disk_bulk_write_import_stop( + pub async fn execute_internet_gateway_ip_address_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.disk_bulk_write_import_stop(); - if let Some(value) = matches.get_one::("disk") { - request = request.disk(value.clone()); + let mut request = self.client.internet_gateway_ip_address_create(); + if let Some(value) = matches.get_one::("address") { + request = request.body_map(|body| body.address(value.clone())) } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) } - self.config - .execute_disk_bulk_write_import_stop(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); } - } - pub async fn execute_disk_finalize_import( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.disk_finalize_import(); - if let Some(value) = matches.get_one::("disk") { - request = request.disk(value.clone()); + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("snapshot-name") { - request = request.body_map(|body| body.snapshot_name(value.clone())) + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_disk_finalize_import(matches, &mut request)?; + .execute_internet_gateway_ip_address_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -7549,69 +10243,55 @@ impl Cli { } } - pub async fn execute_disk_metrics_list( + pub async fn execute_internet_gateway_ip_address_delete( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.disk_metrics_list(); - if let Some(value) = matches.get_one::("disk") { - request = request.disk(value.clone()); - } - - if let Some(value) = matches.get_one::>("end-time") { - request = request.end_time(value.clone()); - } - - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); + let mut request = self.client.internet_gateway_ip_address_delete(); + if let Some(value) = matches.get_one::("address") { + request = request.address(value.clone()); } - if let Some(value) = matches.get_one::("metric") { - request = request.metric(value.clone()); + if let Some(value) = matches.get_one::("cascade") { + request = request.cascade(value.clone()); } - if let Some(value) = matches.get_one::("order") { - request = request.order(value.clone()); + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::>("start-time") - { - request = request.start_time(value.clone()); + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); } self.config - .execute_disk_metrics_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + .execute_internet_gateway_ip_address_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_floating_ip_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.floating_ip_list(); + pub async fn execute_internet_gateway_ip_pool_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.internet_gateway_ip_pool_list(); + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); + } + if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } @@ -7624,9 +10304,14 @@ impl Cli { request = request.sort_by(value.clone()); } + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); + } + self.config - .execute_floating_ip_list(matches, &mut request)?; - self.config.list_start::(); + .execute_internet_gateway_ip_pool_list(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -7641,7 +10326,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -7651,39 +10336,44 @@ impl Cli { } } - pub async fn execute_floating_ip_create( + pub async fn execute_internet_gateway_ip_pool_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.floating_ip_create(); + let mut request = self.client.internet_gateway_ip_pool_create(); if let Some(value) = matches.get_one::("description") { request = request.body_map(|body| body.description(value.clone())) } - if let Some(value) = matches.get_one::("ip") { - request = request.body_map(|body| body.ip(value.clone())) + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + if let Some(value) = matches.get_one::("ip-pool") { + request = request.body_map(|body| body.ip_pool(value.clone())) } - if let Some(value) = matches.get_one::("pool") { - request = request.body_map(|body| body.pool(value.clone())) + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); + } + if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_floating_ip_create(matches, &mut request)?; + .execute_internet_gateway_ip_pool_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7697,22 +10387,37 @@ impl Cli { } } - pub async fn execute_floating_ip_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.floating_ip_view(); - if let Some(value) = matches.get_one::("floating-ip") { - request = request.floating_ip(value.clone()); + pub async fn execute_internet_gateway_ip_pool_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.internet_gateway_ip_pool_delete(); + if let Some(value) = matches.get_one::("cascade") { + request = request.cascade(value.clone()); + } + + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); + } + + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); + } + self.config - .execute_floating_ip_view(matches, &mut request)?; + .execute_internet_gateway_ip_pool_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -7722,67 +10427,89 @@ impl Cli { } } - pub async fn execute_floating_ip_update( + pub async fn execute_internet_gateway_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.floating_ip_update(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("floating-ip") { - request = request.floating_ip(value.clone()); - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + let mut request = self.client.internet_gateway_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); } self.config - .execute_floating_ip_update(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) + .execute_internet_gateway_list(matches, &mut request)?; + self.config + .list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } } } - pub async fn execute_floating_ip_delete( + pub async fn execute_internet_gateway_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.floating_ip_delete(); - if let Some(value) = matches.get_one::("floating-ip") { - request = request.floating_ip(value.clone()); + let mut request = self.client.internet_gateway_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + self.config - .execute_floating_ip_delete(matches, &mut request)?; + .execute_internet_gateway_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -7792,35 +10519,25 @@ impl Cli { } } - pub async fn execute_floating_ip_attach( + pub async fn execute_internet_gateway_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.floating_ip_attach(); - if let Some(value) = matches.get_one::("floating-ip") { - request = request.floating_ip(value.clone()); - } - - if let Some(value) = matches.get_one::("kind") { - request = request.body_map(|body| body.kind(value.clone())) - } - - if let Some(value) = matches.get_one::("parent") { - request = request.body_map(|body| body.parent(value.clone())) + let mut request = self.client.internet_gateway_view(); + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); } self.config - .execute_floating_ip_attach(matches, &mut request)?; + .execute_internet_gateway_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7834,25 +10551,33 @@ impl Cli { } } - pub async fn execute_floating_ip_detach( + pub async fn execute_internet_gateway_delete( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.floating_ip_detach(); - if let Some(value) = matches.get_one::("floating-ip") { - request = request.floating_ip(value.clone()); + let mut request = self.client.internet_gateway_delete(); + if let Some(value) = matches.get_one::("cascade") { + request = request.cascade(value.clone()); + } + + if let Some(value) = matches.get_one::("gateway") { + request = request.gateway(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } + if let Some(value) = matches.get_one::("vpc") { + request = request.vpc(value.clone()); + } + self.config - .execute_floating_ip_detach(matches, &mut request)?; + .execute_internet_gateway_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -7862,18 +10587,22 @@ impl Cli { } } - pub async fn execute_group_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.group_list(); + pub async fn execute_project_ip_pool_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.project_ip_pool_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - self.config.execute_group_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_project_ip_pool_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -7887,7 +10616,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -7897,13 +10627,17 @@ impl Cli { } } - pub async fn execute_group_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.group_view(); - if let Some(value) = matches.get_one::("group-id") { - request = request.group_id(value.clone()); + pub async fn execute_project_ip_pool_view( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.project_ip_pool_view(); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } - self.config.execute_group_view(matches, &mut request)?; + self.config + .execute_project_ip_pool_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -7917,102 +10651,32 @@ impl Cli { } } - pub async fn execute_image_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.image_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); - } - - self.config.execute_image_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config.list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } - } - } - } - - pub async fn execute_image_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.image_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) - } - - if let Some(value) = matches.get_one::("os") { - request = request.body_map(|body| body.os(value.clone())) + pub async fn execute_login_local(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.login_local(); + if let Some(value) = matches.get_one::("password") { + request = request.body_map(|body| body.password(value.clone())) } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("silo-name") { + request = request.silo_name(value.clone()); } - if let Some(value) = matches.get_one::("version") { - request = request.body_map(|body| body.version(value.clone())) + if let Some(value) = matches.get_one::("username") { + request = request.body_map(|body| body.username(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_image_create(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_image_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.image_view(); - if let Some(value) = matches.get_one::("image") { - request = request.image(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config.execute_image_view(matches, &mut request)?; + self.config.execute_login_local(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -8022,17 +10686,9 @@ impl Cli { } } - pub async fn execute_image_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.image_delete(); - if let Some(value) = matches.get_one::("image") { - request = request.image(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config.execute_image_delete(matches, &mut request)?; + pub async fn execute_logout(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.logout(); + self.config.execute_logout(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8046,17 +10702,13 @@ impl Cli { } } - pub async fn execute_image_demote(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.image_demote(); - if let Some(value) = matches.get_one::("image") { - request = request.image(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config.execute_image_demote(matches, &mut request)?; + pub async fn execute_current_user_view( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_view(); + self.config + .execute_current_user_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8070,46 +10722,61 @@ impl Cli { } } - pub async fn execute_image_promote(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.image_promote(); - if let Some(value) = matches.get_one::("image") { - request = request.image(value.clone()); + pub async fn execute_current_user_groups( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_groups(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); } - self.config.execute_image_promote(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) + self.config + .execute_current_user_groups(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config.list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } } } - pub async fn execute_instance_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_list(); + pub async fn execute_current_user_ssh_key_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - self.config.execute_instance_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_current_user_ssh_key_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -8123,7 +10790,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -8133,53 +10800,31 @@ impl Cli { } } - pub async fn execute_instance_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_create(); - if let Some(value) = - matches.get_one::("auto-restart-policy") - { - request = request.body_map(|body| body.auto_restart_policy(value.clone())) - } - + pub async fn execute_current_user_ssh_key_create( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_create(); if let Some(value) = matches.get_one::("description") { request = request.body_map(|body| body.description(value.clone())) } - if let Some(value) = matches.get_one::("hostname") { - request = request.body_map(|body| body.hostname(value.clone())) - } - - if let Some(value) = matches.get_one::("memory") { - request = request.body_map(|body| body.memory(value.clone())) - } - if let Some(value) = matches.get_one::("name") { request = request.body_map(|body| body.name(value.clone())) } - if let Some(value) = matches.get_one::("ncpus") { - request = request.body_map(|body| body.ncpus(value.clone())) - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("start") { - request = request.body_map(|body| body.start(value.clone())) - } - - if let Some(value) = matches.get_one::("user-data") { - request = request.body_map(|body| body.user_data(value.clone())) + if let Some(value) = matches.get_one::("public-key") { + request = request.body_map(|body| body.public_key(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_instance_create(matches, &mut request)?; + self.config + .execute_current_user_ssh_key_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8193,17 +10838,17 @@ impl Cli { } } - pub async fn execute_instance_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_view(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + pub async fn execute_current_user_ssh_key_view( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_view(); + if let Some(value) = matches.get_one::("ssh-key") { + request = request.ssh_key(value.clone()); } - self.config.execute_instance_view(matches, &mut request)?; + self.config + .execute_current_user_ssh_key_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8217,37 +10862,21 @@ impl Cli { } } - pub async fn execute_instance_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_update(); - if let Some(value) = - matches.get_one::("auto-restart-policy") - { - request = request.body_map(|body| body.auto_restart_policy(value.clone())) - } - - if let Some(value) = matches.get_one::("boot-disk") { - request = request.body_map(|body| body.boot_disk(value.clone())) - } - - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + pub async fn execute_current_user_ssh_key_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_delete(); + if let Some(value) = matches.get_one::("ssh-key") { + request = request.ssh_key(value.clone()); } - self.config.execute_instance_update(matches, &mut request)?; + self.config + .execute_current_user_ssh_key_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -8257,35 +10886,64 @@ impl Cli { } } - pub async fn execute_instance_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_delete(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); + pub async fn execute_silo_metric(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.silo_metric(); + if let Some(value) = matches.get_one::>("end-time") { + request = request.end_time(value.clone()); + } + + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("metric-name") { + request = request.metric_name(value.clone()); + } + + if let Some(value) = matches.get_one::("order") { + request = request.order(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - self.config.execute_instance_delete(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) + if let Some(value) = matches.get_one::>("start-time") + { + request = request.start_time(value.clone()); + } + + self.config.execute_silo_metric(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } } } - pub async fn execute_instance_disk_list( + pub async fn execute_instance_network_interface_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_disk_list(); + let mut request = self.client.instance_network_interface_list(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } @@ -8303,8 +10961,9 @@ impl Cli { } self.config - .execute_instance_disk_list(matches, &mut request)?; - self.config.list_start::(); + .execute_instance_network_interface_list(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -8318,7 +10977,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -8328,69 +10988,48 @@ impl Cli { } } - pub async fn execute_instance_disk_attach( + pub async fn execute_instance_network_interface_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_disk_attach(); - if let Some(value) = matches.get_one::("disk") { - request = request.body_map(|body| body.disk(value.clone())) + let mut request = self.client.instance_network_interface_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) } if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("ip") { + request = request.body_map(|body| body.ip(value.clone())) } - self.config - .execute_instance_disk_attach(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) } - } - pub async fn execute_instance_disk_detach( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.instance_disk_detach(); - if let Some(value) = matches.get_one::("disk") { - request = request.body_map(|body| body.disk(value.clone())) + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); + if let Some(value) = matches.get_one::("subnet-name") { + request = request.body_map(|body| body.subnet_name(value.clone())) } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("vpc-name") { + request = request.body_map(|body| body.vpc_name(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_instance_disk_detach(matches, &mut request)?; + .execute_instance_network_interface_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8404,21 +11043,25 @@ impl Cli { } } - pub async fn execute_instance_external_ip_list( + pub async fn execute_instance_network_interface_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_external_ip_list(); + let mut request = self.client.instance_network_interface_view(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } + if let Some(value) = matches.get_one::("interface") { + request = request.interface(value.clone()); + } + if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } self.config - .execute_instance_external_ip_list(matches, &mut request)?; + .execute_instance_network_interface_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8432,17 +11075,29 @@ impl Cli { } } - pub async fn execute_instance_ephemeral_ip_attach( + pub async fn execute_instance_network_interface_update( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_ephemeral_ip_attach(); + let mut request = self.client.instance_network_interface_update(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } - if let Some(value) = matches.get_one::("pool") { - request = request.body_map(|body| body.pool(value.clone())) + if let Some(value) = matches.get_one::("interface") { + request = request.interface(value.clone()); + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("primary") { + request = request.body_map(|body| body.primary(value.clone())) } if let Some(value) = matches.get_one::("project") { @@ -8451,12 +11106,13 @@ impl Cli { if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_instance_ephemeral_ip_attach(matches, &mut request)?; + .execute_instance_network_interface_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8470,21 +11126,25 @@ impl Cli { } } - pub async fn execute_instance_ephemeral_ip_detach( + pub async fn execute_instance_network_interface_delete( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_ephemeral_ip_detach(); + let mut request = self.client.instance_network_interface_delete(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } + if let Some(value) = matches.get_one::("interface") { + request = request.interface(value.clone()); + } + if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } self.config - .execute_instance_ephemeral_ip_detach(matches, &mut request)?; + .execute_instance_network_interface_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8498,17 +11158,9 @@ impl Cli { } } - pub async fn execute_instance_reboot(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_reboot(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config.execute_instance_reboot(matches, &mut request)?; + pub async fn execute_ping(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.ping(); + self.config.execute_ping(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8522,33 +11174,9 @@ impl Cli { } } - pub async fn execute_instance_serial_console( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.instance_serial_console(); - if let Some(value) = matches.get_one::("from-start") { - request = request.from_start(value.clone()); - } - - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("max-bytes") { - request = request.max_bytes(value.clone()); - } - - if let Some(value) = matches.get_one::("most-recent") { - request = request.most_recent(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config - .execute_instance_serial_console(matches, &mut request)?; + pub async fn execute_policy_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.policy_view(); + self.config.execute_policy_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8562,60 +11190,40 @@ impl Cli { } } - pub async fn execute_instance_serial_console_stream( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.instance_serial_console_stream(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("most-recent") { - request = request.most_recent(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + pub async fn execute_policy_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.policy_update(); + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } - self.config - .execute_instance_serial_console_stream(matches, &mut request)?; + self.config.execute_policy_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - todo!() + self.config.success_item(&r); + Ok(()) } Err(r) => { - todo!() + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_instance_ssh_public_key_list( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.instance_ssh_public_key_list(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - + pub async fn execute_project_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.project_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - self.config - .execute_instance_ssh_public_key_list(matches, &mut request)?; - self.config.list_start::(); + self.config.execute_project_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -8629,7 +11237,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -8639,17 +11247,121 @@ impl Cli { } } - pub async fn execute_instance_start(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_start(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); + pub async fn execute_project_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.project_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } + self.config.execute_project_create(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_project_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.project_view(); if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - self.config.execute_instance_start(matches, &mut request)?; + self.config.execute_project_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_project_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.project_update(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config.execute_project_update(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_project_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.project_delete(); + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config.execute_project_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_project_policy_view( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.project_policy_view(); + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_project_policy_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8663,17 +11375,23 @@ impl Cli { } } - pub async fn execute_instance_stop(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.instance_stop(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - + pub async fn execute_project_policy_update( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.project_policy_update(); if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - self.config.execute_instance_stop(matches, &mut request)?; + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_project_policy_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8687,15 +11405,8 @@ impl Cli { } } - pub async fn execute_internet_gateway_ip_address_list( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_ip_address_list(); - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); - } - + pub async fn execute_snapshot_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.snapshot_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } @@ -8708,14 +11419,8 @@ impl Cli { request = request.sort_by(value.clone()); } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); - } - - self.config - .execute_internet_gateway_ip_address_list(matches, &mut request)?; - self.config - .list_start::(); + self.config.execute_snapshot_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -8729,8 +11434,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config - .list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -8740,21 +11444,14 @@ impl Cli { } } - pub async fn execute_internet_gateway_ip_address_create( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_ip_address_create(); - if let Some(value) = matches.get_one::("address") { - request = request.body_map(|body| body.address(value.clone())) - } - + pub async fn execute_snapshot_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.snapshot_create(); if let Some(value) = matches.get_one::("description") { request = request.body_map(|body| body.description(value.clone())) } - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); + if let Some(value) = matches.get_one::("disk") { + request = request.body_map(|body| body.disk(value.clone())) } if let Some(value) = matches.get_one::("name") { @@ -8765,19 +11462,13 @@ impl Cli { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); - } - if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config - .execute_internet_gateway_ip_address_create(matches, &mut request)?; + self.config.execute_snapshot_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8791,33 +11482,41 @@ impl Cli { } } - pub async fn execute_internet_gateway_ip_address_delete( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_ip_address_delete(); - if let Some(value) = matches.get_one::("address") { - request = request.address(value.clone()); + pub async fn execute_snapshot_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.snapshot_view(); + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("cascade") { - request = request.cascade(value.clone()); + if let Some(value) = matches.get_one::("snapshot") { + request = request.snapshot(value.clone()); } - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); + self.config.execute_snapshot_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } } + } + pub async fn execute_snapshot_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.snapshot_delete(); if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); + if let Some(value) = matches.get_one::("snapshot") { + request = request.snapshot(value.clone()); } - self.config - .execute_internet_gateway_ip_address_delete(matches, &mut request)?; + self.config.execute_snapshot_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8831,35 +11530,22 @@ impl Cli { } } - pub async fn execute_internet_gateway_ip_pool_list( + pub async fn execute_physical_disk_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_ip_pool_list(); - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); - } - + let mut request = self.client.physical_disk_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); - } - - self.config - .execute_internet_gateway_ip_pool_list(matches, &mut request)?; self.config - .list_start::(); + .execute_physical_disk_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -8874,7 +11560,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -8884,44 +11570,17 @@ impl Cli { } } - pub async fn execute_internet_gateway_ip_pool_create( + pub async fn execute_physical_disk_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_ip_pool_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); - } - - if let Some(value) = matches.get_one::("ip-pool") { - request = request.body_map(|body| body.ip_pool(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + let mut request = self.client.physical_disk_view(); + if let Some(value) = matches.get_one::("disk-id") { + request = request.disk_id(value.clone()); } self.config - .execute_internet_gateway_ip_pool_create(matches, &mut request)?; + .execute_physical_disk_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -8935,71 +11594,18 @@ impl Cli { } } - pub async fn execute_internet_gateway_ip_pool_delete( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_ip_pool_delete(); - if let Some(value) = matches.get_one::("cascade") { - request = request.cascade(value.clone()); - } - - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); - } - - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); - } - - self.config - .execute_internet_gateway_ip_pool_delete(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_internet_gateway_list( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_list(); + pub async fn execute_rack_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.rack_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); - } - - self.config - .execute_internet_gateway_list(matches, &mut request)?; - self.config - .list_start::(); + self.config.execute_rack_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9013,8 +11619,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config - .list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9024,36 +11629,47 @@ impl Cli { } } - pub async fn execute_internet_gateway_create( + pub async fn execute_rack_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.rack_view(); + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); + } + + self.config.execute_rack_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_networking_switch_port_active_configuration_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + let mut request = self + .client + .networking_switch_port_active_configuration_view(); + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("switch") { + request = request.switch(value.clone()); } self.config - .execute_internet_gateway_create(matches, &mut request)?; + .execute_networking_switch_port_active_configuration_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9067,29 +11683,42 @@ impl Cli { } } - pub async fn execute_internet_gateway_view( + pub async fn execute_networking_switch_port_active_configuration_set( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_view(); - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); + let mut request = self + .client + .networking_switch_port_active_configuration_set(); + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("port-settings") { + request = request.body_map(|body| body.port_settings(value.clone())) } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); + } + + if let Some(value) = matches.get_one::("switch") { + request = request.switch(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_internet_gateway_view(matches, &mut request)?; + .execute_networking_switch_port_active_configuration_set(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -9099,29 +11728,27 @@ impl Cli { } } - pub async fn execute_internet_gateway_delete( + pub async fn execute_networking_switch_port_active_configuration_clear( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.internet_gateway_delete(); - if let Some(value) = matches.get_one::("cascade") { - request = request.cascade(value.clone()); - } - - if let Some(value) = matches.get_one::("gateway") { - request = request.gateway(value.clone()); + let mut request = self + .client + .networking_switch_port_active_configuration_clear(); + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); } - if let Some(value) = matches.get_one::("vpc") { - request = request.vpc(value.clone()); + if let Some(value) = matches.get_one::("switch") { + request = request.switch(value.clone()); } self.config - .execute_internet_gateway_delete(matches, &mut request)?; + .execute_networking_switch_port_active_configuration_clear(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9135,22 +11762,18 @@ impl Cli { } } - pub async fn execute_project_ip_pool_list( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.project_ip_pool_list(); + pub async fn execute_sled_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.sled_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - self.config - .execute_project_ip_pool_list(matches, &mut request)?; - self.config.list_start::(); + self.config.execute_sled_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9164,8 +11787,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config - .list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9175,56 +11797,27 @@ impl Cli { } } - pub async fn execute_project_ip_pool_view( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.project_ip_pool_view(); - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); - } - - self.config - .execute_project_ip_pool_view(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_login_local(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.login_local(); - if let Some(value) = matches.get_one::("password") { - request = request.body_map(|body| body.password(value.clone())) - } - - if let Some(value) = matches.get_one::("silo-name") { - request = request.silo_name(value.clone()); + pub async fn execute_sled_add(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.sled_add(); + if let Some(value) = matches.get_one::("part") { + request = request.body_map(|body| body.part(value.clone())) } - if let Some(value) = matches.get_one::("username") { - request = request.body_map(|body| body.username(value.clone())) + if let Some(value) = matches.get_one::("serial") { + request = request.body_map(|body| body.serial(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_login_local(matches, &mut request)?; + self.config.execute_sled_add(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -9234,29 +11827,13 @@ impl Cli { } } - pub async fn execute_logout(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.logout(); - self.config.execute_logout(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + pub async fn execute_sled_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.sled_view(); + if let Some(value) = matches.get_one::("sled-id") { + request = request.sled_id(value.clone()); } - } - pub async fn execute_current_user_view( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.current_user_view(); - self.config - .execute_current_user_view(matches, &mut request)?; + self.config.execute_sled_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9270,22 +11847,26 @@ impl Cli { } } - pub async fn execute_current_user_groups( + pub async fn execute_sled_physical_disk_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.current_user_groups(); + let mut request = self.client.sled_physical_disk_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } + if let Some(value) = matches.get_one::("sled-id") { + request = request.sled_id(value.clone()); + } + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } self.config - .execute_current_user_groups(matches, &mut request)?; - self.config.list_start::(); + .execute_sled_physical_disk_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9299,7 +11880,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9309,22 +11891,26 @@ impl Cli { } } - pub async fn execute_current_user_ssh_key_list( + pub async fn execute_sled_instance_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_list(); + let mut request = self.client.sled_instance_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { + if let Some(value) = matches.get_one::("sled-id") { + request = request.sled_id(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } self.config - .execute_current_user_ssh_key_list(matches, &mut request)?; - self.config.list_start::(); + .execute_sled_instance_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9338,7 +11924,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9348,83 +11935,32 @@ impl Cli { } } - pub async fn execute_current_user_ssh_key_create( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) - } - - if let Some(value) = matches.get_one::("public-key") { - request = request.body_map(|body| body.public_key(value.clone())) - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); - } - - self.config - .execute_current_user_ssh_key_create(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_current_user_ssh_key_view( + pub async fn execute_sled_set_provision_policy( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_view(); - if let Some(value) = matches.get_one::("ssh-key") { - request = request.ssh_key(value.clone()); - } - - self.config - .execute_current_user_ssh_key_view(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + let mut request = self.client.sled_set_provision_policy(); + if let Some(value) = matches.get_one::("sled-id") { + request = request.sled_id(value.clone()); } - } - pub async fn execute_current_user_ssh_key_delete( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_delete(); - if let Some(value) = matches.get_one::("ssh-key") { - request = request.ssh_key(value.clone()); + if let Some(value) = matches.get_one::("state") { + request = request.body_map(|body| body.state(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_current_user_ssh_key_delete(matches, &mut request)?; + .execute_sled_set_provision_policy(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -9434,35 +11970,19 @@ impl Cli { } } - pub async fn execute_silo_metric(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.silo_metric(); - if let Some(value) = matches.get_one::>("end-time") { - request = request.end_time(value.clone()); - } - + pub async fn execute_sled_list_uninitialized( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.sled_list_uninitialized(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("metric-name") { - request = request.metric_name(value.clone()); - } - - if let Some(value) = matches.get_one::("order") { - request = request.order(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::>("start-time") - { - request = request.start_time(value.clone()); - } - - self.config.execute_silo_metric(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_sled_list_uninitialized(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9477,7 +11997,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9487,31 +12007,26 @@ impl Cli { } } - pub async fn execute_instance_network_interface_list( + pub async fn execute_networking_switch_port_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_network_interface_list(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - + let mut request = self.client.networking_switch_port_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + if let Some(value) = matches.get_one::("switch-port-id") { + request = request.switch_port_id(value.clone()); } self.config - .execute_instance_network_interface_list(matches, &mut request)?; - self.config - .list_start::(); + .execute_networking_switch_port_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9526,7 +12041,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9536,52 +12051,40 @@ impl Cli { } } - pub async fn execute_instance_network_interface_create( + pub async fn execute_networking_switch_port_apply_settings( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_network_interface_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("ip") { - request = request.body_map(|body| body.ip(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + let mut request = self.client.networking_switch_port_apply_settings(); + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("port-settings") { + request = request.body_map(|body| body.port_settings(value.clone())) } - if let Some(value) = matches.get_one::("subnet-name") { - request = request.body_map(|body| body.subnet_name(value.clone())) + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); } - if let Some(value) = matches.get_one::("vpc-name") { - request = request.body_map(|body| body.vpc_name(value.clone())) + if let Some(value) = matches.get_one::("switch-location") { + request = request.switch_location(value.clone()); } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); let body_value = - serde_json::from_str::(&body_txt).unwrap(); + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_instance_network_interface_create(matches, &mut request)?; + .execute_networking_switch_port_apply_settings(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -9591,29 +12094,29 @@ impl Cli { } } - pub async fn execute_instance_network_interface_view( + pub async fn execute_networking_switch_port_clear_settings( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_network_interface_view(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); + let mut request = self.client.networking_switch_port_clear_settings(); + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); } - if let Some(value) = matches.get_one::("interface") { - request = request.interface(value.clone()); + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("switch-location") { + request = request.switch_location(value.clone()); } self.config - .execute_instance_network_interface_view(matches, &mut request)?; + .execute_networking_switch_port_clear_settings(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -9623,44 +12126,25 @@ impl Cli { } } - pub async fn execute_instance_network_interface_update( + pub async fn execute_networking_switch_port_status( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_network_interface_update(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("interface") { - request = request.interface(value.clone()); - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) - } - - if let Some(value) = matches.get_one::("primary") { - request = request.body_map(|body| body.primary(value.clone())) + let mut request = self.client.networking_switch_port_status(); + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("switch-location") { + request = request.switch_location(value.clone()); } self.config - .execute_instance_network_interface_update(matches, &mut request)?; + .execute_networking_switch_port_status(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9674,79 +12158,48 @@ impl Cli { } } - pub async fn execute_instance_network_interface_delete( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.instance_network_interface_delete(); - if let Some(value) = matches.get_one::("instance") { - request = request.instance(value.clone()); - } - - if let Some(value) = matches.get_one::("interface") { - request = request.interface(value.clone()); - } - - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config - .execute_instance_network_interface_delete(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + pub async fn execute_switch_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.switch_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); } - } - pub async fn execute_ping(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.ping(); - self.config.execute_ping(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); } - } - pub async fn execute_policy_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.policy_view(); - self.config.execute_policy_view(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) + self.config.execute_switch_list(matches, &mut request)?; + self.config.list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config.list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } } } } - pub async fn execute_policy_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.policy_update(); - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + pub async fn execute_switch_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.switch_view(); + if let Some(value) = matches.get_one::("switch-id") { + request = request.switch_id(value.clone()); } - self.config.execute_policy_update(matches, &mut request)?; + self.config.execute_switch_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9760,18 +12213,27 @@ impl Cli { } } - pub async fn execute_project_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.project_list(); + pub async fn execute_silo_identity_provider_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.silo_identity_provider_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); + } + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - self.config.execute_project_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_silo_identity_provider_list(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9785,7 +12247,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9795,23 +12258,27 @@ impl Cli { } } - pub async fn execute_project_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.project_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) + pub async fn execute_local_idp_user_create( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.local_idp_user_create(); + if let Some(value) = matches.get_one::("external-id") { + request = request.body_map(|body| body.external_id(value.clone())) } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_project_create(matches, &mut request)?; + self.config + .execute_local_idp_user_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9825,17 +12292,25 @@ impl Cli { } } - pub async fn execute_project_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.project_view(); - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + pub async fn execute_local_idp_user_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.local_idp_user_delete(); + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); } - self.config.execute_project_view(matches, &mut request)?; + if let Some(value) = matches.get_one::("user-id") { + request = request.user_id(value.clone()); + } + + self.config + .execute_local_idp_user_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -9845,47 +12320,27 @@ impl Cli { } } - pub async fn execute_project_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.project_update(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + pub async fn execute_local_idp_user_set_password( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.local_idp_user_set_password(); + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("user-id") { + request = request.user_id(value.clone()); } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_project_update(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_project_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.project_delete(); - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - self.config.execute_project_delete(matches, &mut request)?; + self.config + .execute_local_idp_user_set_password(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9899,17 +12354,56 @@ impl Cli { } } - pub async fn execute_project_policy_view( + pub async fn execute_saml_identity_provider_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.project_policy_view(); - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + let mut request = self.client.saml_identity_provider_create(); + if let Some(value) = matches.get_one::("acs-url") { + request = request.body_map(|body| body.acs_url(value.clone())) + } + + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("group-attribute-name") { + request = request.body_map(|body| body.group_attribute_name(value.clone())) + } + + if let Some(value) = matches.get_one::("idp-entity-id") { + request = request.body_map(|body| body.idp_entity_id(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); + } + + if let Some(value) = matches.get_one::("slo-url") { + request = request.body_map(|body| body.slo_url(value.clone())) + } + + if let Some(value) = matches.get_one::("sp-client-id") { + request = request.body_map(|body| body.sp_client_id(value.clone())) + } + + if let Some(value) = matches.get_one::("technical-contact-email") { + request = request.body_map(|body| body.technical_contact_email(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_project_policy_view(matches, &mut request)?; + .execute_saml_identity_provider_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9923,23 +12417,21 @@ impl Cli { } } - pub async fn execute_project_policy_update( + pub async fn execute_saml_identity_provider_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.project_policy_update(); - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + let mut request = self.client.saml_identity_provider_view(); + if let Some(value) = matches.get_one::("provider") { + request = request.provider(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); } self.config - .execute_project_policy_update(matches, &mut request)?; + .execute_saml_identity_provider_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -9953,22 +12445,18 @@ impl Cli { } } - pub async fn execute_snapshot_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.snapshot_list(); + pub async fn execute_ip_pool_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - self.config.execute_snapshot_list(matches, &mut request)?; - self.config.list_start::(); + self.config.execute_ip_pool_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -9982,7 +12470,7 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config.list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -9992,31 +12480,23 @@ impl Cli { } } - pub async fn execute_snapshot_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.snapshot_create(); + pub async fn execute_ip_pool_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_create(); if let Some(value) = matches.get_one::("description") { request = request.body_map(|body| body.description(value.clone())) } - if let Some(value) = matches.get_one::("disk") { - request = request.body_map(|body| body.disk(value.clone())) - } - if let Some(value) = matches.get_one::("name") { request = request.body_map(|body| body.name(value.clone())) } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_snapshot_create(matches, &mut request)?; + self.config.execute_ip_pool_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10030,17 +12510,13 @@ impl Cli { } } - pub async fn execute_snapshot_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.snapshot_view(); - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); - } - - if let Some(value) = matches.get_one::("snapshot") { - request = request.snapshot(value.clone()); + pub async fn execute_ip_pool_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_view(); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } - self.config.execute_snapshot_view(matches, &mut request)?; + self.config.execute_ip_pool_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10054,17 +12530,47 @@ impl Cli { } } - pub async fn execute_snapshot_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.snapshot_delete(); - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + pub async fn execute_ip_pool_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_update(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) } - if let Some(value) = matches.get_one::("snapshot") { - request = request.snapshot(value.clone()); + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config.execute_ip_pool_update(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_ip_pool_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_delete(); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } - self.config.execute_snapshot_delete(matches, &mut request)?; + self.config.execute_ip_pool_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10078,22 +12584,22 @@ impl Cli { } } - pub async fn execute_physical_disk_list( + pub async fn execute_ip_pool_range_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.physical_disk_list(); + let mut request = self.client.ip_pool_range_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } self.config - .execute_physical_disk_list(matches, &mut request)?; - self.config.list_start::(); + .execute_ip_pool_range_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -10108,7 +12614,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -10118,17 +12624,23 @@ impl Cli { } } - pub async fn execute_physical_disk_view( + pub async fn execute_ip_pool_range_add( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.physical_disk_view(); - if let Some(value) = matches.get_one::("disk-id") { - request = request.disk_id(value.clone()); + let mut request = self.client.ip_pool_range_add(); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_physical_disk_view(matches, &mut request)?; + .execute_ip_pool_range_add(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10142,52 +12654,27 @@ impl Cli { } } - pub async fn execute_rack_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.rack_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); - } - - self.config.execute_rack_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config.list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } - } + pub async fn execute_ip_pool_range_remove( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_range_remove(); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } - } - pub async fn execute_rack_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.rack_view(); - if let Some(value) = matches.get_one::("rack-id") { - request = request.rack_id(value.clone()); + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } - self.config.execute_rack_view(matches, &mut request)?; + self.config + .execute_ip_pool_range_remove(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -10197,18 +12684,26 @@ impl Cli { } } - pub async fn execute_sled_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.sled_list(); + pub async fn execute_ip_pool_silo_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_silo_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); + } + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - self.config.execute_sled_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_ip_pool_silo_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -10222,7 +12717,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -10232,23 +12728,31 @@ impl Cli { } } - pub async fn execute_sled_add(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.sled_add(); - if let Some(value) = matches.get_one::("part") { - request = request.body_map(|body| body.part(value.clone())) + pub async fn execute_ip_pool_silo_link( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_silo_link(); + if let Some(value) = matches.get_one::("is-default") { + request = request.body_map(|body| body.is_default(value.clone())) } - if let Some(value) = matches.get_one::("serial") { - request = request.body_map(|body| body.serial(value.clone())) + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); + } + + if let Some(value) = matches.get_one::("silo") { + request = request.body_map(|body| body.silo(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_sled_add(matches, &mut request)?; + self.config + .execute_ip_pool_silo_link(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10262,13 +12766,31 @@ impl Cli { } } - pub async fn execute_sled_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.sled_view(); - if let Some(value) = matches.get_one::("sled-id") { - request = request.sled_id(value.clone()); + pub async fn execute_ip_pool_silo_update( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_silo_update(); + if let Some(value) = matches.get_one::("is-default") { + request = request.body_map(|body| body.is_default(value.clone())) } - self.config.execute_sled_view(matches, &mut request)?; + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); + } + + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_ip_pool_silo_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10282,70 +12804,90 @@ impl Cli { } } - pub async fn execute_sled_physical_disk_list( + pub async fn execute_ip_pool_silo_unlink( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.sled_physical_disk_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("sled-id") { - request = request.sled_id(value.clone()); + let mut request = self.client.ip_pool_silo_unlink(); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); } self.config - .execute_sled_physical_disk_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + .execute_ip_pool_silo_unlink(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_sled_instance_list( + pub async fn execute_ip_pool_utilization_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.sled_instance_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); + let mut request = self.client.ip_pool_utilization_view(); + if let Some(value) = matches.get_one::("pool") { + request = request.pool(value.clone()); } - if let Some(value) = matches.get_one::("sled-id") { - request = request.sled_id(value.clone()); + self.config + .execute_ip_pool_utilization_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } } + } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + pub async fn execute_ip_pool_service_view( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_service_view(); + self.config + .execute_ip_pool_service_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_ip_pool_service_range_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.ip_pool_service_range_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); } self.config - .execute_sled_instance_list(matches, &mut request)?; - self.config.list_start::(); + .execute_ip_pool_service_range_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -10360,7 +12902,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -10370,28 +12912,19 @@ impl Cli { } } - pub async fn execute_sled_set_provision_policy( + pub async fn execute_ip_pool_service_range_add( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.sled_set_provision_policy(); - if let Some(value) = matches.get_one::("sled-id") { - request = request.sled_id(value.clone()); - } - - if let Some(value) = matches.get_one::("state") { - request = request.body_map(|body| body.state(value.clone())) - } - + let mut request = self.client.ip_pool_service_range_add(); if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_sled_set_provision_policy(matches, &mut request)?; + .execute_ip_pool_service_range_add(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10405,19 +12938,61 @@ impl Cli { } } - pub async fn execute_sled_list_uninitialized( + pub async fn execute_ip_pool_service_range_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.sled_list_uninitialized(); + let mut request = self.client.ip_pool_service_range_remove(); + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_ip_pool_service_range_remove(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_system_metric(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.system_metric(); + if let Some(value) = matches.get_one::>("end-time") { + request = request.end_time(value.clone()); + } + if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - self.config - .execute_sled_list_uninitialized(matches, &mut request)?; - self.config - .list_start::(); + if let Some(value) = matches.get_one::("metric-name") { + request = request.metric_name(value.clone()); + } + + if let Some(value) = matches.get_one::("order") { + request = request.order(value.clone()); + } + + if let Some(value) = matches.get_one::("silo") { + request = request.silo(value.clone()); + } + + if let Some(value) = matches.get_one::>("start-time") + { + request = request.start_time(value.clone()); + } + + self.config.execute_system_metric(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -10432,7 +13007,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -10442,26 +13017,22 @@ impl Cli { } } - pub async fn execute_networking_switch_port_list( + pub async fn execute_networking_address_lot_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_list(); + let mut request = self.client.networking_address_lot_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { + if let Some(value) = matches.get_one::("sort-by") { request = request.sort_by(value.clone()); } - if let Some(value) = matches.get_one::("switch-port-id") { - request = request.switch_port_id(value.clone()); - } - self.config - .execute_networking_switch_port_list(matches, &mut request)?; - self.config.list_start::(); + .execute_networking_address_lot_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -10476,7 +13047,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -10486,40 +13057,35 @@ impl Cli { } } - pub async fn execute_networking_switch_port_apply_settings( + pub async fn execute_networking_address_lot_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_apply_settings(); - if let Some(value) = matches.get_one::("port") { - request = request.port(value.clone()); - } - - if let Some(value) = matches.get_one::("port-settings") { - request = request.body_map(|body| body.port_settings(value.clone())) + let mut request = self.client.networking_address_lot_create(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) } - if let Some(value) = matches.get_one::("rack-id") { - request = request.rack_id(value.clone()); + if let Some(value) = matches.get_one::("kind") { + request = request.body_map(|body| body.kind(value.clone())) } - if let Some(value) = matches.get_one::("switch-location") { - request = request.switch_location(value.clone()); + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_switch_port_apply_settings(matches, &mut request)?; + .execute_networking_address_lot_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -10529,25 +13095,17 @@ impl Cli { } } - pub async fn execute_networking_switch_port_clear_settings( + pub async fn execute_networking_address_lot_delete( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_clear_settings(); - if let Some(value) = matches.get_one::("port") { - request = request.port(value.clone()); - } - - if let Some(value) = matches.get_one::("rack-id") { - request = request.rack_id(value.clone()); - } - - if let Some(value) = matches.get_one::("switch-location") { - request = request.switch_location(value.clone()); + let mut request = self.client.networking_address_lot_delete(); + if let Some(value) = matches.get_one::("address-lot") { + request = request.address_lot(value.clone()); } self.config - .execute_networking_switch_port_clear_settings(matches, &mut request)?; + .execute_networking_address_lot_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10561,40 +13119,15 @@ impl Cli { } } - pub async fn execute_networking_switch_port_status( + pub async fn execute_networking_address_lot_block_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_status(); - if let Some(value) = matches.get_one::("port") { - request = request.port(value.clone()); - } - - if let Some(value) = matches.get_one::("rack-id") { - request = request.rack_id(value.clone()); - } - - if let Some(value) = matches.get_one::("switch-location") { - request = request.switch_location(value.clone()); - } - - self.config - .execute_networking_switch_port_status(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + let mut request = self.client.networking_address_lot_block_list(); + if let Some(value) = matches.get_one::("address-lot") { + request = request.address_lot(value.clone()); } - } - pub async fn execute_switch_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.switch_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } @@ -10603,8 +13136,10 @@ impl Cli { request = request.sort_by(value.clone()); } - self.config.execute_switch_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_networking_address_lot_block_list(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -10618,7 +13153,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -10628,13 +13164,32 @@ impl Cli { } } - pub async fn execute_switch_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.switch_view(); - if let Some(value) = matches.get_one::("switch-id") { - request = request.switch_id(value.clone()); + pub async fn execute_networking_address_lot_block_add( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_address_lot_block_add(); + if let Some(value) = matches.get_one::("address-lot") { + request = request.address_lot(value.clone()); } - self.config.execute_switch_view(matches, &mut request)?; + if let Some(value) = matches.get_one::("first-address") { + request = request.body_map(|body| body.first_address(value.clone())) + } + + if let Some(value) = matches.get_one::("last-address") { + request = request.body_map(|body| body.last_address(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_networking_address_lot_block_add(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10648,76 +13203,36 @@ impl Cli { } } - pub async fn execute_silo_identity_provider_list( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.silo_identity_provider_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); - } - - self.config - .execute_silo_identity_provider_list(matches, &mut request)?; - self.config - .list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } - } - } - } - - pub async fn execute_local_idp_user_create( + pub async fn execute_networking_address_lot_block_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.local_idp_user_create(); - if let Some(value) = matches.get_one::("external-id") { - request = request.body_map(|body| body.external_id(value.clone())) + let mut request = self.client.networking_address_lot_block_remove(); + if let Some(value) = matches.get_one::("address-lot") { + request = request.address_lot(value.clone()); } - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); + if let Some(value) = matches.get_one::("first-address") { + request = request.body_map(|body| body.first_address(value.clone())) + } + + if let Some(value) = matches.get_one::("last-address") { + request = request.body_map(|body| body.last_address(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_local_idp_user_create(matches, &mut request)?; + .execute_networking_address_lot_block_remove(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -10727,25 +13242,43 @@ impl Cli { } } - pub async fn execute_local_idp_user_delete( + pub async fn execute_networking_allow_list_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.local_idp_user_delete(); - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); + let mut request = self.client.networking_allow_list_view(); + self.config + .execute_networking_allow_list_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } } + } - if let Some(value) = matches.get_one::("user-id") { - request = request.user_id(value.clone()); + pub async fn execute_networking_allow_list_update( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_allow_list_update(); + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_local_idp_user_delete(matches, &mut request)?; + .execute_networking_allow_list_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -10755,27 +13288,27 @@ impl Cli { } } - pub async fn execute_local_idp_user_set_password( + pub async fn execute_networking_bfd_disable( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.local_idp_user_set_password(); - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); + let mut request = self.client.networking_bfd_disable(); + if let Some(value) = matches.get_one::("remote") { + request = request.body_map(|body| body.remote(value.clone())) } - if let Some(value) = matches.get_one::("user-id") { - request = request.user_id(value.clone()); + if let Some(value) = matches.get_one::("switch") { + request = request.body_map(|body| body.switch(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_local_idp_user_set_password(matches, &mut request)?; + .execute_networking_bfd_disable(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10789,60 +13322,47 @@ impl Cli { } } - pub async fn execute_saml_identity_provider_create( + pub async fn execute_networking_bfd_enable( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.saml_identity_provider_create(); - if let Some(value) = matches.get_one::("acs-url") { - request = request.body_map(|body| body.acs_url(value.clone())) - } - - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("group-attribute-name") { - request = request.body_map(|body| body.group_attribute_name(value.clone())) - } - - if let Some(value) = matches.get_one::("idp-entity-id") { - request = request.body_map(|body| body.idp_entity_id(value.clone())) + let mut request = self.client.networking_bfd_enable(); + if let Some(value) = matches.get_one::("detection-threshold") { + request = request.body_map(|body| body.detection_threshold(value.clone())) } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + if let Some(value) = matches.get_one::("local") { + request = request.body_map(|body| body.local(value.clone())) } - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); + if let Some(value) = matches.get_one::("mode") { + request = request.body_map(|body| body.mode(value.clone())) } - if let Some(value) = matches.get_one::("slo-url") { - request = request.body_map(|body| body.slo_url(value.clone())) + if let Some(value) = matches.get_one::("remote") { + request = request.body_map(|body| body.remote(value.clone())) } - if let Some(value) = matches.get_one::("sp-client-id") { - request = request.body_map(|body| body.sp_client_id(value.clone())) + if let Some(value) = matches.get_one::("required-rx") { + request = request.body_map(|body| body.required_rx(value.clone())) } - if let Some(value) = matches.get_one::("technical-contact-email") { - request = request.body_map(|body| body.technical_contact_email(value.clone())) + if let Some(value) = matches.get_one::("switch") { + request = request.body_map(|body| body.switch(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_saml_identity_provider_create(matches, &mut request)?; + .execute_networking_bfd_enable(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -10852,21 +13372,13 @@ impl Cli { } } - pub async fn execute_saml_identity_provider_view( + pub async fn execute_networking_bfd_status( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.saml_identity_provider_view(); - if let Some(value) = matches.get_one::("provider") { - request = request.provider(value.clone()); - } - - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); - } - + let mut request = self.client.networking_bfd_status(); self.config - .execute_saml_identity_provider_view(matches, &mut request)?; + .execute_networking_bfd_status(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10880,8 +13392,11 @@ impl Cli { } } - pub async fn execute_ip_pool_list(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_list(); + pub async fn execute_networking_bgp_config_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_bgp_config_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } @@ -10890,8 +13405,9 @@ impl Cli { request = request.sort_by(value.clone()); } - self.config.execute_ip_pool_list(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_networking_bgp_config_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -10905,7 +13421,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -10915,58 +13432,19 @@ impl Cli { } } - pub async fn execute_ip_pool_create(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) - } - - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); - } - - self.config.execute_ip_pool_create(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_ip_pool_view(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_view(); - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); + pub async fn execute_networking_bgp_config_create( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_bgp_config_create(); + if let Some(value) = matches.get_one::("asn") { + request = request.body_map(|body| body.asn(value.clone())) } - self.config.execute_ip_pool_view(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + if let Some(value) = matches.get_one::("bgp-announce-set-id") { + request = request.body_map(|body| body.bgp_announce_set_id(value.clone())) } - } - pub async fn execute_ip_pool_update(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_update(); if let Some(value) = matches.get_one::("description") { request = request.body_map(|body| body.description(value.clone())) } @@ -10975,17 +13453,18 @@ impl Cli { request = request.body_map(|body| body.name(value.clone())) } - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); + if let Some(value) = matches.get_one::("vrf") { + request = request.body_map(|body| body.vrf(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } - self.config.execute_ip_pool_update(matches, &mut request)?; + self.config + .execute_networking_bgp_config_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -10999,13 +13478,17 @@ impl Cli { } } - pub async fn execute_ip_pool_delete(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_delete(); - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); + pub async fn execute_networking_bgp_config_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_bgp_config_delete(); + if let Some(value) = matches.get_one::("bgp-config") { + request = request.bgp_config(value.clone()); } - self.config.execute_ip_pool_delete(matches, &mut request)?; + self.config + .execute_networking_bgp_config_delete(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11019,63 +13502,25 @@ impl Cli { } } - pub async fn execute_ip_pool_range_list( + pub async fn execute_networking_bgp_announce_set_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_range_list(); + let mut request = self.client.networking_bgp_announce_set_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); - } - - self.config - .execute_ip_pool_range_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } - } - } - } - - pub async fn execute_ip_pool_range_add( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_range_add(); - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); + if let Some(value) = matches.get_one::("page-token") { + request = request.page_token(value.clone()); } - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); } self.config - .execute_ip_pool_range_add(matches, &mut request)?; + .execute_networking_bgp_announce_set_list(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11089,27 +13534,32 @@ impl Cli { } } - pub async fn execute_ip_pool_range_remove( + pub async fn execute_networking_bgp_announce_set_update( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_range_remove(); - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); + let mut request = self.client.networking_bgp_announce_set_update(); + if let Some(value) = matches.get_one::("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_ip_pool_range_remove(matches, &mut request)?; + .execute_networking_bgp_announce_set_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -11119,75 +13569,41 @@ impl Cli { } } - pub async fn execute_ip_pool_silo_list( + pub async fn execute_networking_bgp_announce_set_delete( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_silo_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + let mut request = self.client.networking_bgp_announce_set_delete(); + if let Some(value) = matches.get_one::("announce-set") { + request = request.announce_set(value.clone()); } self.config - .execute_ip_pool_silo_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + .execute_networking_bgp_announce_set_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_ip_pool_silo_link( + pub async fn execute_networking_bgp_announcement_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_silo_link(); - if let Some(value) = matches.get_one::("is-default") { - request = request.body_map(|body| body.is_default(value.clone())) - } - - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); - } - - if let Some(value) = matches.get_one::("silo") { - request = request.body_map(|body| body.silo(value.clone())) - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + let mut request = self.client.networking_bgp_announcement_list(); + if let Some(value) = matches.get_one::("announce-set") { + request = request.announce_set(value.clone()); } self.config - .execute_ip_pool_silo_link(matches, &mut request)?; + .execute_networking_bgp_announcement_list(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11201,31 +13617,13 @@ impl Cli { } } - pub async fn execute_ip_pool_silo_update( + pub async fn execute_networking_bgp_exported( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_silo_update(); - if let Some(value) = matches.get_one::("is-default") { - request = request.body_map(|body| body.is_default(value.clone())) - } - - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); - } - - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); - } - + let mut request = self.client.networking_bgp_exported(); self.config - .execute_ip_pool_silo_update(matches, &mut request)?; + .execute_networking_bgp_exported(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11239,25 +13637,21 @@ impl Cli { } } - pub async fn execute_ip_pool_silo_unlink( + pub async fn execute_networking_bgp_message_history( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_silo_unlink(); - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); - } - - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); + let mut request = self.client.networking_bgp_message_history(); + if let Some(value) = matches.get_one::("asn") { + request = request.asn(value.clone()); } self.config - .execute_ip_pool_silo_unlink(matches, &mut request)?; + .execute_networking_bgp_message_history(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -11267,17 +13661,17 @@ impl Cli { } } - pub async fn execute_ip_pool_utilization_view( + pub async fn execute_networking_bgp_imported_routes_ipv4( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_utilization_view(); - if let Some(value) = matches.get_one::("pool") { - request = request.pool(value.clone()); + let mut request = self.client.networking_bgp_imported_routes_ipv4(); + if let Some(value) = matches.get_one::("asn") { + request = request.asn(value.clone()); } self.config - .execute_ip_pool_utilization_view(matches, &mut request)?; + .execute_networking_bgp_imported_routes_ipv4(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11291,13 +13685,13 @@ impl Cli { } } - pub async fn execute_ip_pool_service_view( + pub async fn execute_networking_bgp_status( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_service_view(); + let mut request = self.client.networking_bgp_status(); self.config - .execute_ip_pool_service_view(matches, &mut request)?; + .execute_networking_bgp_status(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11311,18 +13705,23 @@ impl Cli { } } - pub async fn execute_ip_pool_service_range_list( + pub async fn execute_networking_loopback_address_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_service_range_list(); + let mut request = self.client.networking_loopback_address_list(); if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + self.config - .execute_ip_pool_service_range_list(matches, &mut request)?; - self.config.list_start::(); + .execute_networking_loopback_address_list(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -11337,7 +13736,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -11347,49 +13746,48 @@ impl Cli { } } - pub async fn execute_ip_pool_service_range_add( + pub async fn execute_networking_loopback_address_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_service_range_add(); - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); - request = request.body(body_value); + let mut request = self.client.networking_loopback_address_create(); + if let Some(value) = matches.get_one::("address") { + request = request.body_map(|body| body.address(value.clone())) } - self.config - .execute_ip_pool_service_range_add(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + if let Some(value) = matches.get_one::("address-lot") { + request = request.body_map(|body| body.address_lot(value.clone())) + } + + if let Some(value) = matches.get_one::("anycast") { + request = request.body_map(|body| body.anycast(value.clone())) + } + + if let Some(value) = matches.get_one::("mask") { + request = request.body_map(|body| body.mask(value.clone())) + } + + if let Some(value) = matches.get_one::("rack-id") { + request = request.body_map(|body| body.rack_id(value.clone())) + } + + if let Some(value) = matches.get_one::("switch-location") { + request = request.body_map(|body| body.switch_location(value.clone())) } - } - pub async fn execute_ip_pool_service_range_remove( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.ip_pool_service_range_remove(); if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_ip_pool_service_range_remove(matches, &mut request)?; + .execute_networking_loopback_address_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -11399,64 +13797,51 @@ impl Cli { } } - pub async fn execute_system_metric(&self, matches: &clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.system_metric(); - if let Some(value) = matches.get_one::>("end-time") { - request = request.end_time(value.clone()); - } - - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("metric-name") { - request = request.metric_name(value.clone()); - } - - if let Some(value) = matches.get_one::("order") { - request = request.order(value.clone()); + pub async fn execute_networking_loopback_address_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_loopback_address_delete(); + if let Some(value) = matches.get_one::("address") { + request = request.address(value.clone()); } - if let Some(value) = matches.get_one::("silo") { - request = request.silo(value.clone()); + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); } - if let Some(value) = matches.get_one::>("start-time") - { - request = request.start_time(value.clone()); + if let Some(value) = matches.get_one::("subnet-mask") { + request = request.subnet_mask(value.clone()); } - self.config.execute_system_metric(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + if let Some(value) = matches.get_one::("switch-location") { + request = request.switch_location(value.clone()); + } + + self.config + .execute_networking_loopback_address_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_networking_address_lot_list( + pub async fn execute_networking_switch_port_configuration_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_address_lot_list(); + let mut request = self.client.networking_switch_port_configuration_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + if let Some(value) = matches.get_one::("limit") { request = request.limit(value.clone()); } @@ -11466,8 +13851,9 @@ impl Cli { } self.config - .execute_networking_address_lot_list(matches, &mut request)?; - self.config.list_start::(); + .execute_networking_switch_port_configuration_list(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -11482,7 +13868,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -11492,31 +13878,28 @@ impl Cli { } } - pub async fn execute_networking_address_lot_create( + pub async fn execute_networking_switch_port_configuration_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_address_lot_create(); + let mut request = self.client.networking_switch_port_configuration_create(); if let Some(value) = matches.get_one::("description") { request = request.body_map(|body| body.description(value.clone())) } - if let Some(value) = matches.get_one::("kind") { - request = request.body_map(|body| body.kind(value.clone())) - } - if let Some(value) = matches.get_one::("name") { request = request.body_map(|body| body.name(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_address_lot_create(matches, &mut request)?; + .execute_networking_switch_port_configuration_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11530,21 +13913,21 @@ impl Cli { } } - pub async fn execute_networking_address_lot_delete( + pub async fn execute_networking_switch_port_configuration_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_address_lot_delete(); - if let Some(value) = matches.get_one::("address-lot") { - request = request.address_lot(value.clone()); + let mut request = self.client.networking_switch_port_configuration_view(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } self.config - .execute_networking_address_lot_delete(matches, &mut request)?; + .execute_networking_switch_port_configuration_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -11554,58 +13937,43 @@ impl Cli { } } - pub async fn execute_networking_address_lot_block_list( + pub async fn execute_networking_switch_port_configuration_delete( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_address_lot_block_list(); - if let Some(value) = matches.get_one::("address-lot") { - request = request.address_lot(value.clone()); - } - - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + let mut request = self.client.networking_switch_port_configuration_delete(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } self.config - .execute_networking_address_lot_block_list(matches, &mut request)?; - self.config - .list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + .execute_networking_switch_port_configuration_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_networking_allow_list_view( + pub async fn execute_networking_switch_port_configuration_address_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_allow_list_view(); + let mut request = self + .client + .networking_switch_port_configuration_address_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + self.config - .execute_networking_allow_list_view(matches, &mut request)?; + .execute_networking_switch_port_configuration_address_list(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11619,19 +13987,41 @@ impl Cli { } } - pub async fn execute_networking_allow_list_update( + pub async fn execute_networking_switch_port_configuration_address_add( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_allow_list_update(); + let mut request = self + .client + .networking_switch_port_configuration_address_add(); + if let Some(value) = matches.get_one::("address") { + request = request.body_map(|body| body.address(value.clone())) + } + + if let Some(value) = matches.get_one::("address-lot") { + request = request.body_map(|body| body.address_lot(value.clone())) + } + + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("vlan-id") { + request = request.body_map(|body| body.vlan_id(value.clone())) + } + if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_allow_list_update(matches, &mut request)?; + .execute_networking_switch_port_configuration_address_add(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11645,27 +14035,41 @@ impl Cli { } } - pub async fn execute_networking_bfd_disable( + pub async fn execute_networking_switch_port_configuration_address_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bfd_disable(); - if let Some(value) = matches.get_one::("remote") { - request = request.body_map(|body| body.remote(value.clone())) + let mut request = self + .client + .networking_switch_port_configuration_address_remove(); + if let Some(value) = matches.get_one::("address") { + request = request.body_map(|body| body.address(value.clone())) } - if let Some(value) = matches.get_one::("switch") { - request = request.body_map(|body| body.switch(value.clone())) + if let Some(value) = matches.get_one::("address-lot") { + request = request.body_map(|body| body.address_lot(value.clone())) + } + + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("vlan-id") { + request = request.body_map(|body| body.vlan_id(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_bfd_disable(matches, &mut request)?; + .execute_networking_switch_port_configuration_address_remove(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11679,47 +14083,123 @@ impl Cli { } } - pub async fn execute_networking_bfd_enable( + pub async fn execute_networking_switch_port_configuration_bgp_peer_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bfd_enable(); - if let Some(value) = matches.get_one::("detection-threshold") { - request = request.body_map(|body| body.detection_threshold(value.clone())) + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("local") { - request = request.body_map(|body| body.local(value.clone())) + self.config + .execute_networking_switch_port_configuration_bgp_peer_list(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } } + } - if let Some(value) = matches.get_one::("mode") { - request = request.body_map(|body| body.mode(value.clone())) + pub async fn execute_networking_switch_port_configuration_bgp_peer_add( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_add(); + if let Some(value) = matches.get_one::("addr") { + request = request.body_map(|body| body.addr(value.clone())) } - if let Some(value) = matches.get_one::("remote") { - request = request.body_map(|body| body.remote(value.clone())) + if let Some(value) = matches.get_one::("allow-export-list-active") { + request = request.body_map(|body| body.allow_export_list_active(value.clone())) } - if let Some(value) = matches.get_one::("required-rx") { - request = request.body_map(|body| body.required_rx(value.clone())) + if let Some(value) = matches.get_one::("allow-import-list-active") { + request = request.body_map(|body| body.allow_import_list_active(value.clone())) } - if let Some(value) = matches.get_one::("switch") { - request = request.body_map(|body| body.switch(value.clone())) + if let Some(value) = matches.get_one::("bgp-config") { + request = request.body_map(|body| body.bgp_config(value.clone())) + } + + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("connect-retry") { + request = request.body_map(|body| body.connect_retry(value.clone())) + } + + if let Some(value) = matches.get_one::("delay-open") { + request = request.body_map(|body| body.delay_open(value.clone())) + } + + if let Some(value) = matches.get_one::("enforce-first-as") { + request = request.body_map(|body| body.enforce_first_as(value.clone())) + } + + if let Some(value) = matches.get_one::("hold-time") { + request = request.body_map(|body| body.hold_time(value.clone())) + } + + if let Some(value) = matches.get_one::("idle-hold-time") { + request = request.body_map(|body| body.idle_hold_time(value.clone())) + } + + if let Some(value) = matches.get_one::("interface-name") { + request = request.body_map(|body| body.interface_name(value.clone())) + } + + if let Some(value) = matches.get_one::("keepalive") { + request = request.body_map(|body| body.keepalive(value.clone())) + } + + if let Some(value) = matches.get_one::("local-pref") { + request = request.body_map(|body| body.local_pref(value.clone())) + } + + if let Some(value) = matches.get_one::("md5-auth-key") { + request = request.body_map(|body| body.md5_auth_key(value.clone())) + } + + if let Some(value) = matches.get_one::("min-ttl") { + request = request.body_map(|body| body.min_ttl(value.clone())) + } + + if let Some(value) = matches.get_one::("multi-exit-discriminator") { + request = request.body_map(|body| body.multi_exit_discriminator(value.clone())) + } + + if let Some(value) = matches.get_one::("remote-asn") { + request = request.body_map(|body| body.remote_asn(value.clone())) + } + + if let Some(value) = matches.get_one::("vlan-id") { + request = request.body_map(|body| body.vlan_id(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_bfd_enable(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_add(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -11729,13 +14209,26 @@ impl Cli { } } - pub async fn execute_networking_bfd_status( + pub async fn execute_networking_switch_port_configuration_bgp_peer_allow_export_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bfd_status(); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_allow_export_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("peer-address") { + request = request.peer_address(value.clone()); + } + self.config - .execute_networking_bfd_status(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_allow_export_list( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11744,84 +14237,46 @@ impl Cli { } Err(r) => { self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - - pub async fn execute_networking_bgp_config_list( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_config_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); - } - - self.config - .execute_networking_bgp_config_list(matches, &mut request)?; - self.config.list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + Err(anyhow::Error::new(r)) } } } - pub async fn execute_networking_bgp_config_create( + pub async fn execute_networking_switch_port_configuration_bgp_peer_allow_export_add( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_config_create(); - if let Some(value) = matches.get_one::("asn") { - request = request.body_map(|body| body.asn(value.clone())) - } - - if let Some(value) = matches.get_one::("bgp-announce-set-id") { - request = request.body_map(|body| body.bgp_announce_set_id(value.clone())) + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_allow_export_add(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + if let Some(value) = matches.get_one::("peer-address") { + request = request.body_map(|body| body.peer_address(value.clone())) } - if let Some(value) = matches.get_one::("vrf") { - request = request.body_map(|body| body.vrf(value.clone())) + if let Some(value) = matches.get_one::("prefix") { + request = request.body_map(|body| body.prefix(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = serde_json::from_str::(&body_txt).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_bgp_config_create(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_allow_export_add( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11835,17 +14290,41 @@ impl Cli { } } - pub async fn execute_networking_bgp_config_delete( + pub async fn execute_networking_switch_port_configuration_bgp_peer_allow_export_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_config_delete(); - if let Some(value) = matches.get_one::("name-or-id") { - request = request.name_or_id(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_allow_export_remove(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("peer-address") { + request = request.body_map(|body| body.peer_address(value.clone())) + } + + if let Some(value) = matches.get_one::("prefix") { + request = request.body_map(|body| body.prefix(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_networking_bgp_config_delete(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_allow_export_remove( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11859,25 +14338,26 @@ impl Cli { } } - pub async fn execute_networking_bgp_announce_set_list( + pub async fn execute_networking_switch_port_configuration_bgp_peer_allow_import_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_announce_set_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); - } - - if let Some(value) = matches.get_one::("page-token") { - request = request.page_token(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_allow_import_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + if let Some(value) = matches.get_one::("peer-address") { + request = request.peer_address(value.clone()); } self.config - .execute_networking_bgp_announce_set_list(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_allow_import_list( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11891,28 +14371,41 @@ impl Cli { } } - pub async fn execute_networking_bgp_announce_set_update( + pub async fn execute_networking_switch_port_configuration_bgp_peer_allow_import_add( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_announce_set_update(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_allow_import_add(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("peer-address") { + request = request.body_map(|body| body.peer_address(value.clone())) + } + + if let Some(value) = matches.get_one::("prefix") { + request = request.body_map(|body| body.prefix(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); let body_value = - serde_json::from_str::(&body_txt).unwrap(); + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_bgp_announce_set_update(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_allow_import_add( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11926,17 +14419,41 @@ impl Cli { } } - pub async fn execute_networking_bgp_announce_set_delete( + pub async fn execute_networking_switch_port_configuration_bgp_peer_allow_import_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_announce_set_delete(); - if let Some(value) = matches.get_one::("announce-set") { - request = request.announce_set(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_allow_import_remove(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("peer-address") { + request = request.body_map(|body| body.peer_address(value.clone())) + } + + if let Some(value) = matches.get_one::("prefix") { + request = request.body_map(|body| body.prefix(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_networking_bgp_announce_set_delete(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_allow_import_remove( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11950,17 +14467,26 @@ impl Cli { } } - pub async fn execute_networking_bgp_announcement_list( + pub async fn execute_networking_switch_port_configuration_bgp_peer_community_list( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_announcement_list(); - if let Some(value) = matches.get_one::("announce-set") { - request = request.announce_set(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_community_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("peer-address") { + request = request.peer_address(value.clone()); } self.config - .execute_networking_bgp_announcement_list(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_community_list( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11974,13 +14500,41 @@ impl Cli { } } - pub async fn execute_networking_bgp_exported( + pub async fn execute_networking_switch_port_configuration_bgp_peer_community_add( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_exported(); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_community_add(); + if let Some(value) = matches.get_one::("community") { + request = request.body_map(|body| body.community(value.clone())) + } + + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("peer-address") { + request = request.body_map(|body| body.peer_address(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + self.config - .execute_networking_bgp_exported(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_community_add( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { @@ -11994,21 +14548,45 @@ impl Cli { } } - pub async fn execute_networking_bgp_message_history( + pub async fn execute_networking_switch_port_configuration_bgp_peer_community_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_message_history(); - if let Some(value) = matches.get_one::("asn") { - request = request.asn(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_community_remove(); + if let Some(value) = matches.get_one::("community") { + request = request.body_map(|body| body.community(value.clone())) + } + + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("peer-address") { + request = request.body_map(|body| body.peer_address(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_networking_bgp_message_history(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_community_remove( + matches, + &mut request, + )?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -12018,21 +14596,41 @@ impl Cli { } } - pub async fn execute_networking_bgp_imported_routes_ipv4( + pub async fn execute_networking_switch_port_configuration_bgp_peer_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_imported_routes_ipv4(); - if let Some(value) = matches.get_one::("asn") { - request = request.asn(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_bgp_peer_remove(); + if let Some(value) = matches.get_one::("addr") { + request = request.body_map(|body| body.addr(value.clone())) + } + + if let Some(value) = matches.get_one::("bgp-config") { + request = request.body_map(|body| body.bgp_config(value.clone())) + } + + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("interface-name") { + request = request.body_map(|body| body.interface_name(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_networking_bgp_imported_routes_ipv4(matches, &mut request)?; + .execute_networking_switch_port_configuration_bgp_peer_remove(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -12042,13 +14640,19 @@ impl Cli { } } - pub async fn execute_networking_bgp_status( + pub async fn execute_networking_switch_port_configuration_geometry_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_bgp_status(); + let mut request = self + .client + .networking_switch_port_configuration_geometry_view(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + self.config - .execute_networking_bgp_status(matches, &mut request)?; + .execute_networking_switch_port_configuration_geometry_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -12062,85 +14666,111 @@ impl Cli { } } - pub async fn execute_networking_loopback_address_list( + pub async fn execute_networking_switch_port_configuration_geometry_set( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_loopback_address_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_geometry_set(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + if let Some(value) = matches.get_one::("geometry") { + request = request.body_map(|body| body.geometry(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = + serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_networking_loopback_address_list(matches, &mut request)?; + .execute_networking_switch_port_configuration_geometry_set(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_networking_switch_port_configuration_link_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_switch_port_configuration_link_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + self.config - .list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } + .execute_networking_switch_port_configuration_link_list(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) } } } - pub async fn execute_networking_loopback_address_create( + pub async fn execute_networking_switch_port_configuration_link_create( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_loopback_address_create(); - if let Some(value) = matches.get_one::("address") { - request = request.body_map(|body| body.address(value.clone())) + let mut request = self + .client + .networking_switch_port_configuration_link_create(); + if let Some(value) = matches.get_one::("autoneg") { + request = request.body_map(|body| body.autoneg(value.clone())) } - if let Some(value) = matches.get_one::("address-lot") { - request = request.body_map(|body| body.address_lot(value.clone())) + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("anycast") { - request = request.body_map(|body| body.anycast(value.clone())) + if let Some(value) = matches.get_one::("fec") { + request = request.body_map(|body| body.fec(value.clone())) } - if let Some(value) = matches.get_one::("mask") { - request = request.body_map(|body| body.mask(value.clone())) + if let Some(value) = matches.get_one::("lldp-config") { + request = request.body_map(|body| body.lldp_config(value.clone())) } - if let Some(value) = matches.get_one::("rack-id") { - request = request.body_map(|body| body.rack_id(value.clone())) + if let Some(value) = matches.get_one::("mtu") { + request = request.body_map(|body| body.mtu(value.clone())) } - if let Some(value) = matches.get_one::("switch-location") { - request = request.body_map(|body| body.switch_location(value.clone())) + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::("speed") { + request = request.body_map(|body| body.speed(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); let body_value = - serde_json::from_str::(&body_txt).unwrap(); + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_loopback_address_create(matches, &mut request)?; + .execute_networking_switch_port_configuration_link_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -12154,33 +14784,81 @@ impl Cli { } } - pub async fn execute_networking_loopback_address_delete( + pub async fn execute_networking_switch_port_configuration_link_view( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_loopback_address_delete(); - if let Some(value) = matches.get_one::("address") { - request = request.address(value.clone()); + let mut request = self.client.networking_switch_port_configuration_link_view(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("rack-id") { - request = request.rack_id(value.clone()); + if let Some(value) = matches.get_one::("link") { + request = request.link(value.clone()); } - if let Some(value) = matches.get_one::("subnet-mask") { - request = request.subnet_mask(value.clone()); + self.config + .execute_networking_switch_port_configuration_link_view(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_networking_switch_port_configuration_link_delete( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self + .client + .networking_switch_port_configuration_link_delete(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); + } + + if let Some(value) = matches.get_one::("link") { + request = request.link(value.clone()); + } + + self.config + .execute_networking_switch_port_configuration_link_delete(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } } + } - if let Some(value) = matches.get_one::("switch-location") { - request = request.switch_location(value.clone()); + pub async fn execute_networking_switch_port_configuration_route_list( + &self, + matches: &clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self + .client + .networking_switch_port_configuration_route_list(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } self.config - .execute_networking_loopback_address_delete(matches, &mut request)?; + .execute_networking_switch_port_configuration_route_list(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -12190,73 +14868,43 @@ impl Cli { } } - pub async fn execute_networking_switch_port_settings_list( + pub async fn execute_networking_switch_port_configuration_route_add( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_settings_list(); - if let Some(value) = matches.get_one::("limit") { - request = request.limit(value.clone()); + let mut request = self.client.networking_switch_port_configuration_route_add(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - if let Some(value) = matches.get_one::("port-settings") { - request = request.port_settings(value.clone()); + if let Some(value) = matches.get_one::("dst") { + request = request.body_map(|body| body.dst(value.clone())) } - if let Some(value) = matches.get_one::("sort-by") { - request = request.sort_by(value.clone()); + if let Some(value) = matches.get_one::("gw") { + request = request.body_map(|body| body.gw(value.clone())) } - self.config - .execute_networking_switch_port_settings_list(matches, &mut request)?; - self.config - .list_start::(); - let mut stream = futures::StreamExt::take( - request.stream(), - matches - .get_one::("limit") - .map_or(usize::MAX, |x| x.get() as usize), - ); - loop { - match futures::TryStreamExt::try_next(&mut stream).await { - Err(r) => { - self.config.list_end_error(&r); - return Err(anyhow::Error::new(r)); - } - Ok(None) => { - self.config - .list_end_success::(); - return Ok(()); - } - Ok(Some(value)) => { - self.config.list_item(&value); - } - } + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) } - } - pub async fn execute_networking_switch_port_settings_create( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_settings_create(); - if let Some(value) = matches.get_one::("description") { - request = request.body_map(|body| body.description(value.clone())) + if let Some(value) = matches.get_one::("rib-priority") { + request = request.body_map(|body| body.rib_priority(value.clone())) } - if let Some(value) = matches.get_one::("name") { - request = request.body_map(|body| body.name(value.clone())) + if let Some(value) = matches.get_one::("vid") { + request = request.body_map(|body| body.vid(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); - let body_value = - serde_json::from_str::(&body_txt).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_networking_switch_port_settings_create(matches, &mut request)?; + .execute_networking_switch_port_configuration_route_add(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -12270,45 +14918,49 @@ impl Cli { } } - pub async fn execute_networking_switch_port_settings_delete( + pub async fn execute_networking_switch_port_configuration_route_remove( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_settings_delete(); - if let Some(value) = matches.get_one::("port-settings") { - request = request.port_settings(value.clone()); + let mut request = self + .client + .networking_switch_port_configuration_route_remove(); + if let Some(value) = matches.get_one::("configuration") { + request = request.configuration(value.clone()); } - self.config - .execute_networking_switch_port_settings_delete(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_no_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } + if let Some(value) = matches.get_one::("dst") { + request = request.body_map(|body| body.dst(value.clone())) } - } - pub async fn execute_networking_switch_port_settings_view( - &self, - matches: &clap::ArgMatches, - ) -> anyhow::Result<()> { - let mut request = self.client.networking_switch_port_settings_view(); - if let Some(value) = matches.get_one::("port") { - request = request.port(value.clone()); + if let Some(value) = matches.get_one::("gw") { + request = request.body_map(|body| body.gw(value.clone())) + } + + if let Some(value) = matches.get_one::("interface") { + request = request.body_map(|body| body.interface(value.clone())) + } + + if let Some(value) = matches.get_one::("rib-priority") { + request = request.body_map(|body| body.rib_priority(value.clone())) + } + + if let Some(value) = matches.get_one::("vid") { + request = request.body_map(|body| body.vid(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); } self.config - .execute_networking_switch_port_settings_view(matches, &mut request)?; + .execute_networking_switch_port_configuration_route_remove(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -14746,6 +17398,30 @@ pub trait CliConfig { Ok(()) } + fn execute_networking_switch_port_active_configuration_view( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortActiveConfigurationView, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_active_configuration_set( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortActiveConfigurationSet, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_active_configuration_clear( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortActiveConfigurationClear, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_sled_list( &self, matches: &clap::ArgMatches, @@ -15074,6 +17750,22 @@ pub trait CliConfig { Ok(()) } + fn execute_networking_address_lot_block_add( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingAddressLotBlockAdd, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_address_lot_block_remove( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingAddressLotBlockRemove, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_networking_allow_list_view( &self, matches: &clap::ArgMatches, @@ -15226,34 +17918,226 @@ pub trait CliConfig { Ok(()) } - fn execute_networking_switch_port_settings_list( + fn execute_networking_switch_port_configuration_list( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_create( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationCreate, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_view( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationView, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_delete( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationDelete, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_address_list( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationAddressList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_address_add( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationAddressAdd, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_address_remove( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationAddressRemove, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_list( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_add( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerAdd, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_allow_export_list( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_allow_export_add( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_allow_export_remove( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_allow_import_list( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_allow_import_add( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_allow_import_remove( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_community_list( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerCommunityList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_community_add( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_community_remove( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_bgp_peer_remove( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationBgpPeerRemove, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_geometry_view( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationGeometryView, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_geometry_set( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationGeometrySet, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_link_list( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationLinkList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_link_create( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationLinkCreate, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_link_view( + &self, + matches: &clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortConfigurationLinkView, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_configuration_link_delete( &self, matches: &clap::ArgMatches, - request: &mut builder::NetworkingSwitchPortSettingsList, + request: &mut builder::NetworkingSwitchPortConfigurationLinkDelete, ) -> anyhow::Result<()> { Ok(()) } - fn execute_networking_switch_port_settings_create( + fn execute_networking_switch_port_configuration_route_list( &self, matches: &clap::ArgMatches, - request: &mut builder::NetworkingSwitchPortSettingsCreate, + request: &mut builder::NetworkingSwitchPortConfigurationRouteList, ) -> anyhow::Result<()> { Ok(()) } - fn execute_networking_switch_port_settings_delete( + fn execute_networking_switch_port_configuration_route_add( &self, matches: &clap::ArgMatches, - request: &mut builder::NetworkingSwitchPortSettingsDelete, + request: &mut builder::NetworkingSwitchPortConfigurationRouteAdd, ) -> anyhow::Result<()> { Ok(()) } - fn execute_networking_switch_port_settings_view( + fn execute_networking_switch_port_configuration_route_remove( &self, matches: &clap::ArgMatches, - request: &mut builder::NetworkingSwitchPortSettingsView, + request: &mut builder::NetworkingSwitchPortConfigurationRouteRemove, ) -> anyhow::Result<()> { Ok(()) } @@ -15734,6 +18618,9 @@ pub enum CliCommand { PhysicalDiskView, RackList, RackView, + NetworkingSwitchPortActiveConfigurationView, + NetworkingSwitchPortActiveConfigurationSet, + NetworkingSwitchPortActiveConfigurationClear, SledList, SledAdd, SledView, @@ -15775,6 +18662,8 @@ pub enum CliCommand { NetworkingAddressLotCreate, NetworkingAddressLotDelete, NetworkingAddressLotBlockList, + NetworkingAddressLotBlockAdd, + NetworkingAddressLotBlockRemove, NetworkingAllowListView, NetworkingAllowListUpdate, NetworkingBfdDisable, @@ -15794,10 +18683,34 @@ pub enum CliCommand { NetworkingLoopbackAddressList, NetworkingLoopbackAddressCreate, NetworkingLoopbackAddressDelete, - NetworkingSwitchPortSettingsList, - NetworkingSwitchPortSettingsCreate, - NetworkingSwitchPortSettingsDelete, - NetworkingSwitchPortSettingsView, + NetworkingSwitchPortConfigurationList, + NetworkingSwitchPortConfigurationCreate, + NetworkingSwitchPortConfigurationView, + NetworkingSwitchPortConfigurationDelete, + NetworkingSwitchPortConfigurationAddressList, + NetworkingSwitchPortConfigurationAddressAdd, + NetworkingSwitchPortConfigurationAddressRemove, + NetworkingSwitchPortConfigurationBgpPeerList, + NetworkingSwitchPortConfigurationBgpPeerAdd, + NetworkingSwitchPortConfigurationBgpPeerAllowExportList, + NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd, + NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove, + NetworkingSwitchPortConfigurationBgpPeerAllowImportList, + NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd, + NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove, + NetworkingSwitchPortConfigurationBgpPeerCommunityList, + NetworkingSwitchPortConfigurationBgpPeerCommunityAdd, + NetworkingSwitchPortConfigurationBgpPeerCommunityRemove, + NetworkingSwitchPortConfigurationBgpPeerRemove, + NetworkingSwitchPortConfigurationGeometryView, + NetworkingSwitchPortConfigurationGeometrySet, + NetworkingSwitchPortConfigurationLinkList, + NetworkingSwitchPortConfigurationLinkCreate, + NetworkingSwitchPortConfigurationLinkView, + NetworkingSwitchPortConfigurationLinkDelete, + NetworkingSwitchPortConfigurationRouteList, + NetworkingSwitchPortConfigurationRouteAdd, + NetworkingSwitchPortConfigurationRouteRemove, SystemPolicyView, SystemPolicyUpdate, RoleList, @@ -15947,6 +18860,9 @@ impl CliCommand { CliCommand::PhysicalDiskView, CliCommand::RackList, CliCommand::RackView, + CliCommand::NetworkingSwitchPortActiveConfigurationView, + CliCommand::NetworkingSwitchPortActiveConfigurationSet, + CliCommand::NetworkingSwitchPortActiveConfigurationClear, CliCommand::SledList, CliCommand::SledAdd, CliCommand::SledView, @@ -15988,6 +18904,8 @@ impl CliCommand { CliCommand::NetworkingAddressLotCreate, CliCommand::NetworkingAddressLotDelete, CliCommand::NetworkingAddressLotBlockList, + CliCommand::NetworkingAddressLotBlockAdd, + CliCommand::NetworkingAddressLotBlockRemove, CliCommand::NetworkingAllowListView, CliCommand::NetworkingAllowListUpdate, CliCommand::NetworkingBfdDisable, @@ -16007,10 +18925,34 @@ impl CliCommand { CliCommand::NetworkingLoopbackAddressList, CliCommand::NetworkingLoopbackAddressCreate, CliCommand::NetworkingLoopbackAddressDelete, - CliCommand::NetworkingSwitchPortSettingsList, - CliCommand::NetworkingSwitchPortSettingsCreate, - CliCommand::NetworkingSwitchPortSettingsDelete, - CliCommand::NetworkingSwitchPortSettingsView, + CliCommand::NetworkingSwitchPortConfigurationList, + CliCommand::NetworkingSwitchPortConfigurationCreate, + CliCommand::NetworkingSwitchPortConfigurationView, + CliCommand::NetworkingSwitchPortConfigurationDelete, + CliCommand::NetworkingSwitchPortConfigurationAddressList, + CliCommand::NetworkingSwitchPortConfigurationAddressAdd, + CliCommand::NetworkingSwitchPortConfigurationAddressRemove, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerList, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAdd, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportList, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportList, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityList, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove, + CliCommand::NetworkingSwitchPortConfigurationBgpPeerRemove, + CliCommand::NetworkingSwitchPortConfigurationGeometryView, + CliCommand::NetworkingSwitchPortConfigurationGeometrySet, + CliCommand::NetworkingSwitchPortConfigurationLinkList, + CliCommand::NetworkingSwitchPortConfigurationLinkCreate, + CliCommand::NetworkingSwitchPortConfigurationLinkView, + CliCommand::NetworkingSwitchPortConfigurationLinkDelete, + CliCommand::NetworkingSwitchPortConfigurationRouteList, + CliCommand::NetworkingSwitchPortConfigurationRouteAdd, + CliCommand::NetworkingSwitchPortConfigurationRouteRemove, CliCommand::SystemPolicyView, CliCommand::SystemPolicyUpdate, CliCommand::RoleList, diff --git a/cli/tests/data/json-body-required.txt b/cli/tests/data/json-body-required.txt index 8b8950cc..d2141c45 100644 --- a/cli/tests/data/json-body-required.txt +++ b/cli/tests/data/json-body-required.txt @@ -10,6 +10,5 @@ oxide vpc router route create oxide vpc router route update oxide disk create oxide system policy update -oxide system networking address-lot create -oxide system networking switch-port-settings create +oxide system networking switch-port configuration create oxide system networking bgp announce-set update \ No newline at end of file diff --git a/cli/tests/test_net.rs b/cli/tests/test_net.rs index 10561072..55896111 100644 --- a/cli/tests/test_net.rs +++ b/cli/tests/test_net.rs @@ -9,8 +9,8 @@ use chrono::prelude::*; use httpmock::MockServer; use oxide::types::{ AddressLot, AddressLotBlock, AddressLotBlockResultsPage, AddressLotKind, AddressLotResultsPage, - BgpConfig, BgpConfigResultsPage, BgpPeer, ImportExportPolicy, LinkFec, LinkSpeed, NameOrId, - SwitchPort, SwitchPortAddressConfig, SwitchPortConfig, SwitchPortGeometry2, + BgpConfig, BgpConfigResultsPage, BgpPeerCombined, ImportExportPolicy, LinkFec, LinkSpeed, + NameOrId, SwitchPort, SwitchPortAddressConfig, SwitchPortConfig, SwitchPortGeometry2, SwitchPortLinkConfig, SwitchPortResultsPage, SwitchPortRouteConfig, SwitchPortSettings, SwitchPortSettingsView, }; @@ -119,7 +119,7 @@ fn test_port_config() { }, ], bgp_peers: vec![ - BgpPeer { + BgpPeerCombined { interface_name: String::from("phy0"), addr: "169.254.10.1".parse().unwrap(), bgp_config: NameOrId::Id(bgp_configs.items[0].id), @@ -139,7 +139,7 @@ fn test_port_config() { remote_asn: None, vlan_id: None, }, - BgpPeer { + BgpPeerCombined { interface_name: String::from("phy0"), addr: "169.254.30.1".parse().unwrap(), bgp_config: NameOrId::Id(bgp_configs.items[0].id), @@ -167,7 +167,7 @@ fn test_port_config() { autoneg: false, fec: LinkFec::None, link_name: String::from("phy0"), - lldp_link_config_id: None, + lldp_link_config_id: Some(Uuid::new_v4()), mtu: 1500, port_settings_id: switch1_qsfp0_settings_id, speed: LinkSpeed::Speed100G, @@ -211,7 +211,7 @@ fn test_port_config() { }, ], bgp_peers: vec![ - BgpPeer { + BgpPeerCombined { interface_name: String::from("phy0"), addr: "169.254.20.1".parse().unwrap(), bgp_config: NameOrId::Id(bgp_configs.items[0].id), @@ -231,7 +231,7 @@ fn test_port_config() { remote_asn: None, vlan_id: None, }, - BgpPeer { + BgpPeerCombined { interface_name: String::from("phy0"), addr: "169.254.40.1".parse().unwrap(), bgp_config: NameOrId::Id(bgp_configs.items[0].id), @@ -259,7 +259,7 @@ fn test_port_config() { autoneg: false, fec: LinkFec::None, link_name: String::from("phy0"), - lldp_link_config_id: None, + lldp_link_config_id: Some(Uuid::new_v4()), mtu: 1500, port_settings_id: switch1_qsfp0_settings_id, speed: LinkSpeed::Speed100G, @@ -280,14 +280,14 @@ fn test_port_config() { }; let mock_switch0_qsfp0_settings_view = - server.networking_switch_port_settings_view(|when, then| { - when.port(&NameOrId::Id(ports.items[0].port_settings_id.unwrap())); + server.networking_switch_port_configuration_view(|when, then| { + when.configuration(&NameOrId::Id(ports.items[0].port_settings_id.unwrap())); then.ok(&switch0_qsfp0_view); }); let mock_switch1_qsfp0_settings_view = - server.networking_switch_port_settings_view(|when, then| { - when.port(&NameOrId::Id(ports.items[1].port_settings_id.unwrap())); + server.networking_switch_port_configuration_view(|when, then| { + when.configuration(&NameOrId::Id(ports.items[1].port_settings_id.unwrap())); then.ok(&switch1_qsfp0_view); }); diff --git a/oxide.json b/oxide.json index 97f9830b..dcf838f2 100644 --- a/oxide.json +++ b/oxide.json @@ -4909,6 +4909,169 @@ } } }, + "/v1/system/hardware/racks/{rack_id}/switch/{switch}/switch-port/{port}/configuration": { + "get": { + "tags": [ + "system/hardware" + ], + "summary": "View switch port configuration", + "operationId": "networking_switch_port_active_configuration_view", + "parameters": [ + { + "in": "path", + "name": "port", + "description": "A name to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + }, + { + "in": "path", + "name": "rack_id", + "description": "A rack id to use when selecting switch ports.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "in": "path", + "name": "switch", + "description": "A switch location to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/SwitchLocation" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortSettings" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "put": { + "tags": [ + "system/hardware" + ], + "summary": "Set switch port configuration", + "operationId": "networking_switch_port_active_configuration_set", + "parameters": [ + { + "in": "path", + "name": "port", + "description": "A name to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + }, + { + "in": "path", + "name": "rack_id", + "description": "A rack id to use when selecting switch ports.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "in": "path", + "name": "switch", + "description": "A switch location to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/SwitchLocation" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortApplySettings" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "resource updated" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "delete": { + "tags": [ + "system/hardware" + ], + "summary": "Clear switch port configuration", + "operationId": "networking_switch_port_active_configuration_clear", + "parameters": [ + { + "in": "path", + "name": "port", + "description": "A name to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + }, + { + "in": "path", + "name": "rack_id", + "description": "A rack id to use when selecting switch ports.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "in": "path", + "name": "switch", + "description": "A switch location to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/SwitchLocation" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, "/v1/system/hardware/sleds": { "get": { "tags": [ @@ -5383,7 +5546,7 @@ "description": "A switch location to use when selecting switch ports.", "required": true, "schema": { - "$ref": "#/components/schemas/Name" + "$ref": "#/components/schemas/SwitchLocation" } } ], @@ -5407,7 +5570,8 @@ "5XX": { "$ref": "#/components/responses/Error" } - } + }, + "deprecated": true }, "delete": { "tags": [ @@ -5441,7 +5605,7 @@ "description": "A switch location to use when selecting switch ports.", "required": true, "schema": { - "$ref": "#/components/schemas/Name" + "$ref": "#/components/schemas/SwitchLocation" } } ], @@ -5455,7 +5619,8 @@ "5XX": { "$ref": "#/components/responses/Error" } - } + }, + "deprecated": true } }, "/v1/system/hardware/switch-port/{port}/status": { @@ -5491,7 +5656,7 @@ "description": "A switch location to use when selecting switch ports.", "required": true, "schema": { - "$ref": "#/components/schemas/Name" + "$ref": "#/components/schemas/SwitchLocation" } } ], @@ -6963,6 +7128,95 @@ } } }, + "/v1/system/networking/address-lot/{address_lot}/blocks/add": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Add block to address lot", + "operationId": "networking_address_lot_block_add", + "parameters": [ + { + "in": "path", + "name": "address_lot", + "description": "Name or ID of the address lot", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddressLotBlockAddRemove" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddressLotBlock" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/address-lot/{address_lot}/blocks/remove": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Remove block from address lot", + "operationId": "networking_address_lot_block_remove", + "parameters": [ + { + "in": "path", + "name": "address_lot", + "description": "Name or ID of the address lot", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddressLotBlockAddRemove" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "resource updated" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, "/v1/system/networking/allow-list": { "get": { "tags": [ @@ -7208,7 +7462,9 @@ "$ref": "#/components/responses/Error" } } - }, + } + }, + "/v1/system/networking/bgp/{bgp_config}": { "delete": { "tags": [ "system/networking" @@ -7217,8 +7473,8 @@ "operationId": "networking_bgp_config_delete", "parameters": [ { - "in": "query", - "name": "name_or_id", + "in": "path", + "name": "bgp_config", "description": "A name or id to use when selecting BGP config.", "required": true, "schema": { @@ -7319,8 +7575,8 @@ "required": true }, "responses": { - "201": { - "description": "successful creation", + "200": { + "description": "successful operation", "content": { "application/json": { "schema": { @@ -7677,19 +7933,1130 @@ }, { "in": "path", - "name": "subnet_mask", - "description": "The IP address and subnet mask to use when selecting the loopback address.", + "name": "subnet_mask", + "description": "The IP address and subnet mask to use when selecting the loopback address.", + "required": true, + "schema": { + "type": "integer", + "format": "uint8", + "minimum": 0 + } + }, + { + "in": "path", + "name": "switch_location", + "description": "The switch location to use when selecting the loopback address.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "List switch port settings", + "operationId": "networking_switch_port_configuration_list", + "parameters": [ + { + "in": "query", + "name": "configuration", + "description": "An optional name or id to use when selecting a switch port configuration.", + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "limit", + "description": "Maximum number of items returned by a single call", + "schema": { + "nullable": true, + "type": "integer", + "format": "uint32", + "minimum": 1 + } + }, + { + "in": "query", + "name": "page_token", + "description": "Token returned by previous call to retrieve the subsequent page", + "schema": { + "nullable": true, + "type": "string" + } + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/NameOrIdSortMode" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortSettingsResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + }, + "post": { + "tags": [ + "system/networking" + ], + "summary": "Create switch port settings", + "operationId": "networking_switch_port_configuration_create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortSettingsCreate" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortSettingsView" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "View a switch port configuration", + "operationId": "networking_switch_port_configuration_view", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortSettingsView" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "delete": { + "tags": [ + "system/networking" + ], + "summary": "Delete switch port settings", + "operationId": "networking_switch_port_configuration_delete", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/address": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "List addresses assigned to a provided interface configuration", + "operationId": "networking_switch_port_configuration_address_list", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "title": "Array_of_SwitchPortAddressConfig", + "type": "array", + "items": { + "$ref": "#/components/schemas/SwitchPortAddressConfig" + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/address/add": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Add address to an interface configuration", + "operationId": "networking_switch_port_configuration_address_add", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddressAddRemove" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortAddressConfig" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/address/remove": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Remove address from an interface configuration", + "operationId": "networking_switch_port_configuration_address_remove", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddressAddRemove" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "List bgp peers assigned to a provided interface configuration", + "operationId": "networking_switch_port_configuration_bgp_peer_list", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "title": "Array_of_BgpPeer", + "type": "array", + "items": { + "$ref": "#/components/schemas/BgpPeer" + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/add": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Add bgp peer to an interface configuration", + "operationId": "networking_switch_port_configuration_bgp_peer_add", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpPeer" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpPeer" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/allow-export": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "List prefixes allowed to be exported by a given bgp peer", + "operationId": "networking_switch_port_configuration_bgp_peer_allow_export_list", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "peer_address", + "description": "An address identifying a configured bgp peer.", + "required": true, + "schema": { + "type": "string", + "format": "ip" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "title": "Array_of_BgpAllowedPrefix", + "type": "array", + "items": { + "$ref": "#/components/schemas/BgpAllowedPrefix" + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/allow-export/add": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Add prefix to bgp peer allowed export list", + "operationId": "networking_switch_port_configuration_bgp_peer_allow_export_add", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllowedPrefixAddRemove" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpAllowedPrefix" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/allow-export/remove": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Remove prefix from bgp peer allowed export list", + "operationId": "networking_switch_port_configuration_bgp_peer_allow_export_remove", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllowedPrefixAddRemove" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/allow-import": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "List prefixes allowed to be imported by a given bgp peer", + "operationId": "networking_switch_port_configuration_bgp_peer_allow_import_list", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "peer_address", + "description": "An address identifying a configured bgp peer.", + "required": true, + "schema": { + "type": "string", + "format": "ip" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "title": "Array_of_BgpAllowedPrefix", + "type": "array", + "items": { + "$ref": "#/components/schemas/BgpAllowedPrefix" + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/allow-import/add": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Add prefix to bgp peer allowed import list", + "operationId": "networking_switch_port_configuration_bgp_peer_allow_import_add", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllowedPrefixAddRemove" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpAllowedPrefix" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/allow-import/remove": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Remove prefix from bgp peer allowed import list", + "operationId": "networking_switch_port_configuration_bgp_peer_allow_import_remove", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllowedPrefixAddRemove" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/community": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "List communities assigned to a bgp peer", + "operationId": "networking_switch_port_configuration_bgp_peer_community_list", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "peer_address", + "description": "An address identifying a configured bgp peer.", + "required": true, + "schema": { + "type": "string", + "format": "ip" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "title": "Array_of_BgpCommunity", + "type": "array", + "items": { + "$ref": "#/components/schemas/BgpCommunity" + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/community/add": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Add community to bgp peer", + "operationId": "networking_switch_port_configuration_bgp_peer_community_add", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpCommunityAddRemove" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpCommunity" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/community/remove": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Remove community from bgp peer", + "operationId": "networking_switch_port_configuration_bgp_peer_community_remove", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpCommunityAddRemove" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/bgp-peer/remove": { + "post": { + "tags": [ + "system/networking" + ], + "summary": "Remove bgp peer from an interface configuration", + "operationId": "networking_switch_port_configuration_bgp_peer_remove", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BgpPeerRemove" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/geometry": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "Get switch port geometry for a provided switch port configuration", + "operationId": "networking_switch_port_configuration_geometry_view", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortConfig" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "post": { + "tags": [ + "system/networking" + ], + "summary": "Set switch port geometry for a provided switch port configuration", + "operationId": "networking_switch_port_configuration_geometry_set", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortConfigCreate" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortConfig" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/link": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "List links for a provided switch port configuration", + "operationId": "networking_switch_port_configuration_link_list", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "title": "Array_of_SwitchPortLinkConfig", + "type": "array", + "items": { + "$ref": "#/components/schemas/SwitchPortLinkConfig" + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "post": { + "tags": [ + "system/networking" + ], + "summary": "Create a link for a provided switch port configuration", + "operationId": "networking_switch_port_configuration_link_create", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NamedLinkConfigCreate" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortLinkConfig" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/link/{link}": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "View a link for a provided switch port configuration", + "operationId": "networking_switch_port_configuration_link_view", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "path", + "name": "link", + "description": "Link name", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwitchPortLinkConfig" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "delete": { + "tags": [ + "system/networking" + ], + "summary": "Delete a link for a provided switch port configuration", + "operationId": "networking_switch_port_configuration_link_delete", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", "required": true, "schema": { - "type": "integer", - "format": "uint8", - "minimum": 0 + "$ref": "#/components/schemas/NameOrId" } }, { "in": "path", - "name": "switch_location", - "description": "The switch location to use when selecting the loopback address.", + "name": "link", + "description": "Link name", "required": true, "schema": { "$ref": "#/components/schemas/Name" @@ -7709,48 +9076,22 @@ } } }, - "/v1/system/networking/switch-port-settings": { + "/v1/system/networking/switch-port-configuration/{configuration}/route": { "get": { "tags": [ "system/networking" ], - "summary": "List switch port settings", - "operationId": "networking_switch_port_settings_list", + "summary": "List routes assigned to a provided interface configuration", + "operationId": "networking_switch_port_configuration_route_list", "parameters": [ { - "in": "query", - "name": "limit", - "description": "Maximum number of items returned by a single call", - "schema": { - "nullable": true, - "type": "integer", - "format": "uint32", - "minimum": 1 - } - }, - { - "in": "query", - "name": "page_token", - "description": "Token returned by previous call to retrieve the subsequent page", - "schema": { - "nullable": true, - "type": "string" - } - }, - { - "in": "query", - "name": "port_settings", - "description": "An optional name or id to use when selecting port settings.", + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, "schema": { "$ref": "#/components/schemas/NameOrId" } - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/NameOrIdSortMode" - } } ], "responses": { @@ -7759,7 +9100,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SwitchPortSettingsResultsPage" + "title": "Array_of_SwitchPortRouteConfig", + "type": "array", + "items": { + "$ref": "#/components/schemas/SwitchPortRouteConfig" + } } } } @@ -7770,22 +9115,32 @@ "5XX": { "$ref": "#/components/responses/Error" } - }, - "x-dropshot-pagination": { - "required": [] } - }, + } + }, + "/v1/system/networking/switch-port-configuration/{configuration}/route/add": { "post": { "tags": [ "system/networking" ], - "summary": "Create switch port settings", - "operationId": "networking_switch_port_settings_create", + "summary": "Add route to an interface configuration", + "operationId": "networking_switch_port_configuration_route_add", + "parameters": [ + { + "in": "path", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SwitchPortSettingsCreate" + "$ref": "#/components/schemas/RouteAddRemove" } } }, @@ -7797,7 +9152,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SwitchPortSettingsView" + "$ref": "#/components/schemas/SwitchPortRouteConfig" } } } @@ -7809,65 +9164,40 @@ "$ref": "#/components/responses/Error" } } - }, - "delete": { - "tags": [ - "system/networking" - ], - "summary": "Delete switch port settings", - "operationId": "networking_switch_port_settings_delete", - "parameters": [ - { - "in": "query", - "name": "port_settings", - "description": "An optional name or id to use when selecting port settings.", - "schema": { - "$ref": "#/components/schemas/NameOrId" - } - } - ], - "responses": { - "204": { - "description": "successful deletion" - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - } } }, - "/v1/system/networking/switch-port-settings/{port}": { - "get": { + "/v1/system/networking/switch-port-configuration/{configuration}/route/remove": { + "post": { "tags": [ "system/networking" ], - "summary": "Get information about switch port", - "operationId": "networking_switch_port_settings_view", + "summary": "Remove route from an interface configuration", + "operationId": "networking_switch_port_configuration_route_remove", "parameters": [ { "in": "path", - "name": "port", - "description": "A name or id to use when selecting switch port settings info objects.", + "name": "configuration", + "description": "A name or id to use when selecting a switch port configuration.", "required": true, "schema": { "$ref": "#/components/schemas/NameOrId" } } ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SwitchPortSettingsView" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteAddRemove" } } }, + "required": true + }, + "responses": { + "204": { + "description": "successful deletion" + }, "4XX": { "$ref": "#/components/responses/Error" }, @@ -10348,7 +11678,7 @@ "type": "object", "properties": { "address": { - "description": "The address and prefix length of this address.", + "description": "The address and subnet mask", "allOf": [ { "$ref": "#/components/schemas/IpNet" @@ -10376,6 +11706,48 @@ "address_lot" ] }, + "AddressAddRemove": { + "description": "An address to be added to or removed from an interface", + "type": "object", + "properties": { + "address": { + "description": "The address and subnet mask", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + }, + "address_lot": { + "description": "The address lot this address is drawn from.", + "allOf": [ + { + "$ref": "#/components/schemas/NameOrId" + } + ] + }, + "interface": { + "description": "The name of the interface", + "allOf": [ + { + "$ref": "#/components/schemas/Name" + } + ] + }, + "vlan_id": { + "nullable": true, + "description": "Optional VLAN ID for this address", + "type": "integer", + "format": "uint16", + "minimum": 0 + } + }, + "required": [ + "address", + "address_lot", + "interface" + ] + }, "AddressConfig": { "description": "A set of addresses associated with a port configuration.", "type": "object", @@ -10467,8 +11839,8 @@ "last_address" ] }, - "AddressLotBlockCreate": { - "description": "Parameters for creating an address lot block. Fist and last addresses are inclusive.", + "AddressLotBlockAddRemove": { + "description": "Parameters for adding or removing an address lot block. First and last addresses are inclusive.", "type": "object", "properties": { "first_address": { @@ -10512,13 +11884,6 @@ "description": "Parameters for creating an address lot.", "type": "object", "properties": { - "blocks": { - "description": "The blocks to add along with the new address lot.", - "type": "array", - "items": { - "$ref": "#/components/schemas/AddressLotBlockCreate" - } - }, "description": { "type": "string" }, @@ -10535,7 +11900,6 @@ } }, "required": [ - "blocks", "description", "kind", "name" @@ -10545,13 +11909,6 @@ "description": "An address lot and associated blocks resulting from creating an address lot.", "type": "object", "properties": { - "blocks": { - "description": "The address lot blocks that were created.", - "type": "array", - "items": { - "$ref": "#/components/schemas/AddressLotBlock" - } - }, "lot": { "description": "The address lot that was created.", "allOf": [ @@ -10562,7 +11919,6 @@ } }, "required": [ - "blocks", "lot" ] }, @@ -10668,6 +12024,38 @@ "allowed_ips" ] }, + "AllowedPrefixAddRemove": { + "description": "A prefix allowed to be imported or exported by a bgp peer", + "type": "object", + "properties": { + "interface": { + "description": "The interface the peer is configured on", + "allOf": [ + { + "$ref": "#/components/schemas/Name" + } + ] + }, + "peer_address": { + "description": "An address identifying the target bgp peer", + "type": "string", + "format": "ip" + }, + "prefix": { + "description": "The allowed prefix to add or remove", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + } + }, + "required": [ + "interface", + "peer_address", + "prefix" + ] + }, "AllowedSourceIps": { "description": "Description of source IPs allowed to reach rack services.", "oneOf": [ @@ -10921,6 +12309,43 @@ "switch" ] }, + "BgpAllowedPrefix": { + "description": "A BGP allowed prefix entry", + "type": "object", + "properties": { + "addr": { + "description": "Peer Address", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + }, + "interface_name": { + "description": "Interface peer is reachable on", + "type": "string" + }, + "port_settings_id": { + "description": "Parent switch port configuration", + "type": "string", + "format": "uuid" + }, + "prefix": { + "description": "Allowed Prefix", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + } + }, + "required": [ + "addr", + "interface_name", + "port_settings_id", + "prefix" + ] + }, "BgpAnnounceSet": { "description": "Represents a BGP announce set by id. The id can be used with other API calls to view and manage the announce set.", "type": "object", @@ -11009,35 +12434,100 @@ } }, "required": [ - "address_lot_block_id", - "announce_set_id", - "network" + "address_lot_block_id", + "announce_set_id", + "network" + ] + }, + "BgpAnnouncementCreate": { + "description": "A BGP announcement tied to a particular address lot block.", + "type": "object", + "properties": { + "address_lot_block": { + "description": "Address lot this announcement is drawn from.", + "allOf": [ + { + "$ref": "#/components/schemas/NameOrId" + } + ] + }, + "network": { + "description": "The network being announced.", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + } + }, + "required": [ + "address_lot_block", + "network" + ] + }, + "BgpCommunity": { + "description": "A BGP community", + "type": "object", + "properties": { + "addr": { + "description": "Peer Address", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + }, + "community": { + "description": "Community", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "interface_name": { + "description": "Interface peer is reachable on", + "type": "string" + }, + "port_settings_id": { + "description": "Parent switch port configuration", + "type": "string", + "format": "uuid" + } + }, + "required": [ + "addr", + "community", + "interface_name", + "port_settings_id" ] }, - "BgpAnnouncementCreate": { - "description": "A BGP announcement tied to a particular address lot block.", + "BgpCommunityAddRemove": { + "description": "A community to be added to or removed from a bgp peer", "type": "object", "properties": { - "address_lot_block": { - "description": "Address lot this announcement is drawn from.", - "allOf": [ - { - "$ref": "#/components/schemas/NameOrId" - } - ] + "community": { + "description": "The community to add or remove", + "type": "integer", + "format": "uint32", + "minimum": 0 }, - "network": { - "description": "The network being announced.", + "interface": { + "description": "The interface the peer is configured on", "allOf": [ { - "$ref": "#/components/schemas/IpNet" + "$ref": "#/components/schemas/Name" } ] + }, + "peer_address": { + "description": "An address identifying the target bgp peer", + "type": "string", + "format": "ip" } }, "required": [ - "address_lot_block", - "network" + "community", + "interface", + "peer_address" ] }, "BgpConfig": { @@ -11209,6 +12699,127 @@ }, "BgpMessageHistory": {}, "BgpPeer": { + "description": "The information required to configure a BGP peer.", + "type": "object", + "properties": { + "addr": { + "description": "The address of the host to peer with.", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + }, + "allow_export_list_active": { + "description": "Enable export policies", + "type": "boolean" + }, + "allow_import_list_active": { + "description": "Enable import policies", + "type": "boolean" + }, + "bgp_config": { + "description": "The global BGP configuration used for establishing a session with this peer.", + "allOf": [ + { + "$ref": "#/components/schemas/NameOrId" + } + ] + }, + "connect_retry": { + "description": "How long to to wait between TCP connection retries (seconds).", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "delay_open": { + "description": "How long to delay sending an open request after establishing a TCP session (seconds).", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "enforce_first_as": { + "description": "Enforce that the first AS in paths received from this peer is the peer's AS.", + "type": "boolean" + }, + "hold_time": { + "description": "How long to hold peer connections between keepalives (seconds).", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "idle_hold_time": { + "description": "How long to hold this peer in idle before attempting a new session (seconds).", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "interface_name": { + "description": "The name of the interface to peer on. This is relative to the port configuration this BGP peer configuration is a part of. For example this value could be phy0 to refer to a primary physical interface. Or it could be vlan47 to refer to a VLAN interface.", + "type": "string" + }, + "keepalive": { + "description": "How often to send keepalive requests (seconds).", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "local_pref": { + "nullable": true, + "description": "Apply a local preference to routes received from this peer.", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "md5_auth_key": { + "nullable": true, + "description": "Use the given key for TCP-MD5 authentication with this peer.", + "type": "string" + }, + "min_ttl": { + "nullable": true, + "description": "Require messages from this peer to have a minimum IP time to live field.", + "type": "integer", + "format": "uint8", + "minimum": 0 + }, + "multi_exit_discriminator": { + "nullable": true, + "description": "Apply a multi-exit discriminator (MED) in updates sent to this peer.", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "remote_asn": { + "nullable": true, + "description": "Require that this peer have a specified ASN.", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "vlan_id": { + "nullable": true, + "description": "Associate a VLAN ID with this peer.", + "type": "integer", + "format": "uint16", + "minimum": 0 + } + }, + "required": [ + "addr", + "allow_export_list_active", + "allow_import_list_active", + "bgp_config", + "connect_retry", + "delay_open", + "enforce_first_as", + "hold_time", + "idle_hold_time", + "interface_name", + "keepalive" + ] + }, + "BgpPeerCombined": { "description": "A BGP peer configuration for an interface. Includes the set of announcements that will be advertised to the peer identified by `addr`. The `bgp_config` parameter is a reference to global BGP parameters. The `interface_name` indicates what interface the peer should be contacted on.", "type": "object", "properties": { @@ -11218,7 +12829,7 @@ "format": "ip" }, "allowed_export": { - "description": "Define export policy for a peer.", + "description": "Define export policy for this peer.", "allOf": [ { "$ref": "#/components/schemas/ImportExportPolicy" @@ -11226,7 +12837,7 @@ ] }, "allowed_import": { - "description": "Define import policy for a peer.", + "description": "Define import policy for this peer.", "allOf": [ { "$ref": "#/components/schemas/ImportExportPolicy" @@ -11242,7 +12853,7 @@ ] }, "communities": { - "description": "Include the provided communities in updates sent to the peer.", + "description": "Include the provided communities in updates sent to this peer.", "type": "array", "items": { "type": "integer", @@ -11279,7 +12890,7 @@ "minimum": 0 }, "interface_name": { - "description": "The name of interface to peer on. This is relative to the port configuration this BGP peer configuration is a part of. For example this value could be phy0 to refer to a primary physical interface. Or it could be vlan47 to refer to a VLAN interface.", + "description": "The name of the interface to peer on. This is relative to the port configuration this BGP peer configuration is a part of. For example this value could be phy0 to refer to a primary physical interface. Or it could be vlan47 to refer to a VLAN interface.", "type": "string" }, "keepalive": { @@ -11297,33 +12908,33 @@ }, "md5_auth_key": { "nullable": true, - "description": "Use the given key for TCP-MD5 authentication with the peer.", + "description": "Use the given key for TCP-MD5 authentication with this peer.", "type": "string" }, "min_ttl": { "nullable": true, - "description": "Require messages from a peer have a minimum IP time to live field.", + "description": "Require messages from this peer have a minimum IP time to live field.", "type": "integer", "format": "uint8", "minimum": 0 }, "multi_exit_discriminator": { "nullable": true, - "description": "Apply the provided multi-exit discriminator (MED) updates sent to the peer.", + "description": "Apply a multi-exit discriminator (MED) in updates sent to this peer.", "type": "integer", "format": "uint32", "minimum": 0 }, "remote_asn": { "nullable": true, - "description": "Require that a peer has a specified ASN.", + "description": "Require that this peer has a specified ASN.", "type": "integer", "format": "uint32", "minimum": 0 }, "vlan_id": { "nullable": true, - "description": "Associate a VLAN ID with a peer.", + "description": "Associate a VLAN ID with this peer.", "type": "integer", "format": "uint16", "minimum": 0 @@ -11350,7 +12961,7 @@ "peers": { "type": "array", "items": { - "$ref": "#/components/schemas/BgpPeer" + "$ref": "#/components/schemas/BgpPeerCombined" } } }, @@ -11358,6 +12969,34 @@ "peers" ] }, + "BgpPeerRemove": { + "description": "A BGP peer configuration to remove from an interface", + "type": "object", + "properties": { + "addr": { + "description": "The address of the host to peer with.", + "type": "string", + "format": "ip" + }, + "bgp_config": { + "description": "The global BGP configuration used for establishing a session with this peer.", + "allOf": [ + { + "$ref": "#/components/schemas/NameOrId" + } + ] + }, + "interface_name": { + "description": "The name of the interface to peer on. This is relative to the port configuration this BGP peer configuration is a part of. For example this value could be phy0 to refer to a primary physical interface. Or it could be vlan47 to refer to a VLAN interface.", + "type": "string" + } + }, + "required": [ + "addr", + "bgp_config", + "interface_name" + ] + }, "BgpPeerState": { "description": "The current state of a BGP peer.", "oneOf": [ @@ -17624,6 +19263,62 @@ } ] }, + "NamedLinkConfigCreate": { + "description": "Named switch link configuration.", + "type": "object", + "properties": { + "autoneg": { + "description": "Whether or not to set autonegotiation", + "type": "boolean" + }, + "fec": { + "description": "The forward error correction mode of the link.", + "allOf": [ + { + "$ref": "#/components/schemas/LinkFec" + } + ] + }, + "lldp_config": { + "nullable": true, + "description": "The optional link-layer discovery protocol (LLDP) configuration for the link.", + "allOf": [ + { + "$ref": "#/components/schemas/NameOrId" + } + ] + }, + "mtu": { + "description": "Maximum transmission unit for the link.", + "type": "integer", + "format": "uint16", + "minimum": 0 + }, + "name": { + "description": "Name of link", + "allOf": [ + { + "$ref": "#/components/schemas/Name" + } + ] + }, + "speed": { + "description": "The speed of the link.", + "allOf": [ + { + "$ref": "#/components/schemas/LinkSpeed" + } + ] + } + }, + "required": [ + "autoneg", + "fec", + "mtu", + "name", + "speed" + ] + }, "NetworkInterface": { "description": "Information required to construct a virtual network interface", "type": "object", @@ -18429,7 +20124,7 @@ }, "rib_priority": { "nullable": true, - "description": "Local preference for route. Higher preference indictes precedence within and across protocols.", + "description": "Local preference for route. Higher preference indicates precedence within and across protocols.", "type": "integer", "format": "uint8", "minimum": 0 @@ -18447,6 +20142,52 @@ "gw" ] }, + "RouteAddRemove": { + "description": "A network route to to add to or remove from an interface.", + "type": "object", + "properties": { + "dst": { + "description": "The route destination.", + "allOf": [ + { + "$ref": "#/components/schemas/IpNet" + } + ] + }, + "gw": { + "description": "The route gateway.", + "type": "string", + "format": "ip" + }, + "interface": { + "description": "The interface to configure the route on", + "allOf": [ + { + "$ref": "#/components/schemas/Name" + } + ] + }, + "rib_priority": { + "nullable": true, + "description": "Local preference for route. Higher preference indicates precedence within and across protocols.", + "type": "integer", + "format": "uint8", + "minimum": 0 + }, + "vid": { + "nullable": true, + "description": "VLAN id the gateway is reachable over.", + "type": "integer", + "format": "uint16", + "minimum": 0 + } + }, + "required": [ + "dst", + "gw", + "interface" + ] + }, "RouteConfig": { "description": "Route configuration data associated with a switch port configuration.", "type": "object", @@ -20682,7 +22423,7 @@ "description": "BGP peer settings.", "type": "array", "items": { - "$ref": "#/components/schemas/BgpPeer" + "$ref": "#/components/schemas/BgpPeerCombined" } }, "groups": { diff --git a/sdk-httpmock/src/generated_httpmock.rs b/sdk-httpmock/src/generated_httpmock.rs index 3ebf4a56..04f04d95 100644 --- a/sdk-httpmock/src/generated_httpmock.rs +++ b/sdk-httpmock/src/generated_httpmock.rs @@ -8109,6 +8109,258 @@ pub mod operations { } } + pub struct NetworkingSwitchPortActiveConfigurationViewWhen(httpmock::When); + impl NetworkingSwitchPortActiveConfigurationViewWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/hardware/racks/[^/]*/switch/[^/]*/switch-port/[^/]*/\ + configuration$", + ) + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn rack_id(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/{}/switch/.*/switch-port/.*/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn switch(self, value: types::SwitchLocation) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/.*/switch/{}/switch-port/.*/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn port(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/.*/switch/.*/switch-port/{}/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct NetworkingSwitchPortActiveConfigurationViewThen(httpmock::Then); + impl NetworkingSwitchPortActiveConfigurationViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::SwitchPortSettings) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct NetworkingSwitchPortActiveConfigurationSetWhen(httpmock::When); + impl NetworkingSwitchPortActiveConfigurationSetWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner.method(httpmock::Method::PUT).path_matches( + regex::Regex::new( + "^/v1/system/hardware/racks/[^/]*/switch/[^/]*/switch-port/[^/]*/\ + configuration$", + ) + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn rack_id(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/{}/switch/.*/switch-port/.*/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn switch(self, value: types::SwitchLocation) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/.*/switch/{}/switch-port/.*/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn port(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/.*/switch/.*/switch-port/{}/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::SwitchPortApplySettings) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct NetworkingSwitchPortActiveConfigurationSetThen(httpmock::Then); + impl NetworkingSwitchPortActiveConfigurationSetThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct NetworkingSwitchPortActiveConfigurationClearWhen(httpmock::When); + impl NetworkingSwitchPortActiveConfigurationClearWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner.method(httpmock::Method::DELETE).path_matches( + regex::Regex::new( + "^/v1/system/hardware/racks/[^/]*/switch/[^/]*/switch-port/[^/]*/\ + configuration$", + ) + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn rack_id(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/{}/switch/.*/switch-port/.*/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn switch(self, value: types::SwitchLocation) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/.*/switch/{}/switch-port/.*/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn port(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/racks/.*/switch/.*/switch-port/{}/configuration$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct NetworkingSwitchPortActiveConfigurationClearThen(httpmock::Then); + impl NetworkingSwitchPortActiveConfigurationClearThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + pub struct SledListWhen(httpmock::When); impl SledListWhen { pub fn new(inner: httpmock::When) -> Self { @@ -8850,7 +9102,7 @@ pub mod operations { Self(self.0.query_param("rack_id", value.to_string())) } - pub fn switch_location(self, value: &types::Name) -> Self { + pub fn switch_location(self, value: types::SwitchLocation) -> Self { Self(self.0.query_param("switch_location", value.to_string())) } @@ -8919,7 +9171,7 @@ pub mod operations { Self(self.0.query_param("rack_id", value.to_string())) } - pub fn switch_location(self, value: &types::Name) -> Self { + pub fn switch_location(self, value: types::SwitchLocation) -> Self { Self(self.0.query_param("switch_location", value.to_string())) } } @@ -8984,7 +9236,7 @@ pub mod operations { Self(self.0.query_param("rack_id", value.to_string())) } - pub fn switch_location(self, value: &types::Name) -> Self { + pub fn switch_location(self, value: types::SwitchLocation) -> Self { Self(self.0.query_param("switch_location", value.to_string())) } } @@ -11325,23 +11577,34 @@ pub mod operations { } } - pub struct NetworkingAllowListViewWhen(httpmock::When); - impl NetworkingAllowListViewWhen { + pub struct NetworkingAddressLotBlockAddWhen(httpmock::When); + impl NetworkingAddressLotBlockAddWhen { pub fn new(inner: httpmock::When) -> Self { - Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/networking/allow-list$").unwrap()), - ) + Self(inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new("^/v1/system/networking/address-lot/[^/]*/blocks/add$").unwrap(), + )) } pub fn into_inner(self) -> httpmock::When { self.0 } + + pub fn address_lot(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/address-lot/{}/blocks/add$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::AddressLotBlockAddRemove) -> Self { + Self(self.0.json_body_obj(value)) + } } - pub struct NetworkingAllowListViewThen(httpmock::Then); - impl NetworkingAllowListViewThen { + pub struct NetworkingAddressLotBlockAddThen(httpmock::Then); + impl NetworkingAddressLotBlockAddThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -11350,10 +11613,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::AllowList) -> Self { + pub fn created(self, value: &types::AddressLotBlock) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -11380,13 +11643,14 @@ pub mod operations { } } - pub struct NetworkingAllowListUpdateWhen(httpmock::When); - impl NetworkingAllowListUpdateWhen { + pub struct NetworkingAddressLotBlockRemoveWhen(httpmock::When); + impl NetworkingAddressLotBlockRemoveWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/system/networking/allow-list$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new("^/v1/system/networking/address-lot/[^/]*/blocks/remove$") + .unwrap(), + ), ) } @@ -11394,7 +11658,125 @@ pub mod operations { self.0 } - pub fn body(self, value: &types::AllowListUpdate) -> Self { + pub fn address_lot(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/address-lot/{}/blocks/remove$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::AddressLotBlockAddRemove) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct NetworkingAddressLotBlockRemoveThen(httpmock::Then); + impl NetworkingAddressLotBlockRemoveThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct NetworkingAllowListViewWhen(httpmock::When); + impl NetworkingAllowListViewWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/networking/allow-list$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + } + + pub struct NetworkingAllowListViewThen(httpmock::Then); + impl NetworkingAllowListViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::AllowList) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct NetworkingAllowListUpdateWhen(httpmock::When); + impl NetworkingAllowListUpdateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/system/networking/allow-list$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn body(self, value: &types::AllowListUpdate) -> Self { Self(self.0.json_body_obj(value)) } } @@ -11770,7 +12152,7 @@ pub mod operations { Self( inner .method(httpmock::Method::DELETE) - .path_matches(regex::Regex::new("^/v1/system/networking/bgp$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/networking/bgp/[^/]*$").unwrap()), ) } @@ -11778,8 +12160,13 @@ pub mod operations { self.0 } - pub fn name_or_id(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("name_or_id", value.to_string())) + pub fn bgp_config(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/bgp/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } } @@ -11946,10 +12333,10 @@ pub mod operations { self.0 } - pub fn created(self, value: &types::BgpAnnounceSet) -> Self { + pub fn ok(self, value: &types::BgpAnnounceSet) -> Self { Self( self.0 - .status(201u16) + .status(200u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -12571,11 +12958,11 @@ pub mod operations { } } - pub struct NetworkingSwitchPortSettingsListWhen(httpmock::When); - impl NetworkingSwitchPortSettingsListWhen { + pub struct NetworkingSwitchPortConfigurationListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationListWhen { pub fn new(inner: httpmock::When) -> Self { Self(inner.method(httpmock::Method::GET).path_matches( - regex::Regex::new("^/v1/system/networking/switch-port-settings$").unwrap(), + regex::Regex::new("^/v1/system/networking/switch-port-configuration$").unwrap(), )) } @@ -12583,49 +12970,49 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self + pub fn configuration<'a, T>(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + Self(self.0.query_param("configuration", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "configuration")) .is_none() })) } } - pub fn page_token<'a, T>(self, value: T) -> Self + pub fn limit(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + Self(self.0.query_param("limit", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) .is_none() })) } } - pub fn port_settings<'a, T>(self, value: T) -> Self + pub fn page_token<'a, T>(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("port_settings", value.to_string())) + Self(self.0.query_param("page_token", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "port_settings")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) .is_none() })) } @@ -12648,8 +13035,8 @@ pub mod operations { } } - pub struct NetworkingSwitchPortSettingsListThen(httpmock::Then); - impl NetworkingSwitchPortSettingsListThen { + pub struct NetworkingSwitchPortConfigurationListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -12688,11 +13075,11 @@ pub mod operations { } } - pub struct NetworkingSwitchPortSettingsCreateWhen(httpmock::When); - impl NetworkingSwitchPortSettingsCreateWhen { + pub struct NetworkingSwitchPortConfigurationCreateWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationCreateWhen { pub fn new(inner: httpmock::When) -> Self { Self(inner.method(httpmock::Method::POST).path_matches( - regex::Regex::new("^/v1/system/networking/switch-port-settings$").unwrap(), + regex::Regex::new("^/v1/system/networking/switch-port-configuration$").unwrap(), )) } @@ -12705,8 +13092,8 @@ pub mod operations { } } - pub struct NetworkingSwitchPortSettingsCreateThen(httpmock::Then); - impl NetworkingSwitchPortSettingsCreateThen { + pub struct NetworkingSwitchPortConfigurationCreateThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationCreateThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -12745,37 +13132,33 @@ pub mod operations { } } - pub struct NetworkingSwitchPortSettingsDeleteWhen(httpmock::When); - impl NetworkingSwitchPortSettingsDeleteWhen { + pub struct NetworkingSwitchPortConfigurationViewWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationViewWhen { pub fn new(inner: httpmock::When) -> Self { - Self(inner.method(httpmock::Method::DELETE).path_matches( - regex::Regex::new("^/v1/system/networking/switch-port-settings$").unwrap(), - )) + Self( + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/system/networking/switch-port-configuration/[^/]*$") + .unwrap(), + ), + ) } pub fn into_inner(self) -> httpmock::When { self.0 } - pub fn port_settings<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("port_settings", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "port_settings")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } } - pub struct NetworkingSwitchPortSettingsDeleteThen(httpmock::Then); - impl NetworkingSwitchPortSettingsDeleteThen { + pub struct NetworkingSwitchPortConfigurationViewThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -12784,8 +13167,13 @@ pub mod operations { self.0 } - pub fn no_content(self) -> Self { - Self(self.0.status(204u16)) + pub fn ok(self, value: &types::SwitchPortSettingsView) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -12809,21 +13197,24 @@ pub mod operations { } } - pub struct NetworkingSwitchPortSettingsViewWhen(httpmock::When); - impl NetworkingSwitchPortSettingsViewWhen { + pub struct NetworkingSwitchPortConfigurationDeleteWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationDeleteWhen { pub fn new(inner: httpmock::When) -> Self { - Self(inner.method(httpmock::Method::GET).path_matches( - regex::Regex::new("^/v1/system/networking/switch-port-settings/[^/]*$").unwrap(), - )) + Self( + inner.method(httpmock::Method::DELETE).path_matches( + regex::Regex::new("^/v1/system/networking/switch-port-configuration/[^/]*$") + .unwrap(), + ), + ) } pub fn into_inner(self) -> httpmock::When { self.0 } - pub fn port(self, value: &types::NameOrId) -> Self { + pub fn configuration(self, value: &types::NameOrId) -> Self { let re = regex::Regex::new(&format!( - "^/v1/system/networking/switch-port-settings/{}$", + "^/v1/system/networking/switch-port-configuration/{}$", value.to_string() )) .unwrap(); @@ -12831,8 +13222,8 @@ pub mod operations { } } - pub struct NetworkingSwitchPortSettingsViewThen(httpmock::Then); - impl NetworkingSwitchPortSettingsViewThen { + pub struct NetworkingSwitchPortConfigurationDeleteThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationDeleteThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -12841,13 +13232,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SwitchPortSettingsView) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -12871,23 +13257,35 @@ pub mod operations { } } - pub struct SystemPolicyViewWhen(httpmock::When); - impl SystemPolicyViewWhen { + pub struct NetworkingSwitchPortConfigurationAddressListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationAddressListWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/policy$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/address$", + ) + .unwrap(), + ), ) } pub fn into_inner(self) -> httpmock::When { self.0 } + + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/address$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } } - pub struct SystemPolicyViewThen(httpmock::Then); - impl SystemPolicyViewThen { + pub struct NetworkingSwitchPortConfigurationAddressListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationAddressListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -12896,7 +13294,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::FleetRolePolicy) -> Self { + pub fn ok(self, value: &Vec) -> Self { Self( self.0 .status(200u16) @@ -12926,13 +13324,16 @@ pub mod operations { } } - pub struct SystemPolicyUpdateWhen(httpmock::When); - impl SystemPolicyUpdateWhen { + pub struct NetworkingSwitchPortConfigurationAddressAddWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationAddressAddWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/system/policy$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/address/add$", + ) + .unwrap(), + ), ) } @@ -12940,13 +13341,22 @@ pub mod operations { self.0 } - pub fn body(self, value: &types::FleetRolePolicy) -> Self { + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/address/add$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::AddressAddRemove) -> Self { Self(self.0.json_body_obj(value)) } } - pub struct SystemPolicyUpdateThen(httpmock::Then); - impl SystemPolicyUpdateThen { + pub struct NetworkingSwitchPortConfigurationAddressAddThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationAddressAddThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -12955,10 +13365,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::FleetRolePolicy) -> Self { + pub fn created(self, value: &types::SwitchPortAddressConfig) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -12985,13 +13395,16 @@ pub mod operations { } } - pub struct RoleListWhen(httpmock::When); - impl RoleListWhen { + pub struct NetworkingSwitchPortConfigurationAddressRemoveWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationAddressRemoveWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/roles$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/address/remove$", + ) + .unwrap(), + ), ) } @@ -12999,41 +13412,22 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/address/remove$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::AddressAddRemove) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct RoleListThen(httpmock::Then); - impl RoleListThen { + pub struct NetworkingSwitchPortConfigurationAddressRemoveThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationAddressRemoveThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13042,13 +13436,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::RoleResultsPage) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -13072,13 +13461,16 @@ pub mod operations { } } - pub struct RoleViewWhen(httpmock::When); - impl RoleViewWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerListWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/roles/[^/]*$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer$", + ) + .unwrap(), + ), ) } @@ -13086,15 +13478,18 @@ pub mod operations { self.0 } - pub fn role_name(self, value: &str) -> Self { - let re = - regex::Regex::new(&format!("^/v1/system/roles/{}$", value.to_string())).unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } } - pub struct RoleViewThen(httpmock::Then); - impl RoleViewThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13103,7 +13498,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::Role) -> Self { + pub fn ok(self, value: &Vec) -> Self { Self( self.0 .status(200u16) @@ -13133,13 +13528,16 @@ pub mod operations { } } - pub struct SystemQuotasListWhen(httpmock::When); - impl SystemQuotasListWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAddWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerAddWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/silo-quotas$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/add$", + ) + .unwrap(), + ), ) } @@ -13147,57 +13545,22 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/add$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn body(self, value: &types::BgpPeer) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct SystemQuotasListThen(httpmock::Then); - impl SystemQuotasListThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAddThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerAddThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13206,10 +13569,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloQuotasResultsPage) -> Self { + pub fn created(self, value: &types::BgpPeer) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -13236,13 +13599,17 @@ pub mod operations { } } - pub struct SiloListWhen(httpmock::When); - impl SiloListWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerAllowExportListWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/silos$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + allow-export$", + ) + .unwrap(), + ), ) } @@ -13250,57 +13617,22 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-export$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn peer_address(self, value: &std::net::IpAddr) -> Self { + Self(self.0.query_param("peer_address", value.to_string())) } } - pub struct SiloListThen(httpmock::Then); - impl SiloListThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerAllowExportListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13309,7 +13641,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloResultsPage) -> Self { + pub fn ok(self, value: &Vec) -> Self { Self( self.0 .status(200u16) @@ -13339,13 +13671,17 @@ pub mod operations { } } - pub struct SiloCreateWhen(httpmock::When); - impl SiloCreateWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportAddWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerAllowExportAddWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::POST) - .path_matches(regex::Regex::new("^/v1/system/silos$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + allow-export/add$", + ) + .unwrap(), + ), ) } @@ -13353,13 +13689,22 @@ pub mod operations { self.0 } - pub fn body(self, value: &types::SiloCreate) -> Self { + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-export/add$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::AllowedPrefixAddRemove) -> Self { Self(self.0.json_body_obj(value)) } } - pub struct SiloCreateThen(httpmock::Then); - impl SiloCreateThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportAddThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerAllowExportAddThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13368,7 +13713,7 @@ pub mod operations { self.0 } - pub fn created(self, value: &types::Silo) -> Self { + pub fn created(self, value: &types::BgpAllowedPrefix) -> Self { Self( self.0 .status(201u16) @@ -13398,13 +13743,17 @@ pub mod operations { } } - pub struct SiloViewWhen(httpmock::When); - impl SiloViewWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + allow-export/remove$", + ) + .unwrap(), + ), ) } @@ -13412,15 +13761,22 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/system/silos/{}$", value.to_string())).unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-export/remove$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } + + pub fn body(self, value: &types::AllowedPrefixAddRemove) -> Self { + Self(self.0.json_body_obj(value)) + } } - pub struct SiloViewThen(httpmock::Then); - impl SiloViewThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13429,13 +13785,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::Silo) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -13459,13 +13810,17 @@ pub mod operations { } } - pub struct SiloDeleteWhen(httpmock::When); - impl SiloDeleteWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerAllowImportListWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::DELETE) - .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + allow-import$", + ) + .unwrap(), + ), ) } @@ -13473,15 +13828,22 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/system/silos/{}$", value.to_string())).unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-import$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } + + pub fn peer_address(self, value: &std::net::IpAddr) -> Self { + Self(self.0.query_param("peer_address", value.to_string())) + } } - pub struct SiloDeleteThen(httpmock::Then); - impl SiloDeleteThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerAllowImportListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13490,9 +13852,14 @@ pub mod operations { self.0 } - pub fn no_content(self) -> Self { - Self(self.0.status(204u16)) - } + pub fn ok(self, value: &Vec) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } pub fn client_error(self, status: u16, value: &types::Error) -> Self { assert_eq!(status / 100u16, 4u16); @@ -13515,13 +13882,17 @@ pub mod operations { } } - pub struct SiloIpPoolListWhen(httpmock::When); - impl SiloIpPoolListWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportAddWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerAllowImportAddWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/ip-pools$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + allow-import/add$", + ) + .unwrap(), + ), ) } @@ -13529,66 +13900,22 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { + pub fn configuration(self, value: &types::NameOrId) -> Self { let re = regex::Regex::new(&format!( - "^/v1/system/silos/{}/ip-pools$", + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-import/add$", value.to_string() )) .unwrap(); Self(self.0.path_matches(re)) } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } - } - - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn body(self, value: &types::AllowedPrefixAddRemove) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct SiloIpPoolListThen(httpmock::Then); - impl SiloIpPoolListThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportAddThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerAllowImportAddThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13597,10 +13924,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloIpPoolResultsPage) -> Self { + pub fn created(self, value: &types::BgpAllowedPrefix) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -13627,13 +13954,17 @@ pub mod operations { } } - pub struct SiloPolicyViewWhen(httpmock::When); - impl SiloPolicyViewWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/policy$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + allow-import/remove$", + ) + .unwrap(), + ), ) } @@ -13641,15 +13972,22 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/system/silos/{}/policy$", value.to_string())) - .unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-import/remove$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } + + pub fn body(self, value: &types::AllowedPrefixAddRemove) -> Self { + Self(self.0.json_body_obj(value)) + } } - pub struct SiloPolicyViewThen(httpmock::Then); - impl SiloPolicyViewThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13658,13 +13996,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloRolePolicy) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -13688,13 +14021,17 @@ pub mod operations { } } - pub struct SiloPolicyUpdateWhen(httpmock::When); - impl SiloPolicyUpdateWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerCommunityListWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/policy$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + community$", + ) + .unwrap(), + ), ) } @@ -13702,19 +14039,22 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/system/silos/{}/policy$", value.to_string())) - .unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/community$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } - pub fn body(self, value: &types::SiloRolePolicy) -> Self { - Self(self.0.json_body_obj(value)) + pub fn peer_address(self, value: &std::net::IpAddr) -> Self { + Self(self.0.query_param("peer_address", value.to_string())) } } - pub struct SiloPolicyUpdateThen(httpmock::Then); - impl SiloPolicyUpdateThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerCommunityListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13723,7 +14063,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloRolePolicy) -> Self { + pub fn ok(self, value: &Vec) -> Self { Self( self.0 .status(200u16) @@ -13753,13 +14093,17 @@ pub mod operations { } } - pub struct SiloQuotasViewWhen(httpmock::When); - impl SiloQuotasViewWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityAddWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerCommunityAddWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/quotas$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + community/add$", + ) + .unwrap(), + ), ) } @@ -13767,15 +14111,22 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/system/silos/{}/quotas$", value.to_string())) - .unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/community/add$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } + + pub fn body(self, value: &types::BgpCommunityAddRemove) -> Self { + Self(self.0.json_body_obj(value)) + } } - pub struct SiloQuotasViewThen(httpmock::Then); - impl SiloQuotasViewThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityAddThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerCommunityAddThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13784,10 +14135,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloQuotas) -> Self { + pub fn created(self, value: &types::BgpCommunity) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -13814,13 +14165,17 @@ pub mod operations { } } - pub struct SiloQuotasUpdateWhen(httpmock::When); - impl SiloQuotasUpdateWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/quotas$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/\ + community/remove$", + ) + .unwrap(), + ), ) } @@ -13828,19 +14183,22 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/system/silos/{}/quotas$", value.to_string())) - .unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/community/remove$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } - pub fn body(self, value: &types::SiloQuotasUpdate) -> Self { + pub fn body(self, value: &types::BgpCommunityAddRemove) -> Self { Self(self.0.json_body_obj(value)) } } - pub struct SiloQuotasUpdateThen(httpmock::Then); - impl SiloQuotasUpdateThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13849,13 +14207,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloQuotas) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -13879,13 +14232,16 @@ pub mod operations { } } - pub struct SiloUserListWhen(httpmock::When); - impl SiloUserListWhen { + pub struct NetworkingSwitchPortConfigurationBgpPeerRemoveWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationBgpPeerRemoveWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/users$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/bgp-peer/remove$", + ) + .unwrap(), + ), ) } @@ -13893,73 +14249,22 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } - } - - pub fn silo<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("silo", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "silo")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/bgp-peer/remove$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn body(self, value: &types::BgpPeerRemove) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct SiloUserListThen(httpmock::Then); - impl SiloUserListThen { + pub struct NetworkingSwitchPortConfigurationBgpPeerRemoveThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationBgpPeerRemoveThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -13968,13 +14273,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::UserResultsPage) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -13998,13 +14298,16 @@ pub mod operations { } } - pub struct SiloUserViewWhen(httpmock::When); - impl SiloUserViewWhen { + pub struct NetworkingSwitchPortConfigurationGeometryViewWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationGeometryViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/users/[^/]*$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/geometry$", + ) + .unwrap(), + ), ) } @@ -14012,19 +14315,18 @@ pub mod operations { self.0 } - pub fn user_id(self, value: &uuid::Uuid) -> Self { - let re = - regex::Regex::new(&format!("^/v1/system/users/{}$", value.to_string())).unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/geometry$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } - - pub fn silo(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("silo", value.to_string())) - } } - pub struct SiloUserViewThen(httpmock::Then); - impl SiloUserViewThen { + pub struct NetworkingSwitchPortConfigurationGeometryViewThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationGeometryViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14033,7 +14335,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::User) -> Self { + pub fn ok(self, value: &types::SwitchPortConfig) -> Self { Self( self.0 .status(200u16) @@ -14063,13 +14365,16 @@ pub mod operations { } } - pub struct UserBuiltinListWhen(httpmock::When); - impl UserBuiltinListWhen { + pub struct NetworkingSwitchPortConfigurationGeometrySetWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationGeometrySetWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/users-builtin$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/geometry$", + ) + .unwrap(), + ), ) } @@ -14077,57 +14382,22 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/geometry$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn body(self, value: &types::SwitchPortConfigCreate) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct UserBuiltinListThen(httpmock::Then); - impl UserBuiltinListThen { + pub struct NetworkingSwitchPortConfigurationGeometrySetThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationGeometrySetThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14136,10 +14406,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::UserBuiltinResultsPage) -> Self { + pub fn created(self, value: &types::SwitchPortConfig) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -14166,13 +14436,16 @@ pub mod operations { } } - pub struct UserBuiltinViewWhen(httpmock::When); - impl UserBuiltinViewWhen { + pub struct NetworkingSwitchPortConfigurationLinkListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationLinkListWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/users-builtin/[^/]*$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/link$", + ) + .unwrap(), + ), ) } @@ -14180,16 +14453,18 @@ pub mod operations { self.0 } - pub fn user(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/system/users-builtin/{}$", value.to_string())) - .unwrap(); + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/link$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } } - pub struct UserBuiltinViewThen(httpmock::Then); - impl UserBuiltinViewThen { + pub struct NetworkingSwitchPortConfigurationLinkListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationLinkListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14198,7 +14473,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::UserBuiltin) -> Self { + pub fn ok(self, value: &Vec) -> Self { Self( self.0 .status(200u16) @@ -14228,13 +14503,16 @@ pub mod operations { } } - pub struct SiloUtilizationListWhen(httpmock::When); - impl SiloUtilizationListWhen { + pub struct NetworkingSwitchPortConfigurationLinkCreateWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationLinkCreateWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/system/utilization/silos$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/link$", + ) + .unwrap(), + ), ) } @@ -14242,57 +14520,22 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/link$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn body(self, value: &types::NamedLinkConfigCreate) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct SiloUtilizationListThen(httpmock::Then); - impl SiloUtilizationListThen { + pub struct NetworkingSwitchPortConfigurationLinkCreateThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationLinkCreateThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14301,10 +14544,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloUtilizationResultsPage) -> Self { + pub fn created(self, value: &types::SwitchPortLinkConfig) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -14331,12 +14574,15 @@ pub mod operations { } } - pub struct SiloUtilizationViewWhen(httpmock::When); - impl SiloUtilizationViewWhen { + pub struct NetworkingSwitchPortConfigurationLinkViewWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationLinkViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner.method(httpmock::Method::GET).path_matches( - regex::Regex::new("^/v1/system/utilization/silos/[^/]*$").unwrap(), + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/link/[^/]*$", + ) + .unwrap(), ), ) } @@ -14345,9 +14591,18 @@ pub mod operations { self.0 } - pub fn silo(self, value: &types::NameOrId) -> Self { + pub fn configuration(self, value: &types::NameOrId) -> Self { let re = regex::Regex::new(&format!( - "^/v1/system/utilization/silos/{}$", + "^/v1/system/networking/switch-port-configuration/{}/link/.*$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn link(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/.*/link/{}$", value.to_string() )) .unwrap(); @@ -14355,8 +14610,8 @@ pub mod operations { } } - pub struct SiloUtilizationViewThen(httpmock::Then); - impl SiloUtilizationViewThen { + pub struct NetworkingSwitchPortConfigurationLinkViewThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationLinkViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14365,7 +14620,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SiloUtilization) -> Self { + pub fn ok(self, value: &types::SwitchPortLinkConfig) -> Self { Self( self.0 .status(200u16) @@ -14395,13 +14650,16 @@ pub mod operations { } } - pub struct TimeseriesQueryWhen(httpmock::When); - impl TimeseriesQueryWhen { + pub struct NetworkingSwitchPortConfigurationLinkDeleteWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationLinkDeleteWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::POST) - .path_matches(regex::Regex::new("^/v1/timeseries/query$").unwrap()), + inner.method(httpmock::Method::DELETE).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/link/[^/]*$", + ) + .unwrap(), + ), ) } @@ -14409,13 +14667,27 @@ pub mod operations { self.0 } - pub fn body(self, value: &types::TimeseriesQuery) -> Self { - Self(self.0.json_body_obj(value)) + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/link/.*$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn link(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/.*/link/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } } - pub struct TimeseriesQueryThen(httpmock::Then); - impl TimeseriesQueryThen { + pub struct NetworkingSwitchPortConfigurationLinkDeleteThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationLinkDeleteThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14424,13 +14696,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::OxqlQueryResult) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -14454,13 +14721,16 @@ pub mod operations { } } - pub struct TimeseriesSchemaListWhen(httpmock::When); - impl TimeseriesSchemaListWhen { + pub struct NetworkingSwitchPortConfigurationRouteListWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationRouteListWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/timeseries/schema$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/route$", + ) + .unwrap(), + ), ) } @@ -14468,41 +14738,18 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/route$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } } - pub struct TimeseriesSchemaListThen(httpmock::Then); - impl TimeseriesSchemaListThen { + pub struct NetworkingSwitchPortConfigurationRouteListThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationRouteListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14511,7 +14758,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::TimeseriesSchemaResultsPage) -> Self { + pub fn ok(self, value: &Vec) -> Self { Self( self.0 .status(200u16) @@ -14541,13 +14788,16 @@ pub mod operations { } } - pub struct UserListWhen(httpmock::When); - impl UserListWhen { + pub struct NetworkingSwitchPortConfigurationRouteAddWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationRouteAddWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/users$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/route/add$", + ) + .unwrap(), + ), ) } @@ -14555,73 +14805,22 @@ pub mod operations { self.0 } - pub fn group<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("group", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "group")) - .is_none() - })) - } - } - - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/route/add$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn body(self, value: &types::RouteAddRemove) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct UserListThen(httpmock::Then); - impl UserListThen { + pub struct NetworkingSwitchPortConfigurationRouteAddThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationRouteAddThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14630,10 +14829,10 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::UserResultsPage) -> Self { + pub fn created(self, value: &types::SwitchPortRouteConfig) -> Self { Self( self.0 - .status(200u16) + .status(201u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -14660,23 +14859,39 @@ pub mod operations { } } - pub struct UtilizationViewWhen(httpmock::When); - impl UtilizationViewWhen { + pub struct NetworkingSwitchPortConfigurationRouteRemoveWhen(httpmock::When); + impl NetworkingSwitchPortConfigurationRouteRemoveWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/utilization$").unwrap()), + inner.method(httpmock::Method::POST).path_matches( + regex::Regex::new( + "^/v1/system/networking/switch-port-configuration/[^/]*/route/remove$", + ) + .unwrap(), + ), ) } pub fn into_inner(self) -> httpmock::When { self.0 } + + pub fn configuration(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/networking/switch-port-configuration/{}/route/remove$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::RouteAddRemove) -> Self { + Self(self.0.json_body_obj(value)) + } } - pub struct UtilizationViewThen(httpmock::Then); - impl UtilizationViewThen { + pub struct NetworkingSwitchPortConfigurationRouteRemoveThen(httpmock::Then); + impl NetworkingSwitchPortConfigurationRouteRemoveThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14685,13 +14900,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::Utilization) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -14715,43 +14925,23 @@ pub mod operations { } } - pub struct VpcFirewallRulesViewWhen(httpmock::When); - impl VpcFirewallRulesViewWhen { + pub struct SystemPolicyViewWhen(httpmock::When); + impl SystemPolicyViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpc-firewall-rules$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/policy$").unwrap()), ) } pub fn into_inner(self) -> httpmock::When { self.0 } - - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn vpc(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("vpc", value.to_string())) - } } - pub struct VpcFirewallRulesViewThen(httpmock::Then); - impl VpcFirewallRulesViewThen { + pub struct SystemPolicyViewThen(httpmock::Then); + impl SystemPolicyViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14760,7 +14950,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcFirewallRules) -> Self { + pub fn ok(self, value: &types::FleetRolePolicy) -> Self { Self( self.0 .status(200u16) @@ -14790,13 +14980,13 @@ pub mod operations { } } - pub struct VpcFirewallRulesUpdateWhen(httpmock::When); - impl VpcFirewallRulesUpdateWhen { + pub struct SystemPolicyUpdateWhen(httpmock::When); + impl SystemPolicyUpdateWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/vpc-firewall-rules$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/policy$").unwrap()), ) } @@ -14804,33 +14994,13 @@ pub mod operations { self.0 } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn vpc(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("vpc", value.to_string())) - } - - pub fn body(self, value: &types::VpcFirewallRuleUpdateParams) -> Self { + pub fn body(self, value: &types::FleetRolePolicy) -> Self { Self(self.0.json_body_obj(value)) } } - pub struct VpcFirewallRulesUpdateThen(httpmock::Then); - impl VpcFirewallRulesUpdateThen { + pub struct SystemPolicyUpdateThen(httpmock::Then); + impl SystemPolicyUpdateThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -14839,7 +15009,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcFirewallRules) -> Self { + pub fn ok(self, value: &types::FleetRolePolicy) -> Self { Self( self.0 .status(200u16) @@ -14869,13 +15039,13 @@ pub mod operations { } } - pub struct VpcRouterRouteListWhen(httpmock::When); - impl VpcRouterRouteListWhen { + pub struct RoleListWhen(httpmock::When); + impl RoleListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpc-router-routes$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/roles$").unwrap()), ) } @@ -14914,83 +15084,19 @@ pub mod operations { })) } } + } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } + pub struct RoleListThen(httpmock::Then); + impl RoleListThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) } - pub fn router<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("router", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "router")) - .is_none() - })) - } + pub fn into_inner(self) -> httpmock::Then { + self.0 } - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } - } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } - } - } - - pub struct VpcRouterRouteListThen(httpmock::Then); - impl VpcRouterRouteListThen { - pub fn new(inner: httpmock::Then) -> Self { - Self(inner) - } - - pub fn into_inner(self) -> httpmock::Then { - self.0 - } - - pub fn ok(self, value: &types::RouterRouteResultsPage) -> Self { + pub fn ok(self, value: &types::RoleResultsPage) -> Self { Self( self.0 .status(200u16) @@ -15020,13 +15126,13 @@ pub mod operations { } } - pub struct VpcRouterRouteCreateWhen(httpmock::When); - impl VpcRouterRouteCreateWhen { + pub struct RoleViewWhen(httpmock::When); + impl RoleViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::POST) - .path_matches(regex::Regex::new("^/v1/vpc-router-routes$").unwrap()), + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/roles/[^/]*$").unwrap()), ) } @@ -15034,49 +15140,15 @@ pub mod operations { self.0 } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn router(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("router", value.to_string())) - } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } - } - - pub fn body(self, value: &types::RouterRouteCreate) -> Self { - Self(self.0.json_body_obj(value)) + pub fn role_name(self, value: &str) -> Self { + let re = + regex::Regex::new(&format!("^/v1/system/roles/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) } } - pub struct VpcRouterRouteCreateThen(httpmock::Then); - impl VpcRouterRouteCreateThen { + pub struct RoleViewThen(httpmock::Then); + impl RoleViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -15085,10 +15157,10 @@ pub mod operations { self.0 } - pub fn created(self, value: &types::RouterRoute) -> Self { + pub fn ok(self, value: &types::Role) -> Self { Self( self.0 - .status(201u16) + .status(200u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -15115,13 +15187,13 @@ pub mod operations { } } - pub struct VpcRouterRouteViewWhen(httpmock::When); - impl VpcRouterRouteViewWhen { + pub struct SystemQuotasListWhen(httpmock::When); + impl SystemQuotasListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpc-router-routes/[^/]*$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/silo-quotas$").unwrap()), ) } @@ -15129,51 +15201,57 @@ pub mod operations { self.0 } - pub fn route(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/vpc-router-routes/{}$", value.to_string())) - .unwrap(); - Self(self.0.path_matches(re)) - } - - pub fn project<'a, T>(self, value: T) -> Self + pub fn limit(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + Self(self.0.query_param("limit", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) .is_none() })) } } - pub fn router(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("router", value.to_string())) + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } } - pub fn vpc<'a, T>(self, value: T) -> Self + pub fn sort_by(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) + Self(self.0.query_param("sort_by", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) .is_none() })) } } } - pub struct VpcRouterRouteViewThen(httpmock::Then); - impl VpcRouterRouteViewThen { + pub struct SystemQuotasListThen(httpmock::Then); + impl SystemQuotasListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -15182,7 +15260,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::RouterRoute) -> Self { + pub fn ok(self, value: &types::SiloQuotasResultsPage) -> Self { Self( self.0 .status(200u16) @@ -15212,13 +15290,13 @@ pub mod operations { } } - pub struct VpcRouterRouteUpdateWhen(httpmock::When); - impl VpcRouterRouteUpdateWhen { + pub struct SiloListWhen(httpmock::When); + impl SiloListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/vpc-router-routes/[^/]*$").unwrap()), + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/silos$").unwrap()), ) } @@ -15226,67 +15304,57 @@ pub mod operations { self.0 } - pub fn route(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/vpc-router-routes/{}$", value.to_string())) - .unwrap(); - Self(self.0.path_matches(re)) - } - - pub fn project<'a, T>(self, value: T) -> Self + pub fn limit(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + Self(self.0.query_param("limit", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) .is_none() })) } } - pub fn router<'a, T>(self, value: T) -> Self + pub fn page_token<'a, T>(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("router", value.to_string())) + Self(self.0.query_param("page_token", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "router")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) .is_none() })) } } - pub fn vpc<'a, T>(self, value: T) -> Self + pub fn sort_by(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) + Self(self.0.query_param("sort_by", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) .is_none() })) } } - - pub fn body(self, value: &types::RouterRouteUpdate) -> Self { - Self(self.0.json_body_obj(value)) - } } - pub struct VpcRouterRouteUpdateThen(httpmock::Then); - impl VpcRouterRouteUpdateThen { + pub struct SiloListThen(httpmock::Then); + impl SiloListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -15295,7 +15363,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::RouterRoute) -> Self { + pub fn ok(self, value: &types::SiloResultsPage) -> Self { Self( self.0 .status(200u16) @@ -15325,13 +15393,13 @@ pub mod operations { } } - pub struct VpcRouterRouteDeleteWhen(httpmock::When); - impl VpcRouterRouteDeleteWhen { + pub struct SiloCreateWhen(httpmock::When); + impl SiloCreateWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::DELETE) - .path_matches(regex::Regex::new("^/v1/vpc-router-routes/[^/]*$").unwrap()), + .method(httpmock::Method::POST) + .path_matches(regex::Regex::new("^/v1/system/silos$").unwrap()), ) } @@ -15339,73 +15407,28 @@ pub mod operations { self.0 } - pub fn route(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/vpc-router-routes/{}$", value.to_string())) - .unwrap(); - Self(self.0.path_matches(re)) + pub fn body(self, value: &types::SiloCreate) -> Self { + Self(self.0.json_body_obj(value)) } + } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } + pub struct SiloCreateThen(httpmock::Then); + impl SiloCreateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) } - pub fn router<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("router", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "router")) - .is_none() - })) - } + pub fn into_inner(self) -> httpmock::Then { + self.0 } - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } - } - } - - pub struct VpcRouterRouteDeleteThen(httpmock::Then); - impl VpcRouterRouteDeleteThen { - pub fn new(inner: httpmock::Then) -> Self { - Self(inner) - } - - pub fn into_inner(self) -> httpmock::Then { - self.0 - } - - pub fn no_content(self) -> Self { - Self(self.0.status(204u16)) + pub fn created(self, value: &types::Silo) -> Self { + Self( + self.0 + .status(201u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -15429,13 +15452,13 @@ pub mod operations { } } - pub struct VpcRouterListWhen(httpmock::When); - impl VpcRouterListWhen { + pub struct SiloViewWhen(httpmock::When); + impl SiloViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpc-routers$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*$").unwrap()), ) } @@ -15443,89 +15466,15 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } - } - - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } - } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/system/silos/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) } } - pub struct VpcRouterListThen(httpmock::Then); - impl VpcRouterListThen { + pub struct SiloViewThen(httpmock::Then); + impl SiloViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -15534,7 +15483,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcRouterResultsPage) -> Self { + pub fn ok(self, value: &types::Silo) -> Self { Self( self.0 .status(200u16) @@ -15564,13 +15513,13 @@ pub mod operations { } } - pub struct VpcRouterCreateWhen(httpmock::When); - impl VpcRouterCreateWhen { + pub struct SiloDeleteWhen(httpmock::When); + impl SiloDeleteWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::POST) - .path_matches(regex::Regex::new("^/v1/vpc-routers$").unwrap()), + .method(httpmock::Method::DELETE) + .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*$").unwrap()), ) } @@ -15578,33 +15527,15 @@ pub mod operations { self.0 } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn vpc(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("vpc", value.to_string())) - } - - pub fn body(self, value: &types::VpcRouterCreate) -> Self { - Self(self.0.json_body_obj(value)) + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/system/silos/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) } } - pub struct VpcRouterCreateThen(httpmock::Then); - impl VpcRouterCreateThen { + pub struct SiloDeleteThen(httpmock::Then); + impl SiloDeleteThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -15613,13 +15544,8 @@ pub mod operations { self.0 } - pub fn created(self, value: &types::VpcRouter) -> Self { - Self( - self.0 - .status(201u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -15643,13 +15569,13 @@ pub mod operations { } } - pub struct VpcRouterViewWhen(httpmock::When); - impl VpcRouterViewWhen { + pub struct SiloIpPoolListWhen(httpmock::When); + impl SiloIpPoolListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpc-routers/[^/]*$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/ip-pools$").unwrap()), ) } @@ -15657,47 +15583,66 @@ pub mod operations { self.0 } - pub fn router(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/vpc-routers/{}$", value.to_string())).unwrap(); + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/silos/{}/ip-pools$", + value.to_string() + )) + .unwrap(); Self(self.0.path_matches(re)) } - pub fn project<'a, T>(self, value: T) -> Self + pub fn limit(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + Self(self.0.query_param("limit", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) .is_none() })) } } - pub fn vpc<'a, T>(self, value: T) -> Self + pub fn page_token<'a, T>(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) + Self(self.0.query_param("page_token", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) .is_none() })) } } } - pub struct VpcRouterViewThen(httpmock::Then); - impl VpcRouterViewThen { + pub struct SiloIpPoolListThen(httpmock::Then); + impl SiloIpPoolListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -15706,7 +15651,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcRouter) -> Self { + pub fn ok(self, value: &types::SiloIpPoolResultsPage) -> Self { Self( self.0 .status(200u16) @@ -15736,13 +15681,13 @@ pub mod operations { } } - pub struct VpcRouterUpdateWhen(httpmock::When); - impl VpcRouterUpdateWhen { + pub struct SiloPolicyViewWhen(httpmock::When); + impl SiloPolicyViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/vpc-routers/[^/]*$").unwrap()), + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/policy$").unwrap()), ) } @@ -15750,60 +15695,24 @@ pub mod operations { self.0 } - pub fn router(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/vpc-routers/{}$", value.to_string())).unwrap(); + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/system/silos/{}/policy$", value.to_string())) + .unwrap(); Self(self.0.path_matches(re)) } + } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } - } - - pub fn body(self, value: &types::VpcRouterUpdate) -> Self { - Self(self.0.json_body_obj(value)) - } - } - - pub struct VpcRouterUpdateThen(httpmock::Then); - impl VpcRouterUpdateThen { - pub fn new(inner: httpmock::Then) -> Self { - Self(inner) + pub struct SiloPolicyViewThen(httpmock::Then); + impl SiloPolicyViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) } pub fn into_inner(self) -> httpmock::Then { self.0 } - pub fn ok(self, value: &types::VpcRouter) -> Self { + pub fn ok(self, value: &types::SiloRolePolicy) -> Self { Self( self.0 .status(200u16) @@ -15833,13 +15742,13 @@ pub mod operations { } } - pub struct VpcRouterDeleteWhen(httpmock::When); - impl VpcRouterDeleteWhen { + pub struct SiloPolicyUpdateWhen(httpmock::When); + impl SiloPolicyUpdateWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::DELETE) - .path_matches(regex::Regex::new("^/v1/vpc-routers/[^/]*$").unwrap()), + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/policy$").unwrap()), ) } @@ -15847,47 +15756,19 @@ pub mod operations { self.0 } - pub fn router(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/vpc-routers/{}$", value.to_string())).unwrap(); + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/system/silos/{}/policy$", value.to_string())) + .unwrap(); Self(self.0.path_matches(re)) } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } + pub fn body(self, value: &types::SiloRolePolicy) -> Self { + Self(self.0.json_body_obj(value)) } } - pub struct VpcRouterDeleteThen(httpmock::Then); - impl VpcRouterDeleteThen { + pub struct SiloPolicyUpdateThen(httpmock::Then); + impl SiloPolicyUpdateThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -15896,8 +15777,13 @@ pub mod operations { self.0 } - pub fn no_content(self) -> Self { - Self(self.0.status(204u16)) + pub fn ok(self, value: &types::SiloRolePolicy) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -15921,13 +15807,13 @@ pub mod operations { } } - pub struct VpcSubnetListWhen(httpmock::When); - impl VpcSubnetListWhen { + pub struct SiloQuotasViewWhen(httpmock::When); + impl SiloQuotasViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpc-subnets$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/quotas$").unwrap()), ) } @@ -15935,89 +15821,15 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } - } - - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } - } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/system/silos/{}/quotas$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) } } - pub struct VpcSubnetListThen(httpmock::Then); - impl VpcSubnetListThen { + pub struct SiloQuotasViewThen(httpmock::Then); + impl SiloQuotasViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16026,7 +15838,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcSubnetResultsPage) -> Self { + pub fn ok(self, value: &types::SiloQuotas) -> Self { Self( self.0 .status(200u16) @@ -16056,13 +15868,13 @@ pub mod operations { } } - pub struct VpcSubnetCreateWhen(httpmock::When); - impl VpcSubnetCreateWhen { + pub struct SiloQuotasUpdateWhen(httpmock::When); + impl SiloQuotasUpdateWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::POST) - .path_matches(regex::Regex::new("^/v1/vpc-subnets$").unwrap()), + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/system/silos/[^/]*/quotas$").unwrap()), ) } @@ -16070,33 +15882,19 @@ pub mod operations { self.0 } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn vpc(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("vpc", value.to_string())) + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/system/silos/{}/quotas$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) } - pub fn body(self, value: &types::VpcSubnetCreate) -> Self { + pub fn body(self, value: &types::SiloQuotasUpdate) -> Self { Self(self.0.json_body_obj(value)) } } - pub struct VpcSubnetCreateThen(httpmock::Then); - impl VpcSubnetCreateThen { + pub struct SiloQuotasUpdateThen(httpmock::Then); + impl SiloQuotasUpdateThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16105,10 +15903,10 @@ pub mod operations { self.0 } - pub fn created(self, value: &types::VpcSubnet) -> Self { + pub fn ok(self, value: &types::SiloQuotas) -> Self { Self( self.0 - .status(201u16) + .status(200u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -16135,13 +15933,13 @@ pub mod operations { } } - pub struct VpcSubnetViewWhen(httpmock::When); - impl VpcSubnetViewWhen { + pub struct SiloUserListWhen(httpmock::When); + impl SiloUserListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpc-subnets/[^/]*$").unwrap()), + .path_matches(regex::Regex::new("^/v1/system/users$").unwrap()), ) } @@ -16149,47 +15947,73 @@ pub mod operations { self.0 } - pub fn subnet(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/vpc-subnets/{}$", value.to_string())).unwrap(); - Self(self.0.path_matches(re)) + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } } - pub fn project<'a, T>(self, value: T) -> Self + pub fn page_token<'a, T>(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + Self(self.0.query_param("page_token", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) .is_none() })) } } - pub fn vpc<'a, T>(self, value: T) -> Self + pub fn silo<'a, T>(self, value: T) -> Self where T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) + Self(self.0.query_param("silo", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "silo")) .is_none() })) } } - } - pub struct VpcSubnetViewThen(httpmock::Then); - impl VpcSubnetViewThen { + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + } + + pub struct SiloUserListThen(httpmock::Then); + impl SiloUserListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16198,7 +16022,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcSubnet) -> Self { + pub fn ok(self, value: &types::UserResultsPage) -> Self { Self( self.0 .status(200u16) @@ -16228,13 +16052,13 @@ pub mod operations { } } - pub struct VpcSubnetUpdateWhen(httpmock::When); - impl VpcSubnetUpdateWhen { + pub struct SiloUserViewWhen(httpmock::When); + impl SiloUserViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/vpc-subnets/[^/]*$").unwrap()), + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/users/[^/]*$").unwrap()), ) } @@ -16242,51 +16066,19 @@ pub mod operations { self.0 } - pub fn subnet(self, value: &types::NameOrId) -> Self { + pub fn user_id(self, value: &uuid::Uuid) -> Self { let re = - regex::Regex::new(&format!("^/v1/vpc-subnets/{}$", value.to_string())).unwrap(); + regex::Regex::new(&format!("^/v1/system/users/{}$", value.to_string())).unwrap(); Self(self.0.path_matches(re)) } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } - } - - pub fn body(self, value: &types::VpcSubnetUpdate) -> Self { - Self(self.0.json_body_obj(value)) + pub fn silo(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("silo", value.to_string())) } } - pub struct VpcSubnetUpdateThen(httpmock::Then); - impl VpcSubnetUpdateThen { + pub struct SiloUserViewThen(httpmock::Then); + impl SiloUserViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16295,7 +16087,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcSubnet) -> Self { + pub fn ok(self, value: &types::User) -> Self { Self( self.0 .status(200u16) @@ -16325,13 +16117,13 @@ pub mod operations { } } - pub struct VpcSubnetDeleteWhen(httpmock::When); - impl VpcSubnetDeleteWhen { + pub struct UserBuiltinListWhen(httpmock::When); + impl UserBuiltinListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::DELETE) - .path_matches(regex::Regex::new("^/v1/vpc-subnets/[^/]*$").unwrap()), + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/users-builtin$").unwrap()), ) } @@ -16339,47 +16131,57 @@ pub mod operations { self.0 } - pub fn subnet(self, value: &types::NameOrId) -> Self { - let re = - regex::Regex::new(&format!("^/v1/vpc-subnets/{}$", value.to_string())).unwrap(); - Self(self.0.path_matches(re)) + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } } - pub fn project<'a, T>(self, value: T) -> Self + pub fn page_token<'a, T>(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + Self(self.0.query_param("page_token", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) .is_none() })) } } - pub fn vpc<'a, T>(self, value: T) -> Self + pub fn sort_by(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) + Self(self.0.query_param("sort_by", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) .is_none() })) } } } - pub struct VpcSubnetDeleteThen(httpmock::Then); - impl VpcSubnetDeleteThen { + pub struct UserBuiltinListThen(httpmock::Then); + impl UserBuiltinListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16388,8 +16190,13 @@ pub mod operations { self.0 } - pub fn no_content(self) -> Self { - Self(self.0.status(204u16)) + pub fn ok(self, value: &types::UserBuiltinResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -16413,26 +16220,81 @@ pub mod operations { } } - pub struct VpcSubnetListNetworkInterfacesWhen(httpmock::When); - impl VpcSubnetListNetworkInterfacesWhen { + pub struct UserBuiltinViewWhen(httpmock::When); + impl UserBuiltinViewWhen { pub fn new(inner: httpmock::When) -> Self { - Self(inner.method(httpmock::Method::GET).path_matches( - regex::Regex::new("^/v1/vpc-subnets/[^/]*/network-interfaces$").unwrap(), - )) + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/users-builtin/[^/]*$").unwrap()), + ) } pub fn into_inner(self) -> httpmock::When { self.0 } - pub fn subnet(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!( - "^/v1/vpc-subnets/{}/network-interfaces$", - value.to_string() - )) - .unwrap(); + pub fn user(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/system/users-builtin/{}$", value.to_string())) + .unwrap(); Self(self.0.path_matches(re)) } + } + + pub struct UserBuiltinViewThen(httpmock::Then); + impl UserBuiltinViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::UserBuiltin) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct SiloUtilizationListWhen(httpmock::When); + impl SiloUtilizationListWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/system/utilization/silos$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } pub fn limit(self, value: T) -> Self where @@ -16466,22 +16328,6 @@ pub mod operations { } } - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - pub fn sort_by(self, value: T) -> Self where T: Into>, @@ -16497,26 +16343,10 @@ pub mod operations { })) } } - - pub fn vpc<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("vpc", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) - .is_none() - })) - } - } } - pub struct VpcSubnetListNetworkInterfacesThen(httpmock::Then); - impl VpcSubnetListNetworkInterfacesThen { + pub struct SiloUtilizationListThen(httpmock::Then); + impl SiloUtilizationListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16525,7 +16355,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::InstanceNetworkInterfaceResultsPage) -> Self { + pub fn ok(self, value: &types::SiloUtilizationResultsPage) -> Self { Self( self.0 .status(200u16) @@ -16555,13 +16385,13 @@ pub mod operations { } } - pub struct VpcListWhen(httpmock::When); - impl VpcListWhen { + pub struct SiloUtilizationViewWhen(httpmock::When); + impl SiloUtilizationViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( - inner - .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpcs$").unwrap()), + inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/system/utilization/silos/[^/]*$").unwrap(), + ), ) } @@ -16569,73 +16399,18 @@ pub mod operations { self.0 } - pub fn limit(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) - .is_none() - })) - } - } - - pub fn page_token<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } - } - - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } - - pub fn sort_by(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) - .is_none() - })) - } + pub fn silo(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/utilization/silos/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } } - pub struct VpcListThen(httpmock::Then); - impl VpcListThen { + pub struct SiloUtilizationViewThen(httpmock::Then); + impl SiloUtilizationViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16644,7 +16419,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::VpcResultsPage) -> Self { + pub fn ok(self, value: &types::SiloUtilization) -> Self { Self( self.0 .status(200u16) @@ -16674,13 +16449,13 @@ pub mod operations { } } - pub struct VpcCreateWhen(httpmock::When); - impl VpcCreateWhen { + pub struct TimeseriesQueryWhen(httpmock::When); + impl TimeseriesQueryWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::POST) - .path_matches(regex::Regex::new("^/v1/vpcs$").unwrap()), + .path_matches(regex::Regex::new("^/v1/timeseries/query$").unwrap()), ) } @@ -16688,17 +16463,13 @@ pub mod operations { self.0 } - pub fn project(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("project", value.to_string())) - } - - pub fn body(self, value: &types::VpcCreate) -> Self { + pub fn body(self, value: &types::TimeseriesQuery) -> Self { Self(self.0.json_body_obj(value)) } } - pub struct VpcCreateThen(httpmock::Then); - impl VpcCreateThen { + pub struct TimeseriesQueryThen(httpmock::Then); + impl TimeseriesQueryThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16707,10 +16478,10 @@ pub mod operations { self.0 } - pub fn created(self, value: &types::Vpc) -> Self { + pub fn ok(self, value: &types::OxqlQueryResult) -> Self { Self( self.0 - .status(201u16) + .status(200u16) .header("content-type", "application/json") .json_body_obj(value), ) @@ -16737,13 +16508,13 @@ pub mod operations { } } - pub struct VpcViewWhen(httpmock::When); - impl VpcViewWhen { + pub struct TimeseriesSchemaListWhen(httpmock::When); + impl TimeseriesSchemaListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner .method(httpmock::Method::GET) - .path_matches(regex::Regex::new("^/v1/vpcs/[^/]*$").unwrap()), + .path_matches(regex::Regex::new("^/v1/timeseries/schema$").unwrap()), ) } @@ -16751,30 +16522,41 @@ pub mod operations { self.0 } - pub fn vpc(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/vpcs/{}$", value.to_string())).unwrap(); - Self(self.0.path_matches(re)) + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } } - pub fn project<'a, T>(self, value: T) -> Self + pub fn page_token<'a, T>(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + Self(self.0.query_param("page_token", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) .is_none() })) } } } - pub struct VpcViewThen(httpmock::Then); - impl VpcViewThen { + pub struct TimeseriesSchemaListThen(httpmock::Then); + impl TimeseriesSchemaListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16783,7 +16565,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::Vpc) -> Self { + pub fn ok(self, value: &types::TimeseriesSchemaResultsPage) -> Self { Self( self.0 .status(200u16) @@ -16813,13 +16595,13 @@ pub mod operations { } } - pub struct VpcUpdateWhen(httpmock::When); - impl VpcUpdateWhen { + pub struct UserListWhen(httpmock::When); + impl UserListWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::PUT) - .path_matches(regex::Regex::new("^/v1/vpcs/[^/]*$").unwrap()), + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/users$").unwrap()), ) } @@ -16827,34 +16609,73 @@ pub mod operations { self.0 } - pub fn vpc(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/vpcs/{}$", value.to_string())).unwrap(); - Self(self.0.path_matches(re)) + pub fn group<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("group", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "group")) + .is_none() + })) + } } - pub fn project<'a, T>(self, value: T) -> Self + pub fn limit(self, value: T) -> Self where - T: Into>, + T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + Self(self.0.query_param("limit", value.to_string())) } else { Self(self.0.matches(|req| { req.query_params .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) .is_none() })) } } - pub fn body(self, value: &types::VpcUpdate) -> Self { - Self(self.0.json_body_obj(value)) + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } } } - pub struct VpcUpdateThen(httpmock::Then); - impl VpcUpdateThen { + pub struct UserListThen(httpmock::Then); + impl UserListThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16863,7 +16684,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::Vpc) -> Self { + pub fn ok(self, value: &types::UserResultsPage) -> Self { Self( self.0 .status(200u16) @@ -16893,44 +16714,23 @@ pub mod operations { } } - pub struct VpcDeleteWhen(httpmock::When); - impl VpcDeleteWhen { + pub struct UtilizationViewWhen(httpmock::When); + impl UtilizationViewWhen { pub fn new(inner: httpmock::When) -> Self { Self( inner - .method(httpmock::Method::DELETE) - .path_matches(regex::Regex::new("^/v1/vpcs/[^/]*$").unwrap()), + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/utilization$").unwrap()), ) } pub fn into_inner(self) -> httpmock::When { self.0 } - - pub fn vpc(self, value: &types::NameOrId) -> Self { - let re = regex::Regex::new(&format!("^/v1/vpcs/{}$", value.to_string())).unwrap(); - Self(self.0.path_matches(re)) - } - - pub fn project<'a, T>(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) - .is_none() - })) - } - } } - pub struct VpcDeleteThen(httpmock::Then); - impl VpcDeleteThen { + pub struct UtilizationViewThen(httpmock::Then); + impl UtilizationViewThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -16939,8 +16739,13 @@ pub mod operations { self.0 } - pub fn no_content(self) -> Self { - Self(self.0.status(204u16)) + pub fn ok(self, value: &types::Utilization) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -16963,19 +16768,2268 @@ pub mod operations { ) } } -} -/// An extension trait for [`MockServer`](httpmock::MockServer) that -/// adds a method for each operation. These are the equivalent of -/// type-checked [`mock()`](httpmock::MockServer::mock) calls. -pub trait MockServerExt { - fn device_auth_request(&self, config_fn: F) -> httpmock::Mock - where - F: FnOnce(operations::DeviceAuthRequestWhen, operations::DeviceAuthRequestThen); - fn device_auth_confirm(&self, config_fn: F) -> httpmock::Mock - where - F: FnOnce(operations::DeviceAuthConfirmWhen, operations::DeviceAuthConfirmThen); - fn device_access_token(&self, config_fn: F) -> httpmock::Mock + pub struct VpcFirewallRulesViewWhen(httpmock::When); + impl VpcFirewallRulesViewWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpc-firewall-rules$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("vpc", value.to_string())) + } + } + + pub struct VpcFirewallRulesViewThen(httpmock::Then); + impl VpcFirewallRulesViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcFirewallRules) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcFirewallRulesUpdateWhen(httpmock::When); + impl VpcFirewallRulesUpdateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/vpc-firewall-rules$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("vpc", value.to_string())) + } + + pub fn body(self, value: &types::VpcFirewallRuleUpdateParams) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcFirewallRulesUpdateThen(httpmock::Then); + impl VpcFirewallRulesUpdateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcFirewallRules) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterRouteListWhen(httpmock::When); + impl VpcRouterRouteListWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpc-router-routes$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } + } + + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn router<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("router", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "router")) + .is_none() + })) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcRouterRouteListThen(httpmock::Then); + impl VpcRouterRouteListThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::RouterRouteResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterRouteCreateWhen(httpmock::When); + impl VpcRouterRouteCreateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::POST) + .path_matches(regex::Regex::new("^/v1/vpc-router-routes$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn router(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("router", value.to_string())) + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + + pub fn body(self, value: &types::RouterRouteCreate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcRouterRouteCreateThen(httpmock::Then); + impl VpcRouterRouteCreateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::RouterRoute) -> Self { + Self( + self.0 + .status(201u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterRouteViewWhen(httpmock::When); + impl VpcRouterRouteViewWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpc-router-routes/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn route(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/vpc-router-routes/{}$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn router(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("router", value.to_string())) + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcRouterRouteViewThen(httpmock::Then); + impl VpcRouterRouteViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::RouterRoute) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterRouteUpdateWhen(httpmock::When); + impl VpcRouterRouteUpdateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/vpc-router-routes/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn route(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/vpc-router-routes/{}$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn router<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("router", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "router")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + + pub fn body(self, value: &types::RouterRouteUpdate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcRouterRouteUpdateThen(httpmock::Then); + impl VpcRouterRouteUpdateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::RouterRoute) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterRouteDeleteWhen(httpmock::When); + impl VpcRouterRouteDeleteWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::DELETE) + .path_matches(regex::Regex::new("^/v1/vpc-router-routes/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn route(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/vpc-router-routes/{}$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn router<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("router", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "router")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcRouterRouteDeleteThen(httpmock::Then); + impl VpcRouterRouteDeleteThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterListWhen(httpmock::When); + impl VpcRouterListWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpc-routers$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } + } + + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcRouterListThen(httpmock::Then); + impl VpcRouterListThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcRouterResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterCreateWhen(httpmock::When); + impl VpcRouterCreateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::POST) + .path_matches(regex::Regex::new("^/v1/vpc-routers$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("vpc", value.to_string())) + } + + pub fn body(self, value: &types::VpcRouterCreate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcRouterCreateThen(httpmock::Then); + impl VpcRouterCreateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::VpcRouter) -> Self { + Self( + self.0 + .status(201u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterViewWhen(httpmock::When); + impl VpcRouterViewWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpc-routers/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn router(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/vpc-routers/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcRouterViewThen(httpmock::Then); + impl VpcRouterViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcRouter) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterUpdateWhen(httpmock::When); + impl VpcRouterUpdateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/vpc-routers/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn router(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/vpc-routers/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + + pub fn body(self, value: &types::VpcRouterUpdate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcRouterUpdateThen(httpmock::Then); + impl VpcRouterUpdateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcRouter) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcRouterDeleteWhen(httpmock::When); + impl VpcRouterDeleteWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::DELETE) + .path_matches(regex::Regex::new("^/v1/vpc-routers/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn router(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/vpc-routers/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcRouterDeleteThen(httpmock::Then); + impl VpcRouterDeleteThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcSubnetListWhen(httpmock::When); + impl VpcSubnetListWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpc-subnets$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } + } + + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcSubnetListThen(httpmock::Then); + impl VpcSubnetListThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcSubnetResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcSubnetCreateWhen(httpmock::When); + impl VpcSubnetCreateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::POST) + .path_matches(regex::Regex::new("^/v1/vpc-subnets$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("vpc", value.to_string())) + } + + pub fn body(self, value: &types::VpcSubnetCreate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcSubnetCreateThen(httpmock::Then); + impl VpcSubnetCreateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::VpcSubnet) -> Self { + Self( + self.0 + .status(201u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcSubnetViewWhen(httpmock::When); + impl VpcSubnetViewWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpc-subnets/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn subnet(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/vpc-subnets/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcSubnetViewThen(httpmock::Then); + impl VpcSubnetViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcSubnet) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcSubnetUpdateWhen(httpmock::When); + impl VpcSubnetUpdateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/vpc-subnets/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn subnet(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/vpc-subnets/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + + pub fn body(self, value: &types::VpcSubnetUpdate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcSubnetUpdateThen(httpmock::Then); + impl VpcSubnetUpdateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcSubnet) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcSubnetDeleteWhen(httpmock::When); + impl VpcSubnetDeleteWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::DELETE) + .path_matches(regex::Regex::new("^/v1/vpc-subnets/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn subnet(self, value: &types::NameOrId) -> Self { + let re = + regex::Regex::new(&format!("^/v1/vpc-subnets/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcSubnetDeleteThen(httpmock::Then); + impl VpcSubnetDeleteThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcSubnetListNetworkInterfacesWhen(httpmock::When); + impl VpcSubnetListNetworkInterfacesWhen { + pub fn new(inner: httpmock::When) -> Self { + Self(inner.method(httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/vpc-subnets/[^/]*/network-interfaces$").unwrap(), + )) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn subnet(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/vpc-subnets/{}/network-interfaces$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } + } + + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + + pub fn vpc<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("vpc", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "vpc")) + .is_none() + })) + } + } + } + + pub struct VpcSubnetListNetworkInterfacesThen(httpmock::Then); + impl VpcSubnetListNetworkInterfacesThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::InstanceNetworkInterfaceResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcListWhen(httpmock::When); + impl VpcListWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpcs$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } + } + + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + } + + pub struct VpcListThen(httpmock::Then); + impl VpcListThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::VpcResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcCreateWhen(httpmock::When); + impl VpcCreateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::POST) + .path_matches(regex::Regex::new("^/v1/vpcs$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn project(self, value: &types::NameOrId) -> Self { + Self(self.0.query_param("project", value.to_string())) + } + + pub fn body(self, value: &types::VpcCreate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcCreateThen(httpmock::Then); + impl VpcCreateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::Vpc) -> Self { + Self( + self.0 + .status(201u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcViewWhen(httpmock::When); + impl VpcViewWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/vpcs/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn vpc(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/vpcs/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + } + + pub struct VpcViewThen(httpmock::Then); + impl VpcViewThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::Vpc) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcUpdateWhen(httpmock::When); + impl VpcUpdateWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/vpcs/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn vpc(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/vpcs/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn body(self, value: &types::VpcUpdate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct VpcUpdateThen(httpmock::Then); + impl VpcUpdateThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::Vpc) -> Self { + Self( + self.0 + .status(200u16) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } + + pub struct VpcDeleteWhen(httpmock::When); + impl VpcDeleteWhen { + pub fn new(inner: httpmock::When) -> Self { + Self( + inner + .method(httpmock::Method::DELETE) + .path_matches(regex::Regex::new("^/v1/vpcs/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> httpmock::When { + self.0 + } + + pub fn vpc(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/vpcs/{}$", value.to_string())).unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + } + + pub struct VpcDeleteThen(httpmock::Then); + impl VpcDeleteThen { + pub fn new(inner: httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + pub fn client_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 4u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + + pub fn server_error(self, status: u16, value: &types::Error) -> Self { + assert_eq!(status / 100u16, 5u16); + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body_obj(value), + ) + } + } +} + +/// An extension trait for [`MockServer`](httpmock::MockServer) that +/// adds a method for each operation. These are the equivalent of +/// type-checked [`mock()`](httpmock::MockServer::mock) calls. +pub trait MockServerExt { + fn device_auth_request(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DeviceAuthRequestWhen, operations::DeviceAuthRequestThen); + fn device_auth_confirm(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DeviceAuthConfirmWhen, operations::DeviceAuthConfirmThen); + fn device_access_token(&self, config_fn: F) -> httpmock::Mock where F: FnOnce(operations::DeviceAccessTokenWhen, operations::DeviceAccessTokenThen); fn probe_list(&self, config_fn: F) -> httpmock::Mock @@ -17308,6 +19362,24 @@ pub trait MockServerExt { fn rack_view(&self, config_fn: F) -> httpmock::Mock where F: FnOnce(operations::RackViewWhen, operations::RackViewThen); + fn networking_switch_port_active_configuration_view(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortActiveConfigurationViewWhen, + operations::NetworkingSwitchPortActiveConfigurationViewThen, + ); + fn networking_switch_port_active_configuration_set(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortActiveConfigurationSetWhen, + operations::NetworkingSwitchPortActiveConfigurationSetThen, + ); + fn networking_switch_port_active_configuration_clear(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortActiveConfigurationClearWhen, + operations::NetworkingSwitchPortActiveConfigurationClearThen, + ); fn sled_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce(operations::SledListWhen, operations::SledListThen); @@ -17467,6 +19539,18 @@ pub trait MockServerExt { operations::NetworkingAddressLotBlockListWhen, operations::NetworkingAddressLotBlockListThen, ); + fn networking_address_lot_block_add(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingAddressLotBlockAddWhen, + operations::NetworkingAddressLotBlockAddThen, + ); + fn networking_address_lot_block_remove(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingAddressLotBlockRemoveWhen, + operations::NetworkingAddressLotBlockRemoveThen, + ); fn networking_allow_list_view(&self, config_fn: F) -> httpmock::Mock where F: FnOnce(operations::NetworkingAllowListViewWhen, operations::NetworkingAllowListViewThen); @@ -17491,98 +19575,275 @@ pub trait MockServerExt { fn networking_bgp_config_create(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpConfigCreateWhen, - operations::NetworkingBgpConfigCreateThen, + operations::NetworkingBgpConfigCreateWhen, + operations::NetworkingBgpConfigCreateThen, + ); + fn networking_bgp_config_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingBgpConfigDeleteWhen, + operations::NetworkingBgpConfigDeleteThen, + ); + fn networking_bgp_announce_set_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingBgpAnnounceSetListWhen, + operations::NetworkingBgpAnnounceSetListThen, + ); + fn networking_bgp_announce_set_update(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingBgpAnnounceSetUpdateWhen, + operations::NetworkingBgpAnnounceSetUpdateThen, + ); + fn networking_bgp_announce_set_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingBgpAnnounceSetDeleteWhen, + operations::NetworkingBgpAnnounceSetDeleteThen, + ); + fn networking_bgp_announcement_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingBgpAnnouncementListWhen, + operations::NetworkingBgpAnnouncementListThen, + ); + fn networking_bgp_exported(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::NetworkingBgpExportedWhen, operations::NetworkingBgpExportedThen); + fn networking_bgp_message_history(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingBgpMessageHistoryWhen, + operations::NetworkingBgpMessageHistoryThen, + ); + fn networking_bgp_imported_routes_ipv4(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingBgpImportedRoutesIpv4When, + operations::NetworkingBgpImportedRoutesIpv4Then, + ); + fn networking_bgp_status(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::NetworkingBgpStatusWhen, operations::NetworkingBgpStatusThen); + fn networking_loopback_address_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingLoopbackAddressListWhen, + operations::NetworkingLoopbackAddressListThen, + ); + fn networking_loopback_address_create(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingLoopbackAddressCreateWhen, + operations::NetworkingLoopbackAddressCreateThen, + ); + fn networking_loopback_address_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingLoopbackAddressDeleteWhen, + operations::NetworkingLoopbackAddressDeleteThen, + ); + fn networking_switch_port_configuration_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationListWhen, + operations::NetworkingSwitchPortConfigurationListThen, + ); + fn networking_switch_port_configuration_create(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationCreateWhen, + operations::NetworkingSwitchPortConfigurationCreateThen, + ); + fn networking_switch_port_configuration_view(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationViewWhen, + operations::NetworkingSwitchPortConfigurationViewThen, + ); + fn networking_switch_port_configuration_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationDeleteWhen, + operations::NetworkingSwitchPortConfigurationDeleteThen, + ); + fn networking_switch_port_configuration_address_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationAddressListWhen, + operations::NetworkingSwitchPortConfigurationAddressListThen, + ); + fn networking_switch_port_configuration_address_add(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationAddressAddWhen, + operations::NetworkingSwitchPortConfigurationAddressAddThen, + ); + fn networking_switch_port_configuration_address_remove( + &self, + config_fn: F, + ) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationAddressRemoveWhen, + operations::NetworkingSwitchPortConfigurationAddressRemoveThen, + ); + fn networking_switch_port_configuration_bgp_peer_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerListThen, + ); + fn networking_switch_port_configuration_bgp_peer_add(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAddThen, + ); + fn networking_switch_port_configuration_bgp_peer_allow_export_list( + &self, + config_fn: F, + ) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportListThen, + ); + fn networking_switch_port_configuration_bgp_peer_allow_export_add( + &self, + config_fn: F, + ) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportAddThen, + ); + fn networking_switch_port_configuration_bgp_peer_allow_export_remove( + &self, + config_fn: F, + ) -> httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveThen, ); - fn networking_bgp_config_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_import_list( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpConfigDeleteWhen, - operations::NetworkingBgpConfigDeleteThen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportListThen, ); - fn networking_bgp_announce_set_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_import_add( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnounceSetListWhen, - operations::NetworkingBgpAnnounceSetListThen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportAddThen, ); - fn networking_bgp_announce_set_update(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_import_remove( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnounceSetUpdateWhen, - operations::NetworkingBgpAnnounceSetUpdateThen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveThen, ); - fn networking_bgp_announce_set_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_community_list( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnounceSetDeleteWhen, - operations::NetworkingBgpAnnounceSetDeleteThen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityListThen, ); - fn networking_bgp_announcement_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_community_add( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnouncementListWhen, - operations::NetworkingBgpAnnouncementListThen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityAddThen, ); - fn networking_bgp_exported(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_community_remove( + &self, + config_fn: F, + ) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBgpExportedWhen, operations::NetworkingBgpExportedThen); - fn networking_bgp_message_history(&self, config_fn: F) -> httpmock::Mock + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveThen, + ); + fn networking_switch_port_configuration_bgp_peer_remove( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpMessageHistoryWhen, - operations::NetworkingBgpMessageHistoryThen, + operations::NetworkingSwitchPortConfigurationBgpPeerRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerRemoveThen, ); - fn networking_bgp_imported_routes_ipv4(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_geometry_view(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpImportedRoutesIpv4When, - operations::NetworkingBgpImportedRoutesIpv4Then, + operations::NetworkingSwitchPortConfigurationGeometryViewWhen, + operations::NetworkingSwitchPortConfigurationGeometryViewThen, ); - fn networking_bgp_status(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_geometry_set(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBgpStatusWhen, operations::NetworkingBgpStatusThen); - fn networking_loopback_address_list(&self, config_fn: F) -> httpmock::Mock + F: FnOnce( + operations::NetworkingSwitchPortConfigurationGeometrySetWhen, + operations::NetworkingSwitchPortConfigurationGeometrySetThen, + ); + fn networking_switch_port_configuration_link_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingLoopbackAddressListWhen, - operations::NetworkingLoopbackAddressListThen, + operations::NetworkingSwitchPortConfigurationLinkListWhen, + operations::NetworkingSwitchPortConfigurationLinkListThen, ); - fn networking_loopback_address_create(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_link_create(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingLoopbackAddressCreateWhen, - operations::NetworkingLoopbackAddressCreateThen, + operations::NetworkingSwitchPortConfigurationLinkCreateWhen, + operations::NetworkingSwitchPortConfigurationLinkCreateThen, ); - fn networking_loopback_address_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_link_view(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingLoopbackAddressDeleteWhen, - operations::NetworkingLoopbackAddressDeleteThen, + operations::NetworkingSwitchPortConfigurationLinkViewWhen, + operations::NetworkingSwitchPortConfigurationLinkViewThen, ); - fn networking_switch_port_settings_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_link_delete(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsListWhen, - operations::NetworkingSwitchPortSettingsListThen, + operations::NetworkingSwitchPortConfigurationLinkDeleteWhen, + operations::NetworkingSwitchPortConfigurationLinkDeleteThen, ); - fn networking_switch_port_settings_create(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_route_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsCreateWhen, - operations::NetworkingSwitchPortSettingsCreateThen, + operations::NetworkingSwitchPortConfigurationRouteListWhen, + operations::NetworkingSwitchPortConfigurationRouteListThen, ); - fn networking_switch_port_settings_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_route_add(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsDeleteWhen, - operations::NetworkingSwitchPortSettingsDeleteThen, + operations::NetworkingSwitchPortConfigurationRouteAddWhen, + operations::NetworkingSwitchPortConfigurationRouteAddThen, ); - fn networking_switch_port_settings_view(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_route_remove(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsViewWhen, - operations::NetworkingSwitchPortSettingsViewThen, + operations::NetworkingSwitchPortConfigurationRouteRemoveWhen, + operations::NetworkingSwitchPortConfigurationRouteRemoveThen, ); fn system_policy_view(&self, config_fn: F) -> httpmock::Mock where @@ -17688,2109 +19949,2582 @@ pub trait MockServerExt { F: FnOnce(operations::VpcRouterViewWhen, operations::VpcRouterViewThen); fn vpc_router_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcRouterUpdateWhen, operations::VpcRouterUpdateThen); - fn vpc_router_delete(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::VpcRouterUpdateWhen, operations::VpcRouterUpdateThen); + fn vpc_router_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcRouterDeleteWhen, operations::VpcRouterDeleteThen); + fn vpc_subnet_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcSubnetListWhen, operations::VpcSubnetListThen); + fn vpc_subnet_create(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcSubnetCreateWhen, operations::VpcSubnetCreateThen); + fn vpc_subnet_view(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcSubnetViewWhen, operations::VpcSubnetViewThen); + fn vpc_subnet_update(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcSubnetUpdateWhen, operations::VpcSubnetUpdateThen); + fn vpc_subnet_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcSubnetDeleteWhen, operations::VpcSubnetDeleteThen); + fn vpc_subnet_list_network_interfaces(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce( + operations::VpcSubnetListNetworkInterfacesWhen, + operations::VpcSubnetListNetworkInterfacesThen, + ); + fn vpc_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcListWhen, operations::VpcListThen); + fn vpc_create(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcCreateWhen, operations::VpcCreateThen); + fn vpc_view(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcViewWhen, operations::VpcViewThen); + fn vpc_update(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcUpdateWhen, operations::VpcUpdateThen); + fn vpc_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::VpcDeleteWhen, operations::VpcDeleteThen); +} + +impl MockServerExt for httpmock::MockServer { + fn device_auth_request(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DeviceAuthRequestWhen, operations::DeviceAuthRequestThen), + { + self.mock(|when, then| { + config_fn( + operations::DeviceAuthRequestWhen::new(when), + operations::DeviceAuthRequestThen::new(then), + ) + }) + } + + fn device_auth_confirm(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DeviceAuthConfirmWhen, operations::DeviceAuthConfirmThen), + { + self.mock(|when, then| { + config_fn( + operations::DeviceAuthConfirmWhen::new(when), + operations::DeviceAuthConfirmThen::new(then), + ) + }) + } + + fn device_access_token(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DeviceAccessTokenWhen, operations::DeviceAccessTokenThen), + { + self.mock(|when, then| { + config_fn( + operations::DeviceAccessTokenWhen::new(when), + operations::DeviceAccessTokenThen::new(then), + ) + }) + } + + fn probe_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::ProbeListWhen, operations::ProbeListThen), + { + self.mock(|when, then| { + config_fn( + operations::ProbeListWhen::new(when), + operations::ProbeListThen::new(then), + ) + }) + } + + fn probe_create(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::ProbeCreateWhen, operations::ProbeCreateThen), + { + self.mock(|when, then| { + config_fn( + operations::ProbeCreateWhen::new(when), + operations::ProbeCreateThen::new(then), + ) + }) + } + + fn probe_view(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::ProbeViewWhen, operations::ProbeViewThen), + { + self.mock(|when, then| { + config_fn( + operations::ProbeViewWhen::new(when), + operations::ProbeViewThen::new(then), + ) + }) + } + + fn probe_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::ProbeDeleteWhen, operations::ProbeDeleteThen), + { + self.mock(|when, then| { + config_fn( + operations::ProbeDeleteWhen::new(when), + operations::ProbeDeleteThen::new(then), + ) + }) + } + + fn login_saml(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::LoginSamlWhen, operations::LoginSamlThen), + { + self.mock(|when, then| { + config_fn( + operations::LoginSamlWhen::new(when), + operations::LoginSamlThen::new(then), + ) + }) + } + + fn certificate_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::CertificateListWhen, operations::CertificateListThen), + { + self.mock(|when, then| { + config_fn( + operations::CertificateListWhen::new(when), + operations::CertificateListThen::new(then), + ) + }) + } + + fn certificate_create(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::CertificateCreateWhen, operations::CertificateCreateThen), + { + self.mock(|when, then| { + config_fn( + operations::CertificateCreateWhen::new(when), + operations::CertificateCreateThen::new(then), + ) + }) + } + + fn certificate_view(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::CertificateViewWhen, operations::CertificateViewThen), + { + self.mock(|when, then| { + config_fn( + operations::CertificateViewWhen::new(when), + operations::CertificateViewThen::new(then), + ) + }) + } + + fn certificate_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::CertificateDeleteWhen, operations::CertificateDeleteThen), + { + self.mock(|when, then| { + config_fn( + operations::CertificateDeleteWhen::new(when), + operations::CertificateDeleteThen::new(then), + ) + }) + } + + fn disk_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DiskListWhen, operations::DiskListThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskListWhen::new(when), + operations::DiskListThen::new(then), + ) + }) + } + + fn disk_create(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DiskCreateWhen, operations::DiskCreateThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskCreateWhen::new(when), + operations::DiskCreateThen::new(then), + ) + }) + } + + fn disk_view(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DiskViewWhen, operations::DiskViewThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskViewWhen::new(when), + operations::DiskViewThen::new(then), + ) + }) + } + + fn disk_delete(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::DiskDeleteWhen, operations::DiskDeleteThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskDeleteWhen::new(when), + operations::DiskDeleteThen::new(then), + ) + }) + } + + fn disk_bulk_write_import(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcRouterDeleteWhen, operations::VpcRouterDeleteThen); - fn vpc_subnet_list(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::DiskBulkWriteImportWhen, operations::DiskBulkWriteImportThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskBulkWriteImportWhen::new(when), + operations::DiskBulkWriteImportThen::new(then), + ) + }) + } + + fn disk_bulk_write_import_start(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcSubnetListWhen, operations::VpcSubnetListThen); - fn vpc_subnet_create(&self, config_fn: F) -> httpmock::Mock + F: FnOnce( + operations::DiskBulkWriteImportStartWhen, + operations::DiskBulkWriteImportStartThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::DiskBulkWriteImportStartWhen::new(when), + operations::DiskBulkWriteImportStartThen::new(then), + ) + }) + } + + fn disk_bulk_write_import_stop(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcSubnetCreateWhen, operations::VpcSubnetCreateThen); - fn vpc_subnet_view(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::DiskBulkWriteImportStopWhen, operations::DiskBulkWriteImportStopThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskBulkWriteImportStopWhen::new(when), + operations::DiskBulkWriteImportStopThen::new(then), + ) + }) + } + + fn disk_finalize_import(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcSubnetViewWhen, operations::VpcSubnetViewThen); - fn vpc_subnet_update(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::DiskFinalizeImportWhen, operations::DiskFinalizeImportThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskFinalizeImportWhen::new(when), + operations::DiskFinalizeImportThen::new(then), + ) + }) + } + + fn disk_metrics_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcSubnetUpdateWhen, operations::VpcSubnetUpdateThen); - fn vpc_subnet_delete(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::DiskMetricsListWhen, operations::DiskMetricsListThen), + { + self.mock(|when, then| { + config_fn( + operations::DiskMetricsListWhen::new(when), + operations::DiskMetricsListThen::new(then), + ) + }) + } + + fn floating_ip_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcSubnetDeleteWhen, operations::VpcSubnetDeleteThen); - fn vpc_subnet_list_network_interfaces(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::FloatingIpListWhen, operations::FloatingIpListThen), + { + self.mock(|when, then| { + config_fn( + operations::FloatingIpListWhen::new(when), + operations::FloatingIpListThen::new(then), + ) + }) + } + + fn floating_ip_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::VpcSubnetListNetworkInterfacesWhen, - operations::VpcSubnetListNetworkInterfacesThen, - ); - fn vpc_list(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::FloatingIpCreateWhen, operations::FloatingIpCreateThen), + { + self.mock(|when, then| { + config_fn( + operations::FloatingIpCreateWhen::new(when), + operations::FloatingIpCreateThen::new(then), + ) + }) + } + + fn floating_ip_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcListWhen, operations::VpcListThen); - fn vpc_create(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::FloatingIpViewWhen, operations::FloatingIpViewThen), + { + self.mock(|when, then| { + config_fn( + operations::FloatingIpViewWhen::new(when), + operations::FloatingIpViewThen::new(then), + ) + }) + } + + fn floating_ip_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcCreateWhen, operations::VpcCreateThen); - fn vpc_view(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::FloatingIpUpdateWhen, operations::FloatingIpUpdateThen), + { + self.mock(|when, then| { + config_fn( + operations::FloatingIpUpdateWhen::new(when), + operations::FloatingIpUpdateThen::new(then), + ) + }) + } + + fn floating_ip_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcViewWhen, operations::VpcViewThen); - fn vpc_update(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::FloatingIpDeleteWhen, operations::FloatingIpDeleteThen), + { + self.mock(|when, then| { + config_fn( + operations::FloatingIpDeleteWhen::new(when), + operations::FloatingIpDeleteThen::new(then), + ) + }) + } + + fn floating_ip_attach(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcUpdateWhen, operations::VpcUpdateThen); - fn vpc_delete(&self, config_fn: F) -> httpmock::Mock + F: FnOnce(operations::FloatingIpAttachWhen, operations::FloatingIpAttachThen), + { + self.mock(|when, then| { + config_fn( + operations::FloatingIpAttachWhen::new(when), + operations::FloatingIpAttachThen::new(then), + ) + }) + } + + fn floating_ip_detach(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::VpcDeleteWhen, operations::VpcDeleteThen); -} + F: FnOnce(operations::FloatingIpDetachWhen, operations::FloatingIpDetachThen), + { + self.mock(|when, then| { + config_fn( + operations::FloatingIpDetachWhen::new(when), + operations::FloatingIpDetachThen::new(then), + ) + }) + } -impl MockServerExt for httpmock::MockServer { - fn device_auth_request(&self, config_fn: F) -> httpmock::Mock + fn group_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DeviceAuthRequestWhen, operations::DeviceAuthRequestThen), + F: FnOnce(operations::GroupListWhen, operations::GroupListThen), { self.mock(|when, then| { config_fn( - operations::DeviceAuthRequestWhen::new(when), - operations::DeviceAuthRequestThen::new(then), + operations::GroupListWhen::new(when), + operations::GroupListThen::new(then), ) }) } - fn device_auth_confirm(&self, config_fn: F) -> httpmock::Mock + fn group_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DeviceAuthConfirmWhen, operations::DeviceAuthConfirmThen), + F: FnOnce(operations::GroupViewWhen, operations::GroupViewThen), { self.mock(|when, then| { config_fn( - operations::DeviceAuthConfirmWhen::new(when), - operations::DeviceAuthConfirmThen::new(then), + operations::GroupViewWhen::new(when), + operations::GroupViewThen::new(then), ) }) } - fn device_access_token(&self, config_fn: F) -> httpmock::Mock + fn image_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DeviceAccessTokenWhen, operations::DeviceAccessTokenThen), + F: FnOnce(operations::ImageListWhen, operations::ImageListThen), { self.mock(|when, then| { config_fn( - operations::DeviceAccessTokenWhen::new(when), - operations::DeviceAccessTokenThen::new(then), + operations::ImageListWhen::new(when), + operations::ImageListThen::new(then), ) }) } - fn probe_list(&self, config_fn: F) -> httpmock::Mock + fn image_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProbeListWhen, operations::ProbeListThen), + F: FnOnce(operations::ImageCreateWhen, operations::ImageCreateThen), { self.mock(|when, then| { config_fn( - operations::ProbeListWhen::new(when), - operations::ProbeListThen::new(then), + operations::ImageCreateWhen::new(when), + operations::ImageCreateThen::new(then), ) }) } - fn probe_create(&self, config_fn: F) -> httpmock::Mock + fn image_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProbeCreateWhen, operations::ProbeCreateThen), + F: FnOnce(operations::ImageViewWhen, operations::ImageViewThen), { self.mock(|when, then| { config_fn( - operations::ProbeCreateWhen::new(when), - operations::ProbeCreateThen::new(then), + operations::ImageViewWhen::new(when), + operations::ImageViewThen::new(then), ) }) } - fn probe_view(&self, config_fn: F) -> httpmock::Mock + fn image_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProbeViewWhen, operations::ProbeViewThen), + F: FnOnce(operations::ImageDeleteWhen, operations::ImageDeleteThen), { self.mock(|when, then| { config_fn( - operations::ProbeViewWhen::new(when), - operations::ProbeViewThen::new(then), + operations::ImageDeleteWhen::new(when), + operations::ImageDeleteThen::new(then), ) }) } - fn probe_delete(&self, config_fn: F) -> httpmock::Mock + fn image_demote(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProbeDeleteWhen, operations::ProbeDeleteThen), + F: FnOnce(operations::ImageDemoteWhen, operations::ImageDemoteThen), { self.mock(|when, then| { config_fn( - operations::ProbeDeleteWhen::new(when), - operations::ProbeDeleteThen::new(then), + operations::ImageDemoteWhen::new(when), + operations::ImageDemoteThen::new(then), ) }) } - fn login_saml(&self, config_fn: F) -> httpmock::Mock + fn image_promote(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::LoginSamlWhen, operations::LoginSamlThen), + F: FnOnce(operations::ImagePromoteWhen, operations::ImagePromoteThen), { self.mock(|when, then| { config_fn( - operations::LoginSamlWhen::new(when), - operations::LoginSamlThen::new(then), + operations::ImagePromoteWhen::new(when), + operations::ImagePromoteThen::new(then), + ) + }) + } + + fn instance_list(&self, config_fn: F) -> httpmock::Mock + where + F: FnOnce(operations::InstanceListWhen, operations::InstanceListThen), + { + self.mock(|when, then| { + config_fn( + operations::InstanceListWhen::new(when), + operations::InstanceListThen::new(then), ) }) } - fn certificate_list(&self, config_fn: F) -> httpmock::Mock + fn instance_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CertificateListWhen, operations::CertificateListThen), + F: FnOnce(operations::InstanceCreateWhen, operations::InstanceCreateThen), { self.mock(|when, then| { config_fn( - operations::CertificateListWhen::new(when), - operations::CertificateListThen::new(then), + operations::InstanceCreateWhen::new(when), + operations::InstanceCreateThen::new(then), ) }) } - fn certificate_create(&self, config_fn: F) -> httpmock::Mock + fn instance_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CertificateCreateWhen, operations::CertificateCreateThen), + F: FnOnce(operations::InstanceViewWhen, operations::InstanceViewThen), { self.mock(|when, then| { config_fn( - operations::CertificateCreateWhen::new(when), - operations::CertificateCreateThen::new(then), + operations::InstanceViewWhen::new(when), + operations::InstanceViewThen::new(then), ) }) } - fn certificate_view(&self, config_fn: F) -> httpmock::Mock + fn instance_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CertificateViewWhen, operations::CertificateViewThen), + F: FnOnce(operations::InstanceUpdateWhen, operations::InstanceUpdateThen), { self.mock(|when, then| { config_fn( - operations::CertificateViewWhen::new(when), - operations::CertificateViewThen::new(then), + operations::InstanceUpdateWhen::new(when), + operations::InstanceUpdateThen::new(then), ) }) } - fn certificate_delete(&self, config_fn: F) -> httpmock::Mock + fn instance_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CertificateDeleteWhen, operations::CertificateDeleteThen), + F: FnOnce(operations::InstanceDeleteWhen, operations::InstanceDeleteThen), { self.mock(|when, then| { config_fn( - operations::CertificateDeleteWhen::new(when), - operations::CertificateDeleteThen::new(then), + operations::InstanceDeleteWhen::new(when), + operations::InstanceDeleteThen::new(then), ) }) } - fn disk_list(&self, config_fn: F) -> httpmock::Mock + fn instance_disk_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskListWhen, operations::DiskListThen), + F: FnOnce(operations::InstanceDiskListWhen, operations::InstanceDiskListThen), { self.mock(|when, then| { config_fn( - operations::DiskListWhen::new(when), - operations::DiskListThen::new(then), + operations::InstanceDiskListWhen::new(when), + operations::InstanceDiskListThen::new(then), ) }) } - fn disk_create(&self, config_fn: F) -> httpmock::Mock + fn instance_disk_attach(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskCreateWhen, operations::DiskCreateThen), + F: FnOnce(operations::InstanceDiskAttachWhen, operations::InstanceDiskAttachThen), { self.mock(|when, then| { config_fn( - operations::DiskCreateWhen::new(when), - operations::DiskCreateThen::new(then), + operations::InstanceDiskAttachWhen::new(when), + operations::InstanceDiskAttachThen::new(then), ) }) } - fn disk_view(&self, config_fn: F) -> httpmock::Mock + fn instance_disk_detach(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskViewWhen, operations::DiskViewThen), + F: FnOnce(operations::InstanceDiskDetachWhen, operations::InstanceDiskDetachThen), { self.mock(|when, then| { config_fn( - operations::DiskViewWhen::new(when), - operations::DiskViewThen::new(then), + operations::InstanceDiskDetachWhen::new(when), + operations::InstanceDiskDetachThen::new(then), ) }) } - fn disk_delete(&self, config_fn: F) -> httpmock::Mock + fn instance_external_ip_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskDeleteWhen, operations::DiskDeleteThen), + F: FnOnce(operations::InstanceExternalIpListWhen, operations::InstanceExternalIpListThen), { self.mock(|when, then| { config_fn( - operations::DiskDeleteWhen::new(when), - operations::DiskDeleteThen::new(then), + operations::InstanceExternalIpListWhen::new(when), + operations::InstanceExternalIpListThen::new(then), ) }) } - fn disk_bulk_write_import(&self, config_fn: F) -> httpmock::Mock + fn instance_ephemeral_ip_attach(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskBulkWriteImportWhen, operations::DiskBulkWriteImportThen), + F: FnOnce( + operations::InstanceEphemeralIpAttachWhen, + operations::InstanceEphemeralIpAttachThen, + ), { self.mock(|when, then| { config_fn( - operations::DiskBulkWriteImportWhen::new(when), - operations::DiskBulkWriteImportThen::new(then), + operations::InstanceEphemeralIpAttachWhen::new(when), + operations::InstanceEphemeralIpAttachThen::new(then), ) }) } - fn disk_bulk_write_import_start(&self, config_fn: F) -> httpmock::Mock + fn instance_ephemeral_ip_detach(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::DiskBulkWriteImportStartWhen, - operations::DiskBulkWriteImportStartThen, + operations::InstanceEphemeralIpDetachWhen, + operations::InstanceEphemeralIpDetachThen, ), { self.mock(|when, then| { config_fn( - operations::DiskBulkWriteImportStartWhen::new(when), - operations::DiskBulkWriteImportStartThen::new(then), + operations::InstanceEphemeralIpDetachWhen::new(when), + operations::InstanceEphemeralIpDetachThen::new(then), ) }) } - fn disk_bulk_write_import_stop(&self, config_fn: F) -> httpmock::Mock + fn instance_reboot(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskBulkWriteImportStopWhen, operations::DiskBulkWriteImportStopThen), + F: FnOnce(operations::InstanceRebootWhen, operations::InstanceRebootThen), { self.mock(|when, then| { config_fn( - operations::DiskBulkWriteImportStopWhen::new(when), - operations::DiskBulkWriteImportStopThen::new(then), + operations::InstanceRebootWhen::new(when), + operations::InstanceRebootThen::new(then), ) }) } - fn disk_finalize_import(&self, config_fn: F) -> httpmock::Mock + fn instance_serial_console(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskFinalizeImportWhen, operations::DiskFinalizeImportThen), + F: FnOnce(operations::InstanceSerialConsoleWhen, operations::InstanceSerialConsoleThen), { self.mock(|when, then| { config_fn( - operations::DiskFinalizeImportWhen::new(when), - operations::DiskFinalizeImportThen::new(then), + operations::InstanceSerialConsoleWhen::new(when), + operations::InstanceSerialConsoleThen::new(then), ) }) } - fn disk_metrics_list(&self, config_fn: F) -> httpmock::Mock + fn instance_serial_console_stream(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::DiskMetricsListWhen, operations::DiskMetricsListThen), + F: FnOnce( + operations::InstanceSerialConsoleStreamWhen, + operations::InstanceSerialConsoleStreamThen, + ), { self.mock(|when, then| { config_fn( - operations::DiskMetricsListWhen::new(when), - operations::DiskMetricsListThen::new(then), + operations::InstanceSerialConsoleStreamWhen::new(when), + operations::InstanceSerialConsoleStreamThen::new(then), ) }) } - fn floating_ip_list(&self, config_fn: F) -> httpmock::Mock + fn instance_ssh_public_key_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::FloatingIpListWhen, operations::FloatingIpListThen), + F: FnOnce( + operations::InstanceSshPublicKeyListWhen, + operations::InstanceSshPublicKeyListThen, + ), { self.mock(|when, then| { config_fn( - operations::FloatingIpListWhen::new(when), - operations::FloatingIpListThen::new(then), + operations::InstanceSshPublicKeyListWhen::new(when), + operations::InstanceSshPublicKeyListThen::new(then), ) }) } - fn floating_ip_create(&self, config_fn: F) -> httpmock::Mock + fn instance_start(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::FloatingIpCreateWhen, operations::FloatingIpCreateThen), + F: FnOnce(operations::InstanceStartWhen, operations::InstanceStartThen), { self.mock(|when, then| { config_fn( - operations::FloatingIpCreateWhen::new(when), - operations::FloatingIpCreateThen::new(then), + operations::InstanceStartWhen::new(when), + operations::InstanceStartThen::new(then), ) }) } - fn floating_ip_view(&self, config_fn: F) -> httpmock::Mock + fn instance_stop(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::FloatingIpViewWhen, operations::FloatingIpViewThen), + F: FnOnce(operations::InstanceStopWhen, operations::InstanceStopThen), { self.mock(|when, then| { config_fn( - operations::FloatingIpViewWhen::new(when), - operations::FloatingIpViewThen::new(then), + operations::InstanceStopWhen::new(when), + operations::InstanceStopThen::new(then), ) }) } - fn floating_ip_update(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_ip_address_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::FloatingIpUpdateWhen, operations::FloatingIpUpdateThen), + F: FnOnce( + operations::InternetGatewayIpAddressListWhen, + operations::InternetGatewayIpAddressListThen, + ), { self.mock(|when, then| { config_fn( - operations::FloatingIpUpdateWhen::new(when), - operations::FloatingIpUpdateThen::new(then), + operations::InternetGatewayIpAddressListWhen::new(when), + operations::InternetGatewayIpAddressListThen::new(then), ) }) } - fn floating_ip_delete(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_ip_address_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::FloatingIpDeleteWhen, operations::FloatingIpDeleteThen), + F: FnOnce( + operations::InternetGatewayIpAddressCreateWhen, + operations::InternetGatewayIpAddressCreateThen, + ), { self.mock(|when, then| { config_fn( - operations::FloatingIpDeleteWhen::new(when), - operations::FloatingIpDeleteThen::new(then), + operations::InternetGatewayIpAddressCreateWhen::new(when), + operations::InternetGatewayIpAddressCreateThen::new(then), ) }) } - fn floating_ip_attach(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_ip_address_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::FloatingIpAttachWhen, operations::FloatingIpAttachThen), + F: FnOnce( + operations::InternetGatewayIpAddressDeleteWhen, + operations::InternetGatewayIpAddressDeleteThen, + ), { self.mock(|when, then| { config_fn( - operations::FloatingIpAttachWhen::new(when), - operations::FloatingIpAttachThen::new(then), + operations::InternetGatewayIpAddressDeleteWhen::new(when), + operations::InternetGatewayIpAddressDeleteThen::new(then), ) }) } - fn floating_ip_detach(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_ip_pool_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::FloatingIpDetachWhen, operations::FloatingIpDetachThen), + F: FnOnce( + operations::InternetGatewayIpPoolListWhen, + operations::InternetGatewayIpPoolListThen, + ), { self.mock(|when, then| { config_fn( - operations::FloatingIpDetachWhen::new(when), - operations::FloatingIpDetachThen::new(then), + operations::InternetGatewayIpPoolListWhen::new(when), + operations::InternetGatewayIpPoolListThen::new(then), ) }) } - fn group_list(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_ip_pool_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::GroupListWhen, operations::GroupListThen), + F: FnOnce( + operations::InternetGatewayIpPoolCreateWhen, + operations::InternetGatewayIpPoolCreateThen, + ), { self.mock(|when, then| { config_fn( - operations::GroupListWhen::new(when), - operations::GroupListThen::new(then), + operations::InternetGatewayIpPoolCreateWhen::new(when), + operations::InternetGatewayIpPoolCreateThen::new(then), ) }) } - fn group_view(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_ip_pool_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::GroupViewWhen, operations::GroupViewThen), + F: FnOnce( + operations::InternetGatewayIpPoolDeleteWhen, + operations::InternetGatewayIpPoolDeleteThen, + ), { self.mock(|when, then| { config_fn( - operations::GroupViewWhen::new(when), - operations::GroupViewThen::new(then), + operations::InternetGatewayIpPoolDeleteWhen::new(when), + operations::InternetGatewayIpPoolDeleteThen::new(then), ) }) } - fn image_list(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ImageListWhen, operations::ImageListThen), + F: FnOnce(operations::InternetGatewayListWhen, operations::InternetGatewayListThen), { self.mock(|when, then| { config_fn( - operations::ImageListWhen::new(when), - operations::ImageListThen::new(then), + operations::InternetGatewayListWhen::new(when), + operations::InternetGatewayListThen::new(then), ) }) } - fn image_create(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ImageCreateWhen, operations::ImageCreateThen), + F: FnOnce(operations::InternetGatewayCreateWhen, operations::InternetGatewayCreateThen), { self.mock(|when, then| { config_fn( - operations::ImageCreateWhen::new(when), - operations::ImageCreateThen::new(then), + operations::InternetGatewayCreateWhen::new(when), + operations::InternetGatewayCreateThen::new(then), ) }) } - fn image_view(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ImageViewWhen, operations::ImageViewThen), + F: FnOnce(operations::InternetGatewayViewWhen, operations::InternetGatewayViewThen), { self.mock(|when, then| { config_fn( - operations::ImageViewWhen::new(when), - operations::ImageViewThen::new(then), + operations::InternetGatewayViewWhen::new(when), + operations::InternetGatewayViewThen::new(then), ) }) } - fn image_delete(&self, config_fn: F) -> httpmock::Mock + fn internet_gateway_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ImageDeleteWhen, operations::ImageDeleteThen), + F: FnOnce(operations::InternetGatewayDeleteWhen, operations::InternetGatewayDeleteThen), { self.mock(|when, then| { config_fn( - operations::ImageDeleteWhen::new(when), - operations::ImageDeleteThen::new(then), + operations::InternetGatewayDeleteWhen::new(when), + operations::InternetGatewayDeleteThen::new(then), ) }) } - fn image_demote(&self, config_fn: F) -> httpmock::Mock + fn project_ip_pool_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ImageDemoteWhen, operations::ImageDemoteThen), + F: FnOnce(operations::ProjectIpPoolListWhen, operations::ProjectIpPoolListThen), { self.mock(|when, then| { config_fn( - operations::ImageDemoteWhen::new(when), - operations::ImageDemoteThen::new(then), + operations::ProjectIpPoolListWhen::new(when), + operations::ProjectIpPoolListThen::new(then), ) }) } - fn image_promote(&self, config_fn: F) -> httpmock::Mock + fn project_ip_pool_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ImagePromoteWhen, operations::ImagePromoteThen), + F: FnOnce(operations::ProjectIpPoolViewWhen, operations::ProjectIpPoolViewThen), { self.mock(|when, then| { config_fn( - operations::ImagePromoteWhen::new(when), - operations::ImagePromoteThen::new(then), + operations::ProjectIpPoolViewWhen::new(when), + operations::ProjectIpPoolViewThen::new(then), ) }) } - fn instance_list(&self, config_fn: F) -> httpmock::Mock + fn login_local(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceListWhen, operations::InstanceListThen), + F: FnOnce(operations::LoginLocalWhen, operations::LoginLocalThen), { self.mock(|when, then| { config_fn( - operations::InstanceListWhen::new(when), - operations::InstanceListThen::new(then), + operations::LoginLocalWhen::new(when), + operations::LoginLocalThen::new(then), ) }) } - fn instance_create(&self, config_fn: F) -> httpmock::Mock + fn logout(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceCreateWhen, operations::InstanceCreateThen), + F: FnOnce(operations::LogoutWhen, operations::LogoutThen), { self.mock(|when, then| { config_fn( - operations::InstanceCreateWhen::new(when), - operations::InstanceCreateThen::new(then), + operations::LogoutWhen::new(when), + operations::LogoutThen::new(then), ) }) } - fn instance_view(&self, config_fn: F) -> httpmock::Mock + fn current_user_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceViewWhen, operations::InstanceViewThen), + F: FnOnce(operations::CurrentUserViewWhen, operations::CurrentUserViewThen), { self.mock(|when, then| { config_fn( - operations::InstanceViewWhen::new(when), - operations::InstanceViewThen::new(then), + operations::CurrentUserViewWhen::new(when), + operations::CurrentUserViewThen::new(then), ) }) } - fn instance_update(&self, config_fn: F) -> httpmock::Mock + fn current_user_groups(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceUpdateWhen, operations::InstanceUpdateThen), + F: FnOnce(operations::CurrentUserGroupsWhen, operations::CurrentUserGroupsThen), { self.mock(|when, then| { config_fn( - operations::InstanceUpdateWhen::new(when), - operations::InstanceUpdateThen::new(then), + operations::CurrentUserGroupsWhen::new(when), + operations::CurrentUserGroupsThen::new(then), ) }) } - fn instance_delete(&self, config_fn: F) -> httpmock::Mock + fn current_user_ssh_key_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceDeleteWhen, operations::InstanceDeleteThen), + F: FnOnce(operations::CurrentUserSshKeyListWhen, operations::CurrentUserSshKeyListThen), { self.mock(|when, then| { config_fn( - operations::InstanceDeleteWhen::new(when), - operations::InstanceDeleteThen::new(then), + operations::CurrentUserSshKeyListWhen::new(when), + operations::CurrentUserSshKeyListThen::new(then), ) }) } - fn instance_disk_list(&self, config_fn: F) -> httpmock::Mock + fn current_user_ssh_key_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceDiskListWhen, operations::InstanceDiskListThen), + F: FnOnce(operations::CurrentUserSshKeyCreateWhen, operations::CurrentUserSshKeyCreateThen), { self.mock(|when, then| { config_fn( - operations::InstanceDiskListWhen::new(when), - operations::InstanceDiskListThen::new(then), + operations::CurrentUserSshKeyCreateWhen::new(when), + operations::CurrentUserSshKeyCreateThen::new(then), ) }) } - fn instance_disk_attach(&self, config_fn: F) -> httpmock::Mock + fn current_user_ssh_key_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceDiskAttachWhen, operations::InstanceDiskAttachThen), + F: FnOnce(operations::CurrentUserSshKeyViewWhen, operations::CurrentUserSshKeyViewThen), { self.mock(|when, then| { config_fn( - operations::InstanceDiskAttachWhen::new(when), - operations::InstanceDiskAttachThen::new(then), + operations::CurrentUserSshKeyViewWhen::new(when), + operations::CurrentUserSshKeyViewThen::new(then), ) }) } - fn instance_disk_detach(&self, config_fn: F) -> httpmock::Mock + fn current_user_ssh_key_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceDiskDetachWhen, operations::InstanceDiskDetachThen), + F: FnOnce(operations::CurrentUserSshKeyDeleteWhen, operations::CurrentUserSshKeyDeleteThen), { self.mock(|when, then| { config_fn( - operations::InstanceDiskDetachWhen::new(when), - operations::InstanceDiskDetachThen::new(then), + operations::CurrentUserSshKeyDeleteWhen::new(when), + operations::CurrentUserSshKeyDeleteThen::new(then), ) }) } - fn instance_external_ip_list(&self, config_fn: F) -> httpmock::Mock + fn silo_metric(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceExternalIpListWhen, operations::InstanceExternalIpListThen), + F: FnOnce(operations::SiloMetricWhen, operations::SiloMetricThen), { self.mock(|when, then| { config_fn( - operations::InstanceExternalIpListWhen::new(when), - operations::InstanceExternalIpListThen::new(then), + operations::SiloMetricWhen::new(when), + operations::SiloMetricThen::new(then), ) }) } - fn instance_ephemeral_ip_attach(&self, config_fn: F) -> httpmock::Mock + fn instance_network_interface_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::InstanceEphemeralIpAttachWhen, - operations::InstanceEphemeralIpAttachThen, + operations::InstanceNetworkInterfaceListWhen, + operations::InstanceNetworkInterfaceListThen, ), { self.mock(|when, then| { config_fn( - operations::InstanceEphemeralIpAttachWhen::new(when), - operations::InstanceEphemeralIpAttachThen::new(then), + operations::InstanceNetworkInterfaceListWhen::new(when), + operations::InstanceNetworkInterfaceListThen::new(then), ) }) } - fn instance_ephemeral_ip_detach(&self, config_fn: F) -> httpmock::Mock + fn instance_network_interface_create(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::InstanceEphemeralIpDetachWhen, - operations::InstanceEphemeralIpDetachThen, + operations::InstanceNetworkInterfaceCreateWhen, + operations::InstanceNetworkInterfaceCreateThen, ), { self.mock(|when, then| { config_fn( - operations::InstanceEphemeralIpDetachWhen::new(when), - operations::InstanceEphemeralIpDetachThen::new(then), + operations::InstanceNetworkInterfaceCreateWhen::new(when), + operations::InstanceNetworkInterfaceCreateThen::new(then), ) }) } - fn instance_reboot(&self, config_fn: F) -> httpmock::Mock + fn instance_network_interface_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceRebootWhen, operations::InstanceRebootThen), + F: FnOnce( + operations::InstanceNetworkInterfaceViewWhen, + operations::InstanceNetworkInterfaceViewThen, + ), { self.mock(|when, then| { config_fn( - operations::InstanceRebootWhen::new(when), - operations::InstanceRebootThen::new(then), + operations::InstanceNetworkInterfaceViewWhen::new(when), + operations::InstanceNetworkInterfaceViewThen::new(then), ) }) } - fn instance_serial_console(&self, config_fn: F) -> httpmock::Mock + fn instance_network_interface_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceSerialConsoleWhen, operations::InstanceSerialConsoleThen), + F: FnOnce( + operations::InstanceNetworkInterfaceUpdateWhen, + operations::InstanceNetworkInterfaceUpdateThen, + ), { self.mock(|when, then| { config_fn( - operations::InstanceSerialConsoleWhen::new(when), - operations::InstanceSerialConsoleThen::new(then), + operations::InstanceNetworkInterfaceUpdateWhen::new(when), + operations::InstanceNetworkInterfaceUpdateThen::new(then), ) }) } - fn instance_serial_console_stream(&self, config_fn: F) -> httpmock::Mock + fn instance_network_interface_delete(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::InstanceSerialConsoleStreamWhen, - operations::InstanceSerialConsoleStreamThen, + operations::InstanceNetworkInterfaceDeleteWhen, + operations::InstanceNetworkInterfaceDeleteThen, ), { self.mock(|when, then| { config_fn( - operations::InstanceSerialConsoleStreamWhen::new(when), - operations::InstanceSerialConsoleStreamThen::new(then), + operations::InstanceNetworkInterfaceDeleteWhen::new(when), + operations::InstanceNetworkInterfaceDeleteThen::new(then), ) }) } - fn instance_ssh_public_key_list(&self, config_fn: F) -> httpmock::Mock + fn ping(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InstanceSshPublicKeyListWhen, - operations::InstanceSshPublicKeyListThen, - ), + F: FnOnce(operations::PingWhen, operations::PingThen), { self.mock(|when, then| { config_fn( - operations::InstanceSshPublicKeyListWhen::new(when), - operations::InstanceSshPublicKeyListThen::new(then), + operations::PingWhen::new(when), + operations::PingThen::new(then), ) }) } - fn instance_start(&self, config_fn: F) -> httpmock::Mock + fn policy_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceStartWhen, operations::InstanceStartThen), + F: FnOnce(operations::PolicyViewWhen, operations::PolicyViewThen), { self.mock(|when, then| { config_fn( - operations::InstanceStartWhen::new(when), - operations::InstanceStartThen::new(then), + operations::PolicyViewWhen::new(when), + operations::PolicyViewThen::new(then), ) }) } - fn instance_stop(&self, config_fn: F) -> httpmock::Mock + fn policy_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InstanceStopWhen, operations::InstanceStopThen), + F: FnOnce(operations::PolicyUpdateWhen, operations::PolicyUpdateThen), { self.mock(|when, then| { config_fn( - operations::InstanceStopWhen::new(when), - operations::InstanceStopThen::new(then), + operations::PolicyUpdateWhen::new(when), + operations::PolicyUpdateThen::new(then), ) }) } - fn internet_gateway_ip_address_list(&self, config_fn: F) -> httpmock::Mock + fn project_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InternetGatewayIpAddressListWhen, - operations::InternetGatewayIpAddressListThen, - ), + F: FnOnce(operations::ProjectListWhen, operations::ProjectListThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayIpAddressListWhen::new(when), - operations::InternetGatewayIpAddressListThen::new(then), + operations::ProjectListWhen::new(when), + operations::ProjectListThen::new(then), ) }) } - fn internet_gateway_ip_address_create(&self, config_fn: F) -> httpmock::Mock + fn project_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InternetGatewayIpAddressCreateWhen, - operations::InternetGatewayIpAddressCreateThen, - ), + F: FnOnce(operations::ProjectCreateWhen, operations::ProjectCreateThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayIpAddressCreateWhen::new(when), - operations::InternetGatewayIpAddressCreateThen::new(then), + operations::ProjectCreateWhen::new(when), + operations::ProjectCreateThen::new(then), ) }) } - fn internet_gateway_ip_address_delete(&self, config_fn: F) -> httpmock::Mock + fn project_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InternetGatewayIpAddressDeleteWhen, - operations::InternetGatewayIpAddressDeleteThen, - ), + F: FnOnce(operations::ProjectViewWhen, operations::ProjectViewThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayIpAddressDeleteWhen::new(when), - operations::InternetGatewayIpAddressDeleteThen::new(then), + operations::ProjectViewWhen::new(when), + operations::ProjectViewThen::new(then), ) }) } - fn internet_gateway_ip_pool_list(&self, config_fn: F) -> httpmock::Mock + fn project_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InternetGatewayIpPoolListWhen, - operations::InternetGatewayIpPoolListThen, - ), + F: FnOnce(operations::ProjectUpdateWhen, operations::ProjectUpdateThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayIpPoolListWhen::new(when), - operations::InternetGatewayIpPoolListThen::new(then), + operations::ProjectUpdateWhen::new(when), + operations::ProjectUpdateThen::new(then), ) }) } - fn internet_gateway_ip_pool_create(&self, config_fn: F) -> httpmock::Mock + fn project_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InternetGatewayIpPoolCreateWhen, - operations::InternetGatewayIpPoolCreateThen, - ), + F: FnOnce(operations::ProjectDeleteWhen, operations::ProjectDeleteThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayIpPoolCreateWhen::new(when), - operations::InternetGatewayIpPoolCreateThen::new(then), + operations::ProjectDeleteWhen::new(when), + operations::ProjectDeleteThen::new(then), ) }) } - fn internet_gateway_ip_pool_delete(&self, config_fn: F) -> httpmock::Mock + fn project_policy_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InternetGatewayIpPoolDeleteWhen, - operations::InternetGatewayIpPoolDeleteThen, - ), + F: FnOnce(operations::ProjectPolicyViewWhen, operations::ProjectPolicyViewThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayIpPoolDeleteWhen::new(when), - operations::InternetGatewayIpPoolDeleteThen::new(then), + operations::ProjectPolicyViewWhen::new(when), + operations::ProjectPolicyViewThen::new(then), ) }) } - fn internet_gateway_list(&self, config_fn: F) -> httpmock::Mock + fn project_policy_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InternetGatewayListWhen, operations::InternetGatewayListThen), + F: FnOnce(operations::ProjectPolicyUpdateWhen, operations::ProjectPolicyUpdateThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayListWhen::new(when), - operations::InternetGatewayListThen::new(then), + operations::ProjectPolicyUpdateWhen::new(when), + operations::ProjectPolicyUpdateThen::new(then), ) }) } - fn internet_gateway_create(&self, config_fn: F) -> httpmock::Mock + fn snapshot_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InternetGatewayCreateWhen, operations::InternetGatewayCreateThen), + F: FnOnce(operations::SnapshotListWhen, operations::SnapshotListThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayCreateWhen::new(when), - operations::InternetGatewayCreateThen::new(then), + operations::SnapshotListWhen::new(when), + operations::SnapshotListThen::new(then), ) }) } - fn internet_gateway_view(&self, config_fn: F) -> httpmock::Mock + fn snapshot_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InternetGatewayViewWhen, operations::InternetGatewayViewThen), + F: FnOnce(operations::SnapshotCreateWhen, operations::SnapshotCreateThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayViewWhen::new(when), - operations::InternetGatewayViewThen::new(then), + operations::SnapshotCreateWhen::new(when), + operations::SnapshotCreateThen::new(then), ) }) } - fn internet_gateway_delete(&self, config_fn: F) -> httpmock::Mock + fn snapshot_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::InternetGatewayDeleteWhen, operations::InternetGatewayDeleteThen), + F: FnOnce(operations::SnapshotViewWhen, operations::SnapshotViewThen), { self.mock(|when, then| { config_fn( - operations::InternetGatewayDeleteWhen::new(when), - operations::InternetGatewayDeleteThen::new(then), + operations::SnapshotViewWhen::new(when), + operations::SnapshotViewThen::new(then), ) }) } - fn project_ip_pool_list(&self, config_fn: F) -> httpmock::Mock + fn snapshot_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectIpPoolListWhen, operations::ProjectIpPoolListThen), + F: FnOnce(operations::SnapshotDeleteWhen, operations::SnapshotDeleteThen), { self.mock(|when, then| { - config_fn( - operations::ProjectIpPoolListWhen::new(when), - operations::ProjectIpPoolListThen::new(then), + config_fn( + operations::SnapshotDeleteWhen::new(when), + operations::SnapshotDeleteThen::new(then), ) }) } - fn project_ip_pool_view(&self, config_fn: F) -> httpmock::Mock + fn physical_disk_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectIpPoolViewWhen, operations::ProjectIpPoolViewThen), + F: FnOnce(operations::PhysicalDiskListWhen, operations::PhysicalDiskListThen), { self.mock(|when, then| { config_fn( - operations::ProjectIpPoolViewWhen::new(when), - operations::ProjectIpPoolViewThen::new(then), + operations::PhysicalDiskListWhen::new(when), + operations::PhysicalDiskListThen::new(then), ) }) } - fn login_local(&self, config_fn: F) -> httpmock::Mock + fn physical_disk_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::LoginLocalWhen, operations::LoginLocalThen), + F: FnOnce(operations::PhysicalDiskViewWhen, operations::PhysicalDiskViewThen), { self.mock(|when, then| { config_fn( - operations::LoginLocalWhen::new(when), - operations::LoginLocalThen::new(then), + operations::PhysicalDiskViewWhen::new(when), + operations::PhysicalDiskViewThen::new(then), ) }) } - fn logout(&self, config_fn: F) -> httpmock::Mock + fn rack_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::LogoutWhen, operations::LogoutThen), + F: FnOnce(operations::RackListWhen, operations::RackListThen), { self.mock(|when, then| { config_fn( - operations::LogoutWhen::new(when), - operations::LogoutThen::new(then), + operations::RackListWhen::new(when), + operations::RackListThen::new(then), ) }) } - fn current_user_view(&self, config_fn: F) -> httpmock::Mock + fn rack_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CurrentUserViewWhen, operations::CurrentUserViewThen), + F: FnOnce(operations::RackViewWhen, operations::RackViewThen), { self.mock(|when, then| { config_fn( - operations::CurrentUserViewWhen::new(when), - operations::CurrentUserViewThen::new(then), + operations::RackViewWhen::new(when), + operations::RackViewThen::new(then), ) }) } - fn current_user_groups(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_active_configuration_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CurrentUserGroupsWhen, operations::CurrentUserGroupsThen), + F: FnOnce( + operations::NetworkingSwitchPortActiveConfigurationViewWhen, + operations::NetworkingSwitchPortActiveConfigurationViewThen, + ), { self.mock(|when, then| { config_fn( - operations::CurrentUserGroupsWhen::new(when), - operations::CurrentUserGroupsThen::new(then), + operations::NetworkingSwitchPortActiveConfigurationViewWhen::new(when), + operations::NetworkingSwitchPortActiveConfigurationViewThen::new(then), ) }) } - fn current_user_ssh_key_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_active_configuration_set(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CurrentUserSshKeyListWhen, operations::CurrentUserSshKeyListThen), + F: FnOnce( + operations::NetworkingSwitchPortActiveConfigurationSetWhen, + operations::NetworkingSwitchPortActiveConfigurationSetThen, + ), { self.mock(|when, then| { config_fn( - operations::CurrentUserSshKeyListWhen::new(when), - operations::CurrentUserSshKeyListThen::new(then), + operations::NetworkingSwitchPortActiveConfigurationSetWhen::new(when), + operations::NetworkingSwitchPortActiveConfigurationSetThen::new(then), ) }) } - fn current_user_ssh_key_create(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_active_configuration_clear(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CurrentUserSshKeyCreateWhen, operations::CurrentUserSshKeyCreateThen), + F: FnOnce( + operations::NetworkingSwitchPortActiveConfigurationClearWhen, + operations::NetworkingSwitchPortActiveConfigurationClearThen, + ), { self.mock(|when, then| { config_fn( - operations::CurrentUserSshKeyCreateWhen::new(when), - operations::CurrentUserSshKeyCreateThen::new(then), + operations::NetworkingSwitchPortActiveConfigurationClearWhen::new(when), + operations::NetworkingSwitchPortActiveConfigurationClearThen::new(then), ) }) } - fn current_user_ssh_key_view(&self, config_fn: F) -> httpmock::Mock + fn sled_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CurrentUserSshKeyViewWhen, operations::CurrentUserSshKeyViewThen), + F: FnOnce(operations::SledListWhen, operations::SledListThen), { self.mock(|when, then| { config_fn( - operations::CurrentUserSshKeyViewWhen::new(when), - operations::CurrentUserSshKeyViewThen::new(then), + operations::SledListWhen::new(when), + operations::SledListThen::new(then), ) }) } - fn current_user_ssh_key_delete(&self, config_fn: F) -> httpmock::Mock + fn sled_add(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::CurrentUserSshKeyDeleteWhen, operations::CurrentUserSshKeyDeleteThen), + F: FnOnce(operations::SledAddWhen, operations::SledAddThen), { self.mock(|when, then| { config_fn( - operations::CurrentUserSshKeyDeleteWhen::new(when), - operations::CurrentUserSshKeyDeleteThen::new(then), + operations::SledAddWhen::new(when), + operations::SledAddThen::new(then), ) }) } - fn silo_metric(&self, config_fn: F) -> httpmock::Mock + fn sled_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SiloMetricWhen, operations::SiloMetricThen), + F: FnOnce(operations::SledViewWhen, operations::SledViewThen), { self.mock(|when, then| { config_fn( - operations::SiloMetricWhen::new(when), - operations::SiloMetricThen::new(then), + operations::SledViewWhen::new(when), + operations::SledViewThen::new(then), ) }) } - fn instance_network_interface_list(&self, config_fn: F) -> httpmock::Mock + fn sled_physical_disk_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InstanceNetworkInterfaceListWhen, - operations::InstanceNetworkInterfaceListThen, - ), + F: FnOnce(operations::SledPhysicalDiskListWhen, operations::SledPhysicalDiskListThen), { self.mock(|when, then| { config_fn( - operations::InstanceNetworkInterfaceListWhen::new(when), - operations::InstanceNetworkInterfaceListThen::new(then), + operations::SledPhysicalDiskListWhen::new(when), + operations::SledPhysicalDiskListThen::new(then), ) }) } - fn instance_network_interface_create(&self, config_fn: F) -> httpmock::Mock + fn sled_instance_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InstanceNetworkInterfaceCreateWhen, - operations::InstanceNetworkInterfaceCreateThen, - ), + F: FnOnce(operations::SledInstanceListWhen, operations::SledInstanceListThen), { self.mock(|when, then| { config_fn( - operations::InstanceNetworkInterfaceCreateWhen::new(when), - operations::InstanceNetworkInterfaceCreateThen::new(then), + operations::SledInstanceListWhen::new(when), + operations::SledInstanceListThen::new(then), ) }) } - fn instance_network_interface_view(&self, config_fn: F) -> httpmock::Mock + fn sled_set_provision_policy(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InstanceNetworkInterfaceViewWhen, - operations::InstanceNetworkInterfaceViewThen, - ), + F: FnOnce(operations::SledSetProvisionPolicyWhen, operations::SledSetProvisionPolicyThen), { self.mock(|when, then| { config_fn( - operations::InstanceNetworkInterfaceViewWhen::new(when), - operations::InstanceNetworkInterfaceViewThen::new(then), + operations::SledSetProvisionPolicyWhen::new(when), + operations::SledSetProvisionPolicyThen::new(then), ) }) } - fn instance_network_interface_update(&self, config_fn: F) -> httpmock::Mock + fn sled_list_uninitialized(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::InstanceNetworkInterfaceUpdateWhen, - operations::InstanceNetworkInterfaceUpdateThen, - ), + F: FnOnce(operations::SledListUninitializedWhen, operations::SledListUninitializedThen), { self.mock(|when, then| { config_fn( - operations::InstanceNetworkInterfaceUpdateWhen::new(when), - operations::InstanceNetworkInterfaceUpdateThen::new(then), + operations::SledListUninitializedWhen::new(when), + operations::SledListUninitializedThen::new(then), ) }) } - fn instance_network_interface_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::InstanceNetworkInterfaceDeleteWhen, - operations::InstanceNetworkInterfaceDeleteThen, + operations::NetworkingSwitchPortListWhen, + operations::NetworkingSwitchPortListThen, ), { self.mock(|when, then| { config_fn( - operations::InstanceNetworkInterfaceDeleteWhen::new(when), - operations::InstanceNetworkInterfaceDeleteThen::new(then), + operations::NetworkingSwitchPortListWhen::new(when), + operations::NetworkingSwitchPortListThen::new(then), ) }) } - fn ping(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_apply_settings(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::PingWhen, operations::PingThen), + F: FnOnce( + operations::NetworkingSwitchPortApplySettingsWhen, + operations::NetworkingSwitchPortApplySettingsThen, + ), { self.mock(|when, then| { config_fn( - operations::PingWhen::new(when), - operations::PingThen::new(then), + operations::NetworkingSwitchPortApplySettingsWhen::new(when), + operations::NetworkingSwitchPortApplySettingsThen::new(then), ) }) } - fn policy_view(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_clear_settings(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::PolicyViewWhen, operations::PolicyViewThen), + F: FnOnce( + operations::NetworkingSwitchPortClearSettingsWhen, + operations::NetworkingSwitchPortClearSettingsThen, + ), { self.mock(|when, then| { config_fn( - operations::PolicyViewWhen::new(when), - operations::PolicyViewThen::new(then), + operations::NetworkingSwitchPortClearSettingsWhen::new(when), + operations::NetworkingSwitchPortClearSettingsThen::new(then), ) }) } - fn policy_update(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_status(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::PolicyUpdateWhen, operations::PolicyUpdateThen), + F: FnOnce( + operations::NetworkingSwitchPortStatusWhen, + operations::NetworkingSwitchPortStatusThen, + ), { self.mock(|when, then| { config_fn( - operations::PolicyUpdateWhen::new(when), - operations::PolicyUpdateThen::new(then), + operations::NetworkingSwitchPortStatusWhen::new(when), + operations::NetworkingSwitchPortStatusThen::new(then), ) }) } - fn project_list(&self, config_fn: F) -> httpmock::Mock + fn switch_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectListWhen, operations::ProjectListThen), + F: FnOnce(operations::SwitchListWhen, operations::SwitchListThen), { self.mock(|when, then| { config_fn( - operations::ProjectListWhen::new(when), - operations::ProjectListThen::new(then), + operations::SwitchListWhen::new(when), + operations::SwitchListThen::new(then), ) }) } - fn project_create(&self, config_fn: F) -> httpmock::Mock + fn switch_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectCreateWhen, operations::ProjectCreateThen), + F: FnOnce(operations::SwitchViewWhen, operations::SwitchViewThen), { self.mock(|when, then| { config_fn( - operations::ProjectCreateWhen::new(when), - operations::ProjectCreateThen::new(then), + operations::SwitchViewWhen::new(when), + operations::SwitchViewThen::new(then), ) }) } - fn project_view(&self, config_fn: F) -> httpmock::Mock + fn silo_identity_provider_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectViewWhen, operations::ProjectViewThen), + F: FnOnce( + operations::SiloIdentityProviderListWhen, + operations::SiloIdentityProviderListThen, + ), { self.mock(|when, then| { config_fn( - operations::ProjectViewWhen::new(when), - operations::ProjectViewThen::new(then), + operations::SiloIdentityProviderListWhen::new(when), + operations::SiloIdentityProviderListThen::new(then), ) }) } - fn project_update(&self, config_fn: F) -> httpmock::Mock + fn local_idp_user_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectUpdateWhen, operations::ProjectUpdateThen), + F: FnOnce(operations::LocalIdpUserCreateWhen, operations::LocalIdpUserCreateThen), { self.mock(|when, then| { config_fn( - operations::ProjectUpdateWhen::new(when), - operations::ProjectUpdateThen::new(then), + operations::LocalIdpUserCreateWhen::new(when), + operations::LocalIdpUserCreateThen::new(then), ) }) } - fn project_delete(&self, config_fn: F) -> httpmock::Mock + fn local_idp_user_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectDeleteWhen, operations::ProjectDeleteThen), + F: FnOnce(operations::LocalIdpUserDeleteWhen, operations::LocalIdpUserDeleteThen), { self.mock(|when, then| { config_fn( - operations::ProjectDeleteWhen::new(when), - operations::ProjectDeleteThen::new(then), + operations::LocalIdpUserDeleteWhen::new(when), + operations::LocalIdpUserDeleteThen::new(then), ) }) } - fn project_policy_view(&self, config_fn: F) -> httpmock::Mock + fn local_idp_user_set_password(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectPolicyViewWhen, operations::ProjectPolicyViewThen), + F: FnOnce(operations::LocalIdpUserSetPasswordWhen, operations::LocalIdpUserSetPasswordThen), { self.mock(|when, then| { config_fn( - operations::ProjectPolicyViewWhen::new(when), - operations::ProjectPolicyViewThen::new(then), + operations::LocalIdpUserSetPasswordWhen::new(when), + operations::LocalIdpUserSetPasswordThen::new(then), ) }) } - fn project_policy_update(&self, config_fn: F) -> httpmock::Mock + fn saml_identity_provider_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::ProjectPolicyUpdateWhen, operations::ProjectPolicyUpdateThen), + F: FnOnce( + operations::SamlIdentityProviderCreateWhen, + operations::SamlIdentityProviderCreateThen, + ), { self.mock(|when, then| { config_fn( - operations::ProjectPolicyUpdateWhen::new(when), - operations::ProjectPolicyUpdateThen::new(then), + operations::SamlIdentityProviderCreateWhen::new(when), + operations::SamlIdentityProviderCreateThen::new(then), ) }) } - fn snapshot_list(&self, config_fn: F) -> httpmock::Mock + fn saml_identity_provider_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SnapshotListWhen, operations::SnapshotListThen), + F: FnOnce( + operations::SamlIdentityProviderViewWhen, + operations::SamlIdentityProviderViewThen, + ), { self.mock(|when, then| { config_fn( - operations::SnapshotListWhen::new(when), - operations::SnapshotListThen::new(then), + operations::SamlIdentityProviderViewWhen::new(when), + operations::SamlIdentityProviderViewThen::new(then), ) }) } - fn snapshot_create(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SnapshotCreateWhen, operations::SnapshotCreateThen), + F: FnOnce(operations::IpPoolListWhen, operations::IpPoolListThen), { self.mock(|when, then| { config_fn( - operations::SnapshotCreateWhen::new(when), - operations::SnapshotCreateThen::new(then), + operations::IpPoolListWhen::new(when), + operations::IpPoolListThen::new(then), ) }) } - fn snapshot_view(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SnapshotViewWhen, operations::SnapshotViewThen), + F: FnOnce(operations::IpPoolCreateWhen, operations::IpPoolCreateThen), { self.mock(|when, then| { config_fn( - operations::SnapshotViewWhen::new(when), - operations::SnapshotViewThen::new(then), + operations::IpPoolCreateWhen::new(when), + operations::IpPoolCreateThen::new(then), ) }) } - fn snapshot_delete(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SnapshotDeleteWhen, operations::SnapshotDeleteThen), + F: FnOnce(operations::IpPoolViewWhen, operations::IpPoolViewThen), { self.mock(|when, then| { config_fn( - operations::SnapshotDeleteWhen::new(when), - operations::SnapshotDeleteThen::new(then), + operations::IpPoolViewWhen::new(when), + operations::IpPoolViewThen::new(then), ) }) } - fn physical_disk_list(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::PhysicalDiskListWhen, operations::PhysicalDiskListThen), + F: FnOnce(operations::IpPoolUpdateWhen, operations::IpPoolUpdateThen), { self.mock(|when, then| { config_fn( - operations::PhysicalDiskListWhen::new(when), - operations::PhysicalDiskListThen::new(then), + operations::IpPoolUpdateWhen::new(when), + operations::IpPoolUpdateThen::new(then), ) }) } - fn physical_disk_view(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::PhysicalDiskViewWhen, operations::PhysicalDiskViewThen), + F: FnOnce(operations::IpPoolDeleteWhen, operations::IpPoolDeleteThen), { self.mock(|when, then| { config_fn( - operations::PhysicalDiskViewWhen::new(when), - operations::PhysicalDiskViewThen::new(then), + operations::IpPoolDeleteWhen::new(when), + operations::IpPoolDeleteThen::new(then), ) }) } - fn rack_list(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_range_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::RackListWhen, operations::RackListThen), + F: FnOnce(operations::IpPoolRangeListWhen, operations::IpPoolRangeListThen), { self.mock(|when, then| { config_fn( - operations::RackListWhen::new(when), - operations::RackListThen::new(then), + operations::IpPoolRangeListWhen::new(when), + operations::IpPoolRangeListThen::new(then), ) }) } - fn rack_view(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_range_add(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::RackViewWhen, operations::RackViewThen), + F: FnOnce(operations::IpPoolRangeAddWhen, operations::IpPoolRangeAddThen), { self.mock(|when, then| { config_fn( - operations::RackViewWhen::new(when), - operations::RackViewThen::new(then), + operations::IpPoolRangeAddWhen::new(when), + operations::IpPoolRangeAddThen::new(then), ) }) } - fn sled_list(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_range_remove(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledListWhen, operations::SledListThen), + F: FnOnce(operations::IpPoolRangeRemoveWhen, operations::IpPoolRangeRemoveThen), { self.mock(|when, then| { config_fn( - operations::SledListWhen::new(when), - operations::SledListThen::new(then), + operations::IpPoolRangeRemoveWhen::new(when), + operations::IpPoolRangeRemoveThen::new(then), ) }) } - fn sled_add(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_silo_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledAddWhen, operations::SledAddThen), + F: FnOnce(operations::IpPoolSiloListWhen, operations::IpPoolSiloListThen), { self.mock(|when, then| { config_fn( - operations::SledAddWhen::new(when), - operations::SledAddThen::new(then), + operations::IpPoolSiloListWhen::new(when), + operations::IpPoolSiloListThen::new(then), ) }) } - fn sled_view(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_silo_link(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledViewWhen, operations::SledViewThen), + F: FnOnce(operations::IpPoolSiloLinkWhen, operations::IpPoolSiloLinkThen), { self.mock(|when, then| { config_fn( - operations::SledViewWhen::new(when), - operations::SledViewThen::new(then), + operations::IpPoolSiloLinkWhen::new(when), + operations::IpPoolSiloLinkThen::new(then), ) }) } - fn sled_physical_disk_list(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_silo_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledPhysicalDiskListWhen, operations::SledPhysicalDiskListThen), + F: FnOnce(operations::IpPoolSiloUpdateWhen, operations::IpPoolSiloUpdateThen), { self.mock(|when, then| { config_fn( - operations::SledPhysicalDiskListWhen::new(when), - operations::SledPhysicalDiskListThen::new(then), + operations::IpPoolSiloUpdateWhen::new(when), + operations::IpPoolSiloUpdateThen::new(then), ) }) } - fn sled_instance_list(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_silo_unlink(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledInstanceListWhen, operations::SledInstanceListThen), + F: FnOnce(operations::IpPoolSiloUnlinkWhen, operations::IpPoolSiloUnlinkThen), { self.mock(|when, then| { config_fn( - operations::SledInstanceListWhen::new(when), - operations::SledInstanceListThen::new(then), + operations::IpPoolSiloUnlinkWhen::new(when), + operations::IpPoolSiloUnlinkThen::new(then), ) }) } - fn sled_set_provision_policy(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_utilization_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledSetProvisionPolicyWhen, operations::SledSetProvisionPolicyThen), + F: FnOnce(operations::IpPoolUtilizationViewWhen, operations::IpPoolUtilizationViewThen), { self.mock(|when, then| { config_fn( - operations::SledSetProvisionPolicyWhen::new(when), - operations::SledSetProvisionPolicyThen::new(then), + operations::IpPoolUtilizationViewWhen::new(when), + operations::IpPoolUtilizationViewThen::new(then), ) }) } - fn sled_list_uninitialized(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_service_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledListUninitializedWhen, operations::SledListUninitializedThen), + F: FnOnce(operations::IpPoolServiceViewWhen, operations::IpPoolServiceViewThen), { self.mock(|when, then| { config_fn( - operations::SledListUninitializedWhen::new(when), - operations::SledListUninitializedThen::new(then), + operations::IpPoolServiceViewWhen::new(when), + operations::IpPoolServiceViewThen::new(then), ) }) } - fn networking_switch_port_list(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_service_range_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::NetworkingSwitchPortListWhen, - operations::NetworkingSwitchPortListThen, - ), + F: FnOnce(operations::IpPoolServiceRangeListWhen, operations::IpPoolServiceRangeListThen), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortListWhen::new(when), - operations::NetworkingSwitchPortListThen::new(then), + operations::IpPoolServiceRangeListWhen::new(when), + operations::IpPoolServiceRangeListThen::new(then), ) }) } - fn networking_switch_port_apply_settings(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_service_range_add(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::NetworkingSwitchPortApplySettingsWhen, - operations::NetworkingSwitchPortApplySettingsThen, - ), + F: FnOnce(operations::IpPoolServiceRangeAddWhen, operations::IpPoolServiceRangeAddThen), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortApplySettingsWhen::new(when), - operations::NetworkingSwitchPortApplySettingsThen::new(then), + operations::IpPoolServiceRangeAddWhen::new(when), + operations::IpPoolServiceRangeAddThen::new(then), ) }) } - fn networking_switch_port_clear_settings(&self, config_fn: F) -> httpmock::Mock + fn ip_pool_service_range_remove(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortClearSettingsWhen, - operations::NetworkingSwitchPortClearSettingsThen, + operations::IpPoolServiceRangeRemoveWhen, + operations::IpPoolServiceRangeRemoveThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortClearSettingsWhen::new(when), - operations::NetworkingSwitchPortClearSettingsThen::new(then), + operations::IpPoolServiceRangeRemoveWhen::new(when), + operations::IpPoolServiceRangeRemoveThen::new(then), ) }) } - fn networking_switch_port_status(&self, config_fn: F) -> httpmock::Mock + fn system_metric(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::NetworkingSwitchPortStatusWhen, - operations::NetworkingSwitchPortStatusThen, - ), + F: FnOnce(operations::SystemMetricWhen, operations::SystemMetricThen), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortStatusWhen::new(when), - operations::NetworkingSwitchPortStatusThen::new(then), + operations::SystemMetricWhen::new(when), + operations::SystemMetricThen::new(then), ) }) } - fn switch_list(&self, config_fn: F) -> httpmock::Mock + fn networking_address_lot_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SwitchListWhen, operations::SwitchListThen), + F: FnOnce( + operations::NetworkingAddressLotListWhen, + operations::NetworkingAddressLotListThen, + ), { self.mock(|when, then| { config_fn( - operations::SwitchListWhen::new(when), - operations::SwitchListThen::new(then), + operations::NetworkingAddressLotListWhen::new(when), + operations::NetworkingAddressLotListThen::new(then), ) }) } - fn switch_view(&self, config_fn: F) -> httpmock::Mock + fn networking_address_lot_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SwitchViewWhen, operations::SwitchViewThen), + F: FnOnce( + operations::NetworkingAddressLotCreateWhen, + operations::NetworkingAddressLotCreateThen, + ), { self.mock(|when, then| { config_fn( - operations::SwitchViewWhen::new(when), - operations::SwitchViewThen::new(then), + operations::NetworkingAddressLotCreateWhen::new(when), + operations::NetworkingAddressLotCreateThen::new(then), ) }) } - fn silo_identity_provider_list(&self, config_fn: F) -> httpmock::Mock + fn networking_address_lot_delete(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::SiloIdentityProviderListWhen, - operations::SiloIdentityProviderListThen, + operations::NetworkingAddressLotDeleteWhen, + operations::NetworkingAddressLotDeleteThen, ), { self.mock(|when, then| { config_fn( - operations::SiloIdentityProviderListWhen::new(when), - operations::SiloIdentityProviderListThen::new(then), + operations::NetworkingAddressLotDeleteWhen::new(when), + operations::NetworkingAddressLotDeleteThen::new(then), ) }) } - fn local_idp_user_create(&self, config_fn: F) -> httpmock::Mock + fn networking_address_lot_block_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::LocalIdpUserCreateWhen, operations::LocalIdpUserCreateThen), + F: FnOnce( + operations::NetworkingAddressLotBlockListWhen, + operations::NetworkingAddressLotBlockListThen, + ), { self.mock(|when, then| { config_fn( - operations::LocalIdpUserCreateWhen::new(when), - operations::LocalIdpUserCreateThen::new(then), + operations::NetworkingAddressLotBlockListWhen::new(when), + operations::NetworkingAddressLotBlockListThen::new(then), ) }) } - fn local_idp_user_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_address_lot_block_add(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::LocalIdpUserDeleteWhen, operations::LocalIdpUserDeleteThen), + F: FnOnce( + operations::NetworkingAddressLotBlockAddWhen, + operations::NetworkingAddressLotBlockAddThen, + ), { self.mock(|when, then| { config_fn( - operations::LocalIdpUserDeleteWhen::new(when), - operations::LocalIdpUserDeleteThen::new(then), + operations::NetworkingAddressLotBlockAddWhen::new(when), + operations::NetworkingAddressLotBlockAddThen::new(then), ) }) } - fn local_idp_user_set_password(&self, config_fn: F) -> httpmock::Mock + fn networking_address_lot_block_remove(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::LocalIdpUserSetPasswordWhen, operations::LocalIdpUserSetPasswordThen), + F: FnOnce( + operations::NetworkingAddressLotBlockRemoveWhen, + operations::NetworkingAddressLotBlockRemoveThen, + ), { self.mock(|when, then| { config_fn( - operations::LocalIdpUserSetPasswordWhen::new(when), - operations::LocalIdpUserSetPasswordThen::new(then), + operations::NetworkingAddressLotBlockRemoveWhen::new(when), + operations::NetworkingAddressLotBlockRemoveThen::new(then), ) }) } - fn saml_identity_provider_create(&self, config_fn: F) -> httpmock::Mock + fn networking_allow_list_view(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce( - operations::SamlIdentityProviderCreateWhen, - operations::SamlIdentityProviderCreateThen, - ), + F: FnOnce(operations::NetworkingAllowListViewWhen, operations::NetworkingAllowListViewThen), { self.mock(|when, then| { config_fn( - operations::SamlIdentityProviderCreateWhen::new(when), - operations::SamlIdentityProviderCreateThen::new(then), + operations::NetworkingAllowListViewWhen::new(when), + operations::NetworkingAllowListViewThen::new(then), ) }) } - fn saml_identity_provider_view(&self, config_fn: F) -> httpmock::Mock + fn networking_allow_list_update(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::SamlIdentityProviderViewWhen, - operations::SamlIdentityProviderViewThen, + operations::NetworkingAllowListUpdateWhen, + operations::NetworkingAllowListUpdateThen, ), { self.mock(|when, then| { config_fn( - operations::SamlIdentityProviderViewWhen::new(when), - operations::SamlIdentityProviderViewThen::new(then), + operations::NetworkingAllowListUpdateWhen::new(when), + operations::NetworkingAllowListUpdateThen::new(then), ) }) } - fn ip_pool_list(&self, config_fn: F) -> httpmock::Mock + fn networking_bfd_disable(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolListWhen, operations::IpPoolListThen), + F: FnOnce(operations::NetworkingBfdDisableWhen, operations::NetworkingBfdDisableThen), { self.mock(|when, then| { config_fn( - operations::IpPoolListWhen::new(when), - operations::IpPoolListThen::new(then), + operations::NetworkingBfdDisableWhen::new(when), + operations::NetworkingBfdDisableThen::new(then), ) }) } - fn ip_pool_create(&self, config_fn: F) -> httpmock::Mock + fn networking_bfd_enable(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolCreateWhen, operations::IpPoolCreateThen), + F: FnOnce(operations::NetworkingBfdEnableWhen, operations::NetworkingBfdEnableThen), { self.mock(|when, then| { config_fn( - operations::IpPoolCreateWhen::new(when), - operations::IpPoolCreateThen::new(then), + operations::NetworkingBfdEnableWhen::new(when), + operations::NetworkingBfdEnableThen::new(then), ) }) } - fn ip_pool_view(&self, config_fn: F) -> httpmock::Mock + fn networking_bfd_status(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolViewWhen, operations::IpPoolViewThen), + F: FnOnce(operations::NetworkingBfdStatusWhen, operations::NetworkingBfdStatusThen), { self.mock(|when, then| { config_fn( - operations::IpPoolViewWhen::new(when), - operations::IpPoolViewThen::new(then), + operations::NetworkingBfdStatusWhen::new(when), + operations::NetworkingBfdStatusThen::new(then), ) }) } - fn ip_pool_update(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_config_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolUpdateWhen, operations::IpPoolUpdateThen), + F: FnOnce(operations::NetworkingBgpConfigListWhen, operations::NetworkingBgpConfigListThen), { self.mock(|when, then| { config_fn( - operations::IpPoolUpdateWhen::new(when), - operations::IpPoolUpdateThen::new(then), + operations::NetworkingBgpConfigListWhen::new(when), + operations::NetworkingBgpConfigListThen::new(then), ) }) } - fn ip_pool_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_config_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolDeleteWhen, operations::IpPoolDeleteThen), + F: FnOnce( + operations::NetworkingBgpConfigCreateWhen, + operations::NetworkingBgpConfigCreateThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolDeleteWhen::new(when), - operations::IpPoolDeleteThen::new(then), + operations::NetworkingBgpConfigCreateWhen::new(when), + operations::NetworkingBgpConfigCreateThen::new(then), ) }) } - fn ip_pool_range_list(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_config_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolRangeListWhen, operations::IpPoolRangeListThen), + F: FnOnce( + operations::NetworkingBgpConfigDeleteWhen, + operations::NetworkingBgpConfigDeleteThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolRangeListWhen::new(when), - operations::IpPoolRangeListThen::new(then), + operations::NetworkingBgpConfigDeleteWhen::new(when), + operations::NetworkingBgpConfigDeleteThen::new(then), ) }) } - fn ip_pool_range_add(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_announce_set_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolRangeAddWhen, operations::IpPoolRangeAddThen), + F: FnOnce( + operations::NetworkingBgpAnnounceSetListWhen, + operations::NetworkingBgpAnnounceSetListThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolRangeAddWhen::new(when), - operations::IpPoolRangeAddThen::new(then), + operations::NetworkingBgpAnnounceSetListWhen::new(when), + operations::NetworkingBgpAnnounceSetListThen::new(then), ) }) } - fn ip_pool_range_remove(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_announce_set_update(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolRangeRemoveWhen, operations::IpPoolRangeRemoveThen), + F: FnOnce( + operations::NetworkingBgpAnnounceSetUpdateWhen, + operations::NetworkingBgpAnnounceSetUpdateThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolRangeRemoveWhen::new(when), - operations::IpPoolRangeRemoveThen::new(then), + operations::NetworkingBgpAnnounceSetUpdateWhen::new(when), + operations::NetworkingBgpAnnounceSetUpdateThen::new(then), ) }) } - fn ip_pool_silo_list(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_announce_set_delete(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolSiloListWhen, operations::IpPoolSiloListThen), + F: FnOnce( + operations::NetworkingBgpAnnounceSetDeleteWhen, + operations::NetworkingBgpAnnounceSetDeleteThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolSiloListWhen::new(when), - operations::IpPoolSiloListThen::new(then), + operations::NetworkingBgpAnnounceSetDeleteWhen::new(when), + operations::NetworkingBgpAnnounceSetDeleteThen::new(then), ) }) } - fn ip_pool_silo_link(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_announcement_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolSiloLinkWhen, operations::IpPoolSiloLinkThen), + F: FnOnce( + operations::NetworkingBgpAnnouncementListWhen, + operations::NetworkingBgpAnnouncementListThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolSiloLinkWhen::new(when), - operations::IpPoolSiloLinkThen::new(then), + operations::NetworkingBgpAnnouncementListWhen::new(when), + operations::NetworkingBgpAnnouncementListThen::new(then), ) }) } - fn ip_pool_silo_update(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_exported(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolSiloUpdateWhen, operations::IpPoolSiloUpdateThen), + F: FnOnce(operations::NetworkingBgpExportedWhen, operations::NetworkingBgpExportedThen), { self.mock(|when, then| { config_fn( - operations::IpPoolSiloUpdateWhen::new(when), - operations::IpPoolSiloUpdateThen::new(then), + operations::NetworkingBgpExportedWhen::new(when), + operations::NetworkingBgpExportedThen::new(then), ) }) } - fn ip_pool_silo_unlink(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_message_history(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolSiloUnlinkWhen, operations::IpPoolSiloUnlinkThen), + F: FnOnce( + operations::NetworkingBgpMessageHistoryWhen, + operations::NetworkingBgpMessageHistoryThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolSiloUnlinkWhen::new(when), - operations::IpPoolSiloUnlinkThen::new(then), + operations::NetworkingBgpMessageHistoryWhen::new(when), + operations::NetworkingBgpMessageHistoryThen::new(then), ) }) } - fn ip_pool_utilization_view(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_imported_routes_ipv4(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolUtilizationViewWhen, operations::IpPoolUtilizationViewThen), + F: FnOnce( + operations::NetworkingBgpImportedRoutesIpv4When, + operations::NetworkingBgpImportedRoutesIpv4Then, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolUtilizationViewWhen::new(when), - operations::IpPoolUtilizationViewThen::new(then), + operations::NetworkingBgpImportedRoutesIpv4When::new(when), + operations::NetworkingBgpImportedRoutesIpv4Then::new(then), ) }) } - fn ip_pool_service_view(&self, config_fn: F) -> httpmock::Mock + fn networking_bgp_status(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolServiceViewWhen, operations::IpPoolServiceViewThen), + F: FnOnce(operations::NetworkingBgpStatusWhen, operations::NetworkingBgpStatusThen), { self.mock(|when, then| { config_fn( - operations::IpPoolServiceViewWhen::new(when), - operations::IpPoolServiceViewThen::new(then), + operations::NetworkingBgpStatusWhen::new(when), + operations::NetworkingBgpStatusThen::new(then), ) }) } - fn ip_pool_service_range_list(&self, config_fn: F) -> httpmock::Mock + fn networking_loopback_address_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolServiceRangeListWhen, operations::IpPoolServiceRangeListThen), + F: FnOnce( + operations::NetworkingLoopbackAddressListWhen, + operations::NetworkingLoopbackAddressListThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolServiceRangeListWhen::new(when), - operations::IpPoolServiceRangeListThen::new(then), + operations::NetworkingLoopbackAddressListWhen::new(when), + operations::NetworkingLoopbackAddressListThen::new(then), ) }) } - fn ip_pool_service_range_add(&self, config_fn: F) -> httpmock::Mock + fn networking_loopback_address_create(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::IpPoolServiceRangeAddWhen, operations::IpPoolServiceRangeAddThen), + F: FnOnce( + operations::NetworkingLoopbackAddressCreateWhen, + operations::NetworkingLoopbackAddressCreateThen, + ), { self.mock(|when, then| { config_fn( - operations::IpPoolServiceRangeAddWhen::new(when), - operations::IpPoolServiceRangeAddThen::new(then), + operations::NetworkingLoopbackAddressCreateWhen::new(when), + operations::NetworkingLoopbackAddressCreateThen::new(then), ) }) } - fn ip_pool_service_range_remove(&self, config_fn: F) -> httpmock::Mock + fn networking_loopback_address_delete(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::IpPoolServiceRangeRemoveWhen, - operations::IpPoolServiceRangeRemoveThen, + operations::NetworkingLoopbackAddressDeleteWhen, + operations::NetworkingLoopbackAddressDeleteThen, ), { self.mock(|when, then| { config_fn( - operations::IpPoolServiceRangeRemoveWhen::new(when), - operations::IpPoolServiceRangeRemoveThen::new(then), + operations::NetworkingLoopbackAddressDeleteWhen::new(when), + operations::NetworkingLoopbackAddressDeleteThen::new(then), ) }) } - fn system_metric(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SystemMetricWhen, operations::SystemMetricThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationListWhen, + operations::NetworkingSwitchPortConfigurationListThen, + ), { self.mock(|when, then| { config_fn( - operations::SystemMetricWhen::new(when), - operations::SystemMetricThen::new(then), + operations::NetworkingSwitchPortConfigurationListWhen::new(when), + operations::NetworkingSwitchPortConfigurationListThen::new(then), ) }) } - fn networking_address_lot_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_create(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingAddressLotListWhen, - operations::NetworkingAddressLotListThen, + operations::NetworkingSwitchPortConfigurationCreateWhen, + operations::NetworkingSwitchPortConfigurationCreateThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingAddressLotListWhen::new(when), - operations::NetworkingAddressLotListThen::new(then), + operations::NetworkingSwitchPortConfigurationCreateWhen::new(when), + operations::NetworkingSwitchPortConfigurationCreateThen::new(then), ) }) } - fn networking_address_lot_create(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_view(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingAddressLotCreateWhen, - operations::NetworkingAddressLotCreateThen, + operations::NetworkingSwitchPortConfigurationViewWhen, + operations::NetworkingSwitchPortConfigurationViewThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingAddressLotCreateWhen::new(when), - operations::NetworkingAddressLotCreateThen::new(then), + operations::NetworkingSwitchPortConfigurationViewWhen::new(when), + operations::NetworkingSwitchPortConfigurationViewThen::new(then), ) }) } - fn networking_address_lot_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_delete(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingAddressLotDeleteWhen, - operations::NetworkingAddressLotDeleteThen, + operations::NetworkingSwitchPortConfigurationDeleteWhen, + operations::NetworkingSwitchPortConfigurationDeleteThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingAddressLotDeleteWhen::new(when), - operations::NetworkingAddressLotDeleteThen::new(then), + operations::NetworkingSwitchPortConfigurationDeleteWhen::new(when), + operations::NetworkingSwitchPortConfigurationDeleteThen::new(then), ) }) } - fn networking_address_lot_block_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_address_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingAddressLotBlockListWhen, - operations::NetworkingAddressLotBlockListThen, + operations::NetworkingSwitchPortConfigurationAddressListWhen, + operations::NetworkingSwitchPortConfigurationAddressListThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingAddressLotBlockListWhen::new(when), - operations::NetworkingAddressLotBlockListThen::new(then), + operations::NetworkingSwitchPortConfigurationAddressListWhen::new(when), + operations::NetworkingSwitchPortConfigurationAddressListThen::new(then), ) }) } - fn networking_allow_list_view(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_address_add(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::NetworkingAllowListViewWhen, operations::NetworkingAllowListViewThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationAddressAddWhen, + operations::NetworkingSwitchPortConfigurationAddressAddThen, + ), { self.mock(|when, then| { config_fn( - operations::NetworkingAllowListViewWhen::new(when), - operations::NetworkingAllowListViewThen::new(then), + operations::NetworkingSwitchPortConfigurationAddressAddWhen::new(when), + operations::NetworkingSwitchPortConfigurationAddressAddThen::new(then), ) }) } - fn networking_allow_list_update(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_address_remove(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingAllowListUpdateWhen, - operations::NetworkingAllowListUpdateThen, + operations::NetworkingSwitchPortConfigurationAddressRemoveWhen, + operations::NetworkingSwitchPortConfigurationAddressRemoveThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingAllowListUpdateWhen::new(when), - operations::NetworkingAllowListUpdateThen::new(then), + operations::NetworkingSwitchPortConfigurationAddressRemoveWhen::new(when), + operations::NetworkingSwitchPortConfigurationAddressRemoveThen::new(then), ) }) } - fn networking_bfd_disable(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_list(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBfdDisableWhen, operations::NetworkingBfdDisableThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerListThen, + ), { self.mock(|when, then| { config_fn( - operations::NetworkingBfdDisableWhen::new(when), - operations::NetworkingBfdDisableThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerListWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerListThen::new(then), ) }) } - fn networking_bfd_enable(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_add(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBfdEnableWhen, operations::NetworkingBfdEnableThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAddThen, + ), { self.mock(|when, then| { config_fn( - operations::NetworkingBfdEnableWhen::new(when), - operations::NetworkingBfdEnableThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerAddWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerAddThen::new(then), ) }) } - fn networking_bfd_status(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_export_list( + &self, + config_fn: F, + ) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBfdStatusWhen, operations::NetworkingBfdStatusThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportListThen, + ), { self.mock(|when, then| { config_fn( - operations::NetworkingBfdStatusWhen::new(when), - operations::NetworkingBfdStatusThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportListWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportListThen::new(then), ) }) } - fn networking_bgp_config_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_export_add( + &self, + config_fn: F, + ) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBgpConfigListWhen, operations::NetworkingBgpConfigListThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportAddThen, + ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpConfigListWhen::new(when), - operations::NetworkingBgpConfigListThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportAddWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportAddThen::new(then), ) }) } - fn networking_bgp_config_create(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_export_remove( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpConfigCreateWhen, - operations::NetworkingBgpConfigCreateThen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpConfigCreateWhen::new(when), - operations::NetworkingBgpConfigCreateThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveWhen::new( + when, + ), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemoveThen::new( + then, + ), ) }) } - fn networking_bgp_config_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_import_list( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpConfigDeleteWhen, - operations::NetworkingBgpConfigDeleteThen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportListThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpConfigDeleteWhen::new(when), - operations::NetworkingBgpConfigDeleteThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportListWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportListThen::new(then), ) }) } - fn networking_bgp_announce_set_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_import_add( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnounceSetListWhen, - operations::NetworkingBgpAnnounceSetListThen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportAddThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpAnnounceSetListWhen::new(when), - operations::NetworkingBgpAnnounceSetListThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportAddWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportAddThen::new(then), ) }) } - fn networking_bgp_announce_set_update(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_allow_import_remove( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnounceSetUpdateWhen, - operations::NetworkingBgpAnnounceSetUpdateThen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpAnnounceSetUpdateWhen::new(when), - operations::NetworkingBgpAnnounceSetUpdateThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveWhen::new( + when, + ), + operations::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemoveThen::new( + then, + ), ) }) } - fn networking_bgp_announce_set_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_community_list( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnounceSetDeleteWhen, - operations::NetworkingBgpAnnounceSetDeleteThen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityListWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityListThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpAnnounceSetDeleteWhen::new(when), - operations::NetworkingBgpAnnounceSetDeleteThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityListWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityListThen::new(then), ) }) } - fn networking_bgp_announcement_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_community_add( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpAnnouncementListWhen, - operations::NetworkingBgpAnnouncementListThen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityAddWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityAddThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpAnnouncementListWhen::new(when), - operations::NetworkingBgpAnnouncementListThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityAddWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityAddThen::new(then), ) }) } - fn networking_bgp_exported(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_community_remove( + &self, + config_fn: F, + ) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBgpExportedWhen, operations::NetworkingBgpExportedThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveThen, + ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpExportedWhen::new(when), - operations::NetworkingBgpExportedThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerCommunityRemoveThen::new(then), ) }) } - fn networking_bgp_message_history(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_bgp_peer_remove( + &self, + config_fn: F, + ) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpMessageHistoryWhen, - operations::NetworkingBgpMessageHistoryThen, + operations::NetworkingSwitchPortConfigurationBgpPeerRemoveWhen, + operations::NetworkingSwitchPortConfigurationBgpPeerRemoveThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpMessageHistoryWhen::new(when), - operations::NetworkingBgpMessageHistoryThen::new(then), + operations::NetworkingSwitchPortConfigurationBgpPeerRemoveWhen::new(when), + operations::NetworkingSwitchPortConfigurationBgpPeerRemoveThen::new(then), ) }) } - fn networking_bgp_imported_routes_ipv4(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_geometry_view(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingBgpImportedRoutesIpv4When, - operations::NetworkingBgpImportedRoutesIpv4Then, + operations::NetworkingSwitchPortConfigurationGeometryViewWhen, + operations::NetworkingSwitchPortConfigurationGeometryViewThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpImportedRoutesIpv4When::new(when), - operations::NetworkingBgpImportedRoutesIpv4Then::new(then), + operations::NetworkingSwitchPortConfigurationGeometryViewWhen::new(when), + operations::NetworkingSwitchPortConfigurationGeometryViewThen::new(then), ) }) } - fn networking_bgp_status(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_geometry_set(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::NetworkingBgpStatusWhen, operations::NetworkingBgpStatusThen), + F: FnOnce( + operations::NetworkingSwitchPortConfigurationGeometrySetWhen, + operations::NetworkingSwitchPortConfigurationGeometrySetThen, + ), { self.mock(|when, then| { config_fn( - operations::NetworkingBgpStatusWhen::new(when), - operations::NetworkingBgpStatusThen::new(then), + operations::NetworkingSwitchPortConfigurationGeometrySetWhen::new(when), + operations::NetworkingSwitchPortConfigurationGeometrySetThen::new(then), ) }) } - fn networking_loopback_address_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_link_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingLoopbackAddressListWhen, - operations::NetworkingLoopbackAddressListThen, + operations::NetworkingSwitchPortConfigurationLinkListWhen, + operations::NetworkingSwitchPortConfigurationLinkListThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingLoopbackAddressListWhen::new(when), - operations::NetworkingLoopbackAddressListThen::new(then), + operations::NetworkingSwitchPortConfigurationLinkListWhen::new(when), + operations::NetworkingSwitchPortConfigurationLinkListThen::new(then), ) }) } - fn networking_loopback_address_create(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_link_create(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingLoopbackAddressCreateWhen, - operations::NetworkingLoopbackAddressCreateThen, + operations::NetworkingSwitchPortConfigurationLinkCreateWhen, + operations::NetworkingSwitchPortConfigurationLinkCreateThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingLoopbackAddressCreateWhen::new(when), - operations::NetworkingLoopbackAddressCreateThen::new(then), + operations::NetworkingSwitchPortConfigurationLinkCreateWhen::new(when), + operations::NetworkingSwitchPortConfigurationLinkCreateThen::new(then), ) }) } - fn networking_loopback_address_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_link_view(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingLoopbackAddressDeleteWhen, - operations::NetworkingLoopbackAddressDeleteThen, + operations::NetworkingSwitchPortConfigurationLinkViewWhen, + operations::NetworkingSwitchPortConfigurationLinkViewThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingLoopbackAddressDeleteWhen::new(when), - operations::NetworkingLoopbackAddressDeleteThen::new(then), + operations::NetworkingSwitchPortConfigurationLinkViewWhen::new(when), + operations::NetworkingSwitchPortConfigurationLinkViewThen::new(then), ) }) } - fn networking_switch_port_settings_list(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_link_delete(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsListWhen, - operations::NetworkingSwitchPortSettingsListThen, + operations::NetworkingSwitchPortConfigurationLinkDeleteWhen, + operations::NetworkingSwitchPortConfigurationLinkDeleteThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortSettingsListWhen::new(when), - operations::NetworkingSwitchPortSettingsListThen::new(then), + operations::NetworkingSwitchPortConfigurationLinkDeleteWhen::new(when), + operations::NetworkingSwitchPortConfigurationLinkDeleteThen::new(then), ) }) } - fn networking_switch_port_settings_create(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_route_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsCreateWhen, - operations::NetworkingSwitchPortSettingsCreateThen, + operations::NetworkingSwitchPortConfigurationRouteListWhen, + operations::NetworkingSwitchPortConfigurationRouteListThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortSettingsCreateWhen::new(when), - operations::NetworkingSwitchPortSettingsCreateThen::new(then), + operations::NetworkingSwitchPortConfigurationRouteListWhen::new(when), + operations::NetworkingSwitchPortConfigurationRouteListThen::new(then), ) }) } - fn networking_switch_port_settings_delete(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_route_add(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsDeleteWhen, - operations::NetworkingSwitchPortSettingsDeleteThen, + operations::NetworkingSwitchPortConfigurationRouteAddWhen, + operations::NetworkingSwitchPortConfigurationRouteAddThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortSettingsDeleteWhen::new(when), - operations::NetworkingSwitchPortSettingsDeleteThen::new(then), + operations::NetworkingSwitchPortConfigurationRouteAddWhen::new(when), + operations::NetworkingSwitchPortConfigurationRouteAddThen::new(then), ) }) } - fn networking_switch_port_settings_view(&self, config_fn: F) -> httpmock::Mock + fn networking_switch_port_configuration_route_remove(&self, config_fn: F) -> httpmock::Mock where F: FnOnce( - operations::NetworkingSwitchPortSettingsViewWhen, - operations::NetworkingSwitchPortSettingsViewThen, + operations::NetworkingSwitchPortConfigurationRouteRemoveWhen, + operations::NetworkingSwitchPortConfigurationRouteRemoveThen, ), { self.mock(|when, then| { config_fn( - operations::NetworkingSwitchPortSettingsViewWhen::new(when), - operations::NetworkingSwitchPortSettingsViewThen::new(then), + operations::NetworkingSwitchPortConfigurationRouteRemoveWhen::new(when), + operations::NetworkingSwitchPortConfigurationRouteRemoveThen::new(then), ) }) } diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 5d3332c9..5d671a7f 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -53,7 +53,7 @@ pub mod types { /// ], /// "properties": { /// "address": { - /// "description": "The address and prefix length of this address.", + /// "description": "The address and subnet mask", /// "allOf": [ /// { /// "$ref": "#/components/schemas/IpNet" @@ -85,7 +85,7 @@ pub mod types { :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, )] pub struct Address { - /// The address and prefix length of this address. + /// The address and subnet mask pub address: IpNet, /// The address lot this address is drawn from. pub address_lot: NameOrId, @@ -106,6 +106,85 @@ pub mod types { } } + /// An address to be added to or removed from an interface + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "An address to be added to or removed from an + /// interface", + /// "type": "object", + /// "required": [ + /// "address", + /// "address_lot", + /// "interface" + /// ], + /// "properties": { + /// "address": { + /// "description": "The address and subnet mask", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// ] + /// }, + /// "address_lot": { + /// "description": "The address lot this address is drawn from.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// ] + /// }, + /// "interface": { + /// "description": "The name of the interface", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// }, + /// "vlan_id": { + /// "description": "Optional VLAN ID for this address", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint16", + /// "minimum": 0.0 + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct AddressAddRemove { + /// The address and subnet mask + pub address: IpNet, + /// The address lot this address is drawn from. + pub address_lot: NameOrId, + /// The name of the interface + pub interface: Name, + /// Optional VLAN ID for this address + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vlan_id: Option, + } + + impl From<&AddressAddRemove> for AddressAddRemove { + fn from(value: &AddressAddRemove) -> Self { + value.clone() + } + } + + impl AddressAddRemove { + pub fn builder() -> builder::AddressAddRemove { + Default::default() + } + } + /// A set of addresses associated with a port configuration. /// ///
JSON schema @@ -300,15 +379,15 @@ pub mod types { } } - /// Parameters for creating an address lot block. Fist and last addresses - /// are inclusive. + /// Parameters for adding or removing an address lot block. First and last + /// addresses are inclusive. /// ///
JSON schema /// /// ```json /// { - /// "description": "Parameters for creating an address lot block. Fist and - /// last addresses are inclusive.", + /// "description": "Parameters for adding or removing an address lot block. + /// First and last addresses are inclusive.", /// "type": "object", /// "required": [ /// "first_address", @@ -332,21 +411,21 @@ pub mod types { #[derive( :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, )] - pub struct AddressLotBlockCreate { + pub struct AddressLotBlockAddRemove { /// The first address in the lot (inclusive). pub first_address: std::net::IpAddr, /// The last address in the lot (inclusive). pub last_address: std::net::IpAddr, } - impl From<&AddressLotBlockCreate> for AddressLotBlockCreate { - fn from(value: &AddressLotBlockCreate) -> Self { + impl From<&AddressLotBlockAddRemove> for AddressLotBlockAddRemove { + fn from(value: &AddressLotBlockAddRemove) -> Self { value.clone() } } - impl AddressLotBlockCreate { - pub fn builder() -> builder::AddressLotBlockCreate { + impl AddressLotBlockAddRemove { + pub fn builder() -> builder::AddressLotBlockAddRemove { Default::default() } } @@ -414,19 +493,11 @@ pub mod types { /// "description": "Parameters for creating an address lot.", /// "type": "object", /// "required": [ - /// "blocks", /// "description", /// "kind", /// "name" /// ], /// "properties": { - /// "blocks": { - /// "description": "The blocks to add along with the new address lot.", - /// "type": "array", - /// "items": { - /// "$ref": "#/components/schemas/AddressLotBlockCreate" - /// } - /// }, /// "description": { /// "type": "string" /// }, @@ -449,8 +520,6 @@ pub mod types { :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, )] pub struct AddressLotCreate { - /// The blocks to add along with the new address lot. - pub blocks: Vec, pub description: String, /// The kind of address lot to create. pub kind: AddressLotKind, @@ -480,17 +549,9 @@ pub mod types { /// creating an address lot.", /// "type": "object", /// "required": [ - /// "blocks", /// "lot" /// ], /// "properties": { - /// "blocks": { - /// "description": "The address lot blocks that were created.", - /// "type": "array", - /// "items": { - /// "$ref": "#/components/schemas/AddressLotBlock" - /// } - /// }, /// "lot": { /// "description": "The address lot that was created.", /// "allOf": [ @@ -507,8 +568,6 @@ pub mod types { :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, )] pub struct AddressLotCreateResponse { - /// The address lot blocks that were created. - pub blocks: Vec, /// The address lot that was created. pub lot: AddressLot, } @@ -825,6 +884,70 @@ pub mod types { } } + /// A prefix allowed to be imported or exported by a bgp peer + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A prefix allowed to be imported or exported by a bgp + /// peer", + /// "type": "object", + /// "required": [ + /// "interface", + /// "peer_address", + /// "prefix" + /// ], + /// "properties": { + /// "interface": { + /// "description": "The interface the peer is configured on", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// }, + /// "peer_address": { + /// "description": "An address identifying the target bgp peer", + /// "type": "string", + /// "format": "ip" + /// }, + /// "prefix": { + /// "description": "The allowed prefix to add or remove", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// ] + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct AllowedPrefixAddRemove { + /// The interface the peer is configured on + pub interface: Name, + /// An address identifying the target bgp peer + pub peer_address: std::net::IpAddr, + /// The allowed prefix to add or remove + pub prefix: IpNet, + } + + impl From<&AllowedPrefixAddRemove> for AllowedPrefixAddRemove { + fn from(value: &AllowedPrefixAddRemove) -> Self { + value.clone() + } + } + + impl AllowedPrefixAddRemove { + pub fn builder() -> builder::AllowedPrefixAddRemove { + Default::default() + } + } + /// Description of source IPs allowed to reach rack services. /// ///
JSON schema @@ -1528,6 +1651,76 @@ pub mod types { } } + /// A BGP allowed prefix entry + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A BGP allowed prefix entry", + /// "type": "object", + /// "required": [ + /// "addr", + /// "interface_name", + /// "port_settings_id", + /// "prefix" + /// ], + /// "properties": { + /// "addr": { + /// "description": "Peer Address", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// ] + /// }, + /// "interface_name": { + /// "description": "Interface peer is reachable on", + /// "type": "string" + /// }, + /// "port_settings_id": { + /// "description": "Parent switch port configuration", + /// "type": "string", + /// "format": "uuid" + /// }, + /// "prefix": { + /// "description": "Allowed Prefix", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// ] + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct BgpAllowedPrefix { + /// Peer Address + pub addr: IpNet, + /// Interface peer is reachable on + pub interface_name: String, + /// Parent switch port configuration + pub port_settings_id: uuid::Uuid, + /// Allowed Prefix + pub prefix: IpNet, + } + + impl From<&BgpAllowedPrefix> for BgpAllowedPrefix { + fn from(value: &BgpAllowedPrefix) -> Self { + value.clone() + } + } + + impl BgpAllowedPrefix { + pub fn builder() -> builder::BgpAllowedPrefix { + Default::default() + } + } + /// Represents a BGP announce set by id. The id can be used with other API /// calls to view and manage the announce set. /// @@ -1778,6 +1971,135 @@ pub mod types { } } + /// A BGP community + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A BGP community", + /// "type": "object", + /// "required": [ + /// "addr", + /// "community", + /// "interface_name", + /// "port_settings_id" + /// ], + /// "properties": { + /// "addr": { + /// "description": "Peer Address", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// ] + /// }, + /// "community": { + /// "description": "Community", + /// "type": "integer", + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "interface_name": { + /// "description": "Interface peer is reachable on", + /// "type": "string" + /// }, + /// "port_settings_id": { + /// "description": "Parent switch port configuration", + /// "type": "string", + /// "format": "uuid" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct BgpCommunity { + /// Peer Address + pub addr: IpNet, + /// Community + pub community: u32, + /// Interface peer is reachable on + pub interface_name: String, + /// Parent switch port configuration + pub port_settings_id: uuid::Uuid, + } + + impl From<&BgpCommunity> for BgpCommunity { + fn from(value: &BgpCommunity) -> Self { + value.clone() + } + } + + impl BgpCommunity { + pub fn builder() -> builder::BgpCommunity { + Default::default() + } + } + + /// A community to be added to or removed from a bgp peer + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A community to be added to or removed from a bgp peer", + /// "type": "object", + /// "required": [ + /// "community", + /// "interface", + /// "peer_address" + /// ], + /// "properties": { + /// "community": { + /// "description": "The community to add or remove", + /// "type": "integer", + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "interface": { + /// "description": "The interface the peer is configured on", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// }, + /// "peer_address": { + /// "description": "An address identifying the target bgp peer", + /// "type": "string", + /// "format": "ip" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct BgpCommunityAddRemove { + /// The community to add or remove + pub community: u32, + /// The interface the peer is configured on + pub interface: Name, + /// An address identifying the target bgp peer + pub peer_address: std::net::IpAddr, + } + + impl From<&BgpCommunityAddRemove> for BgpCommunityAddRemove { + fn from(value: &BgpCommunityAddRemove) -> Self { + value.clone() + } + } + + impl BgpCommunityAddRemove { + pub fn builder() -> builder::BgpCommunityAddRemove { + Default::default() + } + } + /// A base BGP configuration. /// ///
JSON schema @@ -2161,6 +2483,225 @@ pub mod types { } } + /// The information required to configure a BGP peer. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "The information required to configure a BGP peer.", + /// "type": "object", + /// "required": [ + /// "addr", + /// "allow_export_list_active", + /// "allow_import_list_active", + /// "bgp_config", + /// "connect_retry", + /// "delay_open", + /// "enforce_first_as", + /// "hold_time", + /// "idle_hold_time", + /// "interface_name", + /// "keepalive" + /// ], + /// "properties": { + /// "addr": { + /// "description": "The address of the host to peer with.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// ] + /// }, + /// "allow_export_list_active": { + /// "description": "Enable export policies", + /// "type": "boolean" + /// }, + /// "allow_import_list_active": { + /// "description": "Enable import policies", + /// "type": "boolean" + /// }, + /// "bgp_config": { + /// "description": "The global BGP configuration used for establishing + /// a session with this peer.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// ] + /// }, + /// "connect_retry": { + /// "description": "How long to to wait between TCP connection retries + /// (seconds).", + /// "type": "integer", + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "delay_open": { + /// "description": "How long to delay sending an open request after + /// establishing a TCP session (seconds).", + /// "type": "integer", + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "enforce_first_as": { + /// "description": "Enforce that the first AS in paths received from + /// this peer is the peer's AS.", + /// "type": "boolean" + /// }, + /// "hold_time": { + /// "description": "How long to hold peer connections between + /// keepalives (seconds).", + /// "type": "integer", + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "idle_hold_time": { + /// "description": "How long to hold this peer in idle before + /// attempting a new session (seconds).", + /// "type": "integer", + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "interface_name": { + /// "description": "The name of the interface to peer on. This is + /// relative to the port configuration this BGP peer configuration is a part + /// of. For example this value could be phy0 to refer to a primary physical + /// interface. Or it could be vlan47 to refer to a VLAN interface.", + /// "type": "string" + /// }, + /// "keepalive": { + /// "description": "How often to send keepalive requests (seconds).", + /// "type": "integer", + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "local_pref": { + /// "description": "Apply a local preference to routes received from + /// this peer.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "md5_auth_key": { + /// "description": "Use the given key for TCP-MD5 authentication with + /// this peer.", + /// "type": [ + /// "string", + /// "null" + /// ] + /// }, + /// "min_ttl": { + /// "description": "Require messages from this peer to have a minimum + /// IP time to live field.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint8", + /// "minimum": 0.0 + /// }, + /// "multi_exit_discriminator": { + /// "description": "Apply a multi-exit discriminator (MED) in updates + /// sent to this peer.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "remote_asn": { + /// "description": "Require that this peer have a specified ASN.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint32", + /// "minimum": 0.0 + /// }, + /// "vlan_id": { + /// "description": "Associate a VLAN ID with this peer.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint16", + /// "minimum": 0.0 + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct BgpPeer { + /// The address of the host to peer with. + pub addr: IpNet, + /// Enable export policies + pub allow_export_list_active: bool, + /// Enable import policies + pub allow_import_list_active: bool, + /// The global BGP configuration used for establishing a session with + /// this peer. + pub bgp_config: NameOrId, + /// How long to to wait between TCP connection retries (seconds). + pub connect_retry: u32, + /// How long to delay sending an open request after establishing a TCP + /// session (seconds). + pub delay_open: u32, + /// Enforce that the first AS in paths received from this peer is the + /// peer's AS. + pub enforce_first_as: bool, + /// How long to hold peer connections between keepalives (seconds). + pub hold_time: u32, + /// How long to hold this peer in idle before attempting a new session + /// (seconds). + pub idle_hold_time: u32, + /// The name of the interface to peer on. This is relative to the port + /// configuration this BGP peer configuration is a part of. For example + /// this value could be phy0 to refer to a primary physical interface. + /// Or it could be vlan47 to refer to a VLAN interface. + pub interface_name: String, + /// How often to send keepalive requests (seconds). + pub keepalive: u32, + /// Apply a local preference to routes received from this peer. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub local_pref: Option, + /// Use the given key for TCP-MD5 authentication with this peer. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub md5_auth_key: Option, + /// Require messages from this peer to have a minimum IP time to live + /// field. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub min_ttl: Option, + /// Apply a multi-exit discriminator (MED) in updates sent to this peer. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub multi_exit_discriminator: Option, + /// Require that this peer have a specified ASN. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub remote_asn: Option, + /// Associate a VLAN ID with this peer. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vlan_id: Option, + } + + impl From<&BgpPeer> for BgpPeer { + fn from(value: &BgpPeer) -> Self { + value.clone() + } + } + + impl BgpPeer { + pub fn builder() -> builder::BgpPeer { + Default::default() + } + } + /// A BGP peer configuration for an interface. Includes the set of /// announcements that will be advertised to the peer identified by `addr`. /// The `bgp_config` parameter is a reference to global BGP parameters. The @@ -2198,7 +2739,7 @@ pub mod types { /// "format": "ip" /// }, /// "allowed_export": { - /// "description": "Define export policy for a peer.", + /// "description": "Define export policy for this peer.", /// "allOf": [ /// { /// "$ref": "#/components/schemas/ImportExportPolicy" @@ -2206,7 +2747,7 @@ pub mod types { /// ] /// }, /// "allowed_import": { - /// "description": "Define import policy for a peer.", + /// "description": "Define import policy for this peer.", /// "allOf": [ /// { /// "$ref": "#/components/schemas/ImportExportPolicy" @@ -2224,7 +2765,7 @@ pub mod types { /// }, /// "communities": { /// "description": "Include the provided communities in updates sent to - /// the peer.", + /// this peer.", /// "type": "array", /// "items": { /// "type": "integer", @@ -2266,9 +2807,9 @@ pub mod types { /// "minimum": 0.0 /// }, /// "interface_name": { - /// "description": "The name of interface to peer on. This is relative - /// to the port configuration this BGP peer configuration is a part of. For - /// example this value could be phy0 to refer to a primary physical + /// "description": "The name of the interface to peer on. This is + /// relative to the port configuration this BGP peer configuration is a part + /// of. For example this value could be phy0 to refer to a primary physical /// interface. Or it could be vlan47 to refer to a VLAN interface.", /// "type": "string" /// }, @@ -2290,15 +2831,15 @@ pub mod types { /// }, /// "md5_auth_key": { /// "description": "Use the given key for TCP-MD5 authentication with - /// the peer.", + /// this peer.", /// "type": [ /// "string", /// "null" /// ] /// }, /// "min_ttl": { - /// "description": "Require messages from a peer have a minimum IP time - /// to live field.", + /// "description": "Require messages from this peer have a minimum IP + /// time to live field.", /// "type": [ /// "integer", /// "null" @@ -2307,8 +2848,8 @@ pub mod types { /// "minimum": 0.0 /// }, /// "multi_exit_discriminator": { - /// "description": "Apply the provided multi-exit discriminator (MED) - /// updates sent to the peer.", + /// "description": "Apply a multi-exit discriminator (MED) in updates + /// sent to this peer.", /// "type": [ /// "integer", /// "null" @@ -2317,7 +2858,7 @@ pub mod types { /// "minimum": 0.0 /// }, /// "remote_asn": { - /// "description": "Require that a peer has a specified ASN.", + /// "description": "Require that this peer has a specified ASN.", /// "type": [ /// "integer", /// "null" @@ -2326,7 +2867,7 @@ pub mod types { /// "minimum": 0.0 /// }, /// "vlan_id": { - /// "description": "Associate a VLAN ID with a peer.", + /// "description": "Associate a VLAN ID with this peer.", /// "type": [ /// "integer", /// "null" @@ -2341,17 +2882,17 @@ pub mod types { #[derive( :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, )] - pub struct BgpPeer { + pub struct BgpPeerCombined { /// The address of the host to peer with. pub addr: std::net::IpAddr, - /// Define export policy for a peer. + /// Define export policy for this peer. pub allowed_export: ImportExportPolicy, - /// Define import policy for a peer. + /// Define import policy for this peer. pub allowed_import: ImportExportPolicy, /// The global BGP configuration used for establishing a session with /// this peer. pub bgp_config: NameOrId, - /// Include the provided communities in updates sent to the peer. + /// Include the provided communities in updates sent to this peer. pub communities: Vec, /// How long to to wait between TCP connection retries (seconds). pub connect_retry: u32, @@ -2366,7 +2907,7 @@ pub mod types { /// How long to hold a peer in idle before attempting a new session /// (seconds). pub idle_hold_time: u32, - /// The name of interface to peer on. This is relative to the port + /// The name of the interface to peer on. This is relative to the port /// configuration this BGP peer configuration is a part of. For example /// this value could be phy0 to refer to a primary physical interface. /// Or it could be vlan47 to refer to a VLAN interface. @@ -2376,32 +2917,32 @@ pub mod types { /// Apply a local preference to routes received from this peer. #[serde(default, skip_serializing_if = "Option::is_none")] pub local_pref: Option, - /// Use the given key for TCP-MD5 authentication with the peer. + /// Use the given key for TCP-MD5 authentication with this peer. #[serde(default, skip_serializing_if = "Option::is_none")] pub md5_auth_key: Option, - /// Require messages from a peer have a minimum IP time to live field. + /// Require messages from this peer have a minimum IP time to live + /// field. #[serde(default, skip_serializing_if = "Option::is_none")] pub min_ttl: Option, - /// Apply the provided multi-exit discriminator (MED) updates sent to - /// the peer. + /// Apply a multi-exit discriminator (MED) in updates sent to this peer. #[serde(default, skip_serializing_if = "Option::is_none")] pub multi_exit_discriminator: Option, - /// Require that a peer has a specified ASN. + /// Require that this peer has a specified ASN. #[serde(default, skip_serializing_if = "Option::is_none")] pub remote_asn: Option, - /// Associate a VLAN ID with a peer. + /// Associate a VLAN ID with this peer. #[serde(default, skip_serializing_if = "Option::is_none")] pub vlan_id: Option, } - impl From<&BgpPeer> for BgpPeer { - fn from(value: &BgpPeer) -> Self { + impl From<&BgpPeerCombined> for BgpPeerCombined { + fn from(value: &BgpPeerCombined) -> Self { value.clone() } } - impl BgpPeer { - pub fn builder() -> builder::BgpPeer { + impl BgpPeerCombined { + pub fn builder() -> builder::BgpPeerCombined { Default::default() } } @@ -2420,7 +2961,7 @@ pub mod types { /// "peers": { /// "type": "array", /// "items": { - /// "$ref": "#/components/schemas/BgpPeer" + /// "$ref": "#/components/schemas/BgpPeerCombined" /// } /// } /// } @@ -2431,7 +2972,7 @@ pub mod types { :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, )] pub struct BgpPeerConfig { - pub peers: Vec, + pub peers: Vec, } impl From<&BgpPeerConfig> for BgpPeerConfig { @@ -2446,6 +2987,73 @@ pub mod types { } } + /// A BGP peer configuration to remove from an interface + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A BGP peer configuration to remove from an interface", + /// "type": "object", + /// "required": [ + /// "addr", + /// "bgp_config", + /// "interface_name" + /// ], + /// "properties": { + /// "addr": { + /// "description": "The address of the host to peer with.", + /// "type": "string", + /// "format": "ip" + /// }, + /// "bgp_config": { + /// "description": "The global BGP configuration used for establishing + /// a session with this peer.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// ] + /// }, + /// "interface_name": { + /// "description": "The name of the interface to peer on. This is + /// relative to the port configuration this BGP peer configuration is a part + /// of. For example this value could be phy0 to refer to a primary physical + /// interface. Or it could be vlan47 to refer to a VLAN interface.", + /// "type": "string" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct BgpPeerRemove { + /// The address of the host to peer with. + pub addr: std::net::IpAddr, + /// The global BGP configuration used for establishing a session with + /// this peer. + pub bgp_config: NameOrId, + /// The name of the interface to peer on. This is relative to the port + /// configuration this BGP peer configuration is a part of. For example + /// this value could be phy0 to refer to a primary physical interface. + /// Or it could be vlan47 to refer to a VLAN interface. + pub interface_name: String, + } + + impl From<&BgpPeerRemove> for BgpPeerRemove { + fn from(value: &BgpPeerRemove) -> Self { + value.clone() + } + } + + impl BgpPeerRemove { + pub fn builder() -> builder::BgpPeerRemove { + Default::default() + } + } + /// The current state of a BGP peer. /// ///
JSON schema @@ -16383,6 +16991,101 @@ pub mod types { } } + /// Named switch link configuration. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Named switch link configuration.", + /// "type": "object", + /// "required": [ + /// "autoneg", + /// "fec", + /// "mtu", + /// "name", + /// "speed" + /// ], + /// "properties": { + /// "autoneg": { + /// "description": "Whether or not to set autonegotiation", + /// "type": "boolean" + /// }, + /// "fec": { + /// "description": "The forward error correction mode of the link.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/LinkFec" + /// } + /// ] + /// }, + /// "lldp_config": { + /// "description": "The optional link-layer discovery protocol (LLDP) + /// configuration for the link.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// ] + /// }, + /// "mtu": { + /// "description": "Maximum transmission unit for the link.", + /// "type": "integer", + /// "format": "uint16", + /// "minimum": 0.0 + /// }, + /// "name": { + /// "description": "Name of link", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// }, + /// "speed": { + /// "description": "The speed of the link.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/LinkSpeed" + /// } + /// ] + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct NamedLinkConfigCreate { + /// Whether or not to set autonegotiation + pub autoneg: bool, + /// The forward error correction mode of the link. + pub fec: LinkFec, + /// The optional link-layer discovery protocol (LLDP) configuration for + /// the link. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lldp_config: Option, + /// Maximum transmission unit for the link. + pub mtu: u16, + /// Name of link + pub name: Name, + /// The speed of the link. + pub speed: LinkSpeed, + } + + impl From<&NamedLinkConfigCreate> for NamedLinkConfigCreate { + fn from(value: &NamedLinkConfigCreate) -> Self { + value.clone() + } + } + + impl NamedLinkConfigCreate { + pub fn builder() -> builder::NamedLinkConfigCreate { + Default::default() + } + } + /// Information required to construct a virtual network interface /// ///
JSON schema @@ -18692,7 +19395,7 @@ pub mod types { /// }, /// "rib_priority": { /// "description": "Local preference for route. Higher preference - /// indictes precedence within and across protocols.", + /// indicates precedence within and across protocols.", /// "type": [ /// "integer", /// "null" @@ -18721,7 +19424,7 @@ pub mod types { pub dst: IpNet, /// The route gateway. pub gw: std::net::IpAddr, - /// Local preference for route. Higher preference indictes precedence + /// Local preference for route. Higher preference indicates precedence /// within and across protocols. #[serde(default, skip_serializing_if = "Option::is_none")] pub rib_priority: Option, @@ -18742,6 +19445,96 @@ pub mod types { } } + /// A network route to to add to or remove from an interface. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A network route to to add to or remove from an + /// interface.", + /// "type": "object", + /// "required": [ + /// "dst", + /// "gw", + /// "interface" + /// ], + /// "properties": { + /// "dst": { + /// "description": "The route destination.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// ] + /// }, + /// "gw": { + /// "description": "The route gateway.", + /// "type": "string", + /// "format": "ip" + /// }, + /// "interface": { + /// "description": "The interface to configure the route on", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// }, + /// "rib_priority": { + /// "description": "Local preference for route. Higher preference + /// indicates precedence within and across protocols.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint8", + /// "minimum": 0.0 + /// }, + /// "vid": { + /// "description": "VLAN id the gateway is reachable over.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint16", + /// "minimum": 0.0 + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct RouteAddRemove { + /// The route destination. + pub dst: IpNet, + /// The route gateway. + pub gw: std::net::IpAddr, + /// The interface to configure the route on + pub interface: Name, + /// Local preference for route. Higher preference indicates precedence + /// within and across protocols. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rib_priority: Option, + /// VLAN id the gateway is reachable over. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vid: Option, + } + + impl From<&RouteAddRemove> for RouteAddRemove { + fn from(value: &RouteAddRemove) -> Self { + value.clone() + } + } + + impl RouteAddRemove { + pub fn builder() -> builder::RouteAddRemove { + Default::default() + } + } + /// Route configuration data associated with a switch port configuration. /// ///
JSON schema @@ -23993,7 +24786,7 @@ pub mod types { /// "description": "BGP peer settings.", /// "type": "array", /// "items": { - /// "$ref": "#/components/schemas/BgpPeer" + /// "$ref": "#/components/schemas/BgpPeerCombined" /// } /// }, /// "groups": { @@ -24066,7 +24859,7 @@ pub mod types { /// Layer 3 IP address settings. pub addresses: Vec, /// BGP peer settings. - pub bgp_peers: Vec, + pub bgp_peers: Vec, /// Switch port settings included from other switch port settings /// groups. pub groups: Vec, @@ -28121,6 +28914,91 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct AddressAddRemove { + address: Result, + address_lot: Result, + interface: Result, + vlan_id: Result, String>, + } + + impl Default for AddressAddRemove { + fn default() -> Self { + Self { + address: Err("no value supplied for address".to_string()), + address_lot: Err("no value supplied for address_lot".to_string()), + interface: Err("no value supplied for interface".to_string()), + vlan_id: Ok(Default::default()), + } + } + } + + impl AddressAddRemove { + pub fn address(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.address = value + .try_into() + .map_err(|e| format!("error converting supplied value for address: {}", e)); + self + } + pub fn address_lot(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.address_lot = value + .try_into() + .map_err(|e| format!("error converting supplied value for address_lot: {}", e)); + self + } + pub fn interface(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface = value + .try_into() + .map_err(|e| format!("error converting supplied value for interface: {}", e)); + self + } + pub fn vlan_id(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.vlan_id = value + .try_into() + .map_err(|e| format!("error converting supplied value for vlan_id: {}", e)); + self + } + } + + impl std::convert::TryFrom for super::AddressAddRemove { + type Error = super::error::ConversionError; + fn try_from(value: AddressAddRemove) -> Result { + Ok(Self { + address: value.address?, + address_lot: value.address_lot?, + interface: value.interface?, + vlan_id: value.vlan_id?, + }) + } + } + + impl From for AddressAddRemove { + fn from(value: super::AddressAddRemove) -> Self { + Self { + address: Ok(value.address), + address_lot: Ok(value.address_lot), + interface: Ok(value.interface), + vlan_id: Ok(value.vlan_id), + } + } + } + #[derive(Clone, Debug)] pub struct AddressConfig { addresses: Result, String>, @@ -28349,12 +29227,12 @@ pub mod types { } #[derive(Clone, Debug)] - pub struct AddressLotBlockCreate { + pub struct AddressLotBlockAddRemove { first_address: Result, last_address: Result, } - impl Default for AddressLotBlockCreate { + impl Default for AddressLotBlockAddRemove { fn default() -> Self { Self { first_address: Err("no value supplied for first_address".to_string()), @@ -28363,7 +29241,7 @@ pub mod types { } } - impl AddressLotBlockCreate { + impl AddressLotBlockAddRemove { pub fn first_address(mut self, value: T) -> Self where T: std::convert::TryInto, @@ -28386,10 +29264,10 @@ pub mod types { } } - impl std::convert::TryFrom for super::AddressLotBlockCreate { + impl std::convert::TryFrom for super::AddressLotBlockAddRemove { type Error = super::error::ConversionError; fn try_from( - value: AddressLotBlockCreate, + value: AddressLotBlockAddRemove, ) -> Result { Ok(Self { first_address: value.first_address?, @@ -28398,8 +29276,8 @@ pub mod types { } } - impl From for AddressLotBlockCreate { - fn from(value: super::AddressLotBlockCreate) -> Self { + impl From for AddressLotBlockAddRemove { + fn from(value: super::AddressLotBlockAddRemove) -> Self { Self { first_address: Ok(value.first_address), last_address: Ok(value.last_address), @@ -28468,7 +29346,6 @@ pub mod types { #[derive(Clone, Debug)] pub struct AddressLotCreate { - blocks: Result, String>, description: Result, kind: Result, name: Result, @@ -28477,7 +29354,6 @@ pub mod types { impl Default for AddressLotCreate { fn default() -> Self { Self { - blocks: Err("no value supplied for blocks".to_string()), description: Err("no value supplied for description".to_string()), kind: Err("no value supplied for kind".to_string()), name: Err("no value supplied for name".to_string()), @@ -28486,16 +29362,6 @@ pub mod types { } impl AddressLotCreate { - pub fn blocks(mut self, value: T) -> Self - where - T: std::convert::TryInto>, - T::Error: std::fmt::Display, - { - self.blocks = value - .try_into() - .map_err(|e| format!("error converting supplied value for blocks: {}", e)); - self - } pub fn description(mut self, value: T) -> Self where T: std::convert::TryInto, @@ -28532,7 +29398,6 @@ pub mod types { type Error = super::error::ConversionError; fn try_from(value: AddressLotCreate) -> Result { Ok(Self { - blocks: value.blocks?, description: value.description?, kind: value.kind?, name: value.name?, @@ -28543,7 +29408,6 @@ pub mod types { impl From for AddressLotCreate { fn from(value: super::AddressLotCreate) -> Self { Self { - blocks: Ok(value.blocks), description: Ok(value.description), kind: Ok(value.kind), name: Ok(value.name), @@ -28553,30 +29417,18 @@ pub mod types { #[derive(Clone, Debug)] pub struct AddressLotCreateResponse { - blocks: Result, String>, lot: Result, } impl Default for AddressLotCreateResponse { fn default() -> Self { Self { - blocks: Err("no value supplied for blocks".to_string()), lot: Err("no value supplied for lot".to_string()), } } } impl AddressLotCreateResponse { - pub fn blocks(mut self, value: T) -> Self - where - T: std::convert::TryInto>, - T::Error: std::fmt::Display, - { - self.blocks = value - .try_into() - .map_err(|e| format!("error converting supplied value for blocks: {}", e)); - self - } pub fn lot(mut self, value: T) -> Self where T: std::convert::TryInto, @@ -28594,19 +29446,13 @@ pub mod types { fn try_from( value: AddressLotCreateResponse, ) -> Result { - Ok(Self { - blocks: value.blocks?, - lot: value.lot?, - }) + Ok(Self { lot: value.lot? }) } } impl From for AddressLotCreateResponse { fn from(value: super::AddressLotCreateResponse) -> Self { - Self { - blocks: Ok(value.blocks), - lot: Ok(value.lot), - } + Self { lot: Ok(value.lot) } } } @@ -28831,6 +29677,79 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct AllowedPrefixAddRemove { + interface: Result, + peer_address: Result, + prefix: Result, + } + + impl Default for AllowedPrefixAddRemove { + fn default() -> Self { + Self { + interface: Err("no value supplied for interface".to_string()), + peer_address: Err("no value supplied for peer_address".to_string()), + prefix: Err("no value supplied for prefix".to_string()), + } + } + } + + impl AllowedPrefixAddRemove { + pub fn interface(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface = value + .try_into() + .map_err(|e| format!("error converting supplied value for interface: {}", e)); + self + } + pub fn peer_address(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.peer_address = value.try_into().map_err(|e| { + format!("error converting supplied value for peer_address: {}", e) + }); + self + } + pub fn prefix(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.prefix = value + .try_into() + .map_err(|e| format!("error converting supplied value for prefix: {}", e)); + self + } + } + + impl std::convert::TryFrom for super::AllowedPrefixAddRemove { + type Error = super::error::ConversionError; + fn try_from( + value: AllowedPrefixAddRemove, + ) -> Result { + Ok(Self { + interface: value.interface?, + peer_address: value.peer_address?, + prefix: value.prefix?, + }) + } + } + + impl From for AllowedPrefixAddRemove { + fn from(value: super::AllowedPrefixAddRemove) -> Self { + Self { + interface: Ok(value.interface), + peer_address: Ok(value.peer_address), + prefix: Ok(value.prefix), + } + } + } + #[derive(Clone, Debug)] pub struct Baseboard { part: Result, @@ -29209,6 +30128,94 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct BgpAllowedPrefix { + addr: Result, + interface_name: Result, + port_settings_id: Result, + prefix: Result, + } + + impl Default for BgpAllowedPrefix { + fn default() -> Self { + Self { + addr: Err("no value supplied for addr".to_string()), + interface_name: Err("no value supplied for interface_name".to_string()), + port_settings_id: Err("no value supplied for port_settings_id".to_string()), + prefix: Err("no value supplied for prefix".to_string()), + } + } + } + + impl BgpAllowedPrefix { + pub fn addr(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.addr = value + .try_into() + .map_err(|e| format!("error converting supplied value for addr: {}", e)); + self + } + pub fn interface_name(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface_name = value.try_into().map_err(|e| { + format!("error converting supplied value for interface_name: {}", e) + }); + self + } + pub fn port_settings_id(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.port_settings_id = value.try_into().map_err(|e| { + format!( + "error converting supplied value for port_settings_id: {}", + e + ) + }); + self + } + pub fn prefix(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.prefix = value + .try_into() + .map_err(|e| format!("error converting supplied value for prefix: {}", e)); + self + } + } + + impl std::convert::TryFrom for super::BgpAllowedPrefix { + type Error = super::error::ConversionError; + fn try_from(value: BgpAllowedPrefix) -> Result { + Ok(Self { + addr: value.addr?, + interface_name: value.interface_name?, + port_settings_id: value.port_settings_id?, + prefix: value.prefix?, + }) + } + } + + impl From for BgpAllowedPrefix { + fn from(value: super::BgpAllowedPrefix) -> Self { + Self { + addr: Ok(value.addr), + interface_name: Ok(value.interface_name), + port_settings_id: Ok(value.port_settings_id), + prefix: Ok(value.prefix), + } + } + } + #[derive(Clone, Debug)] pub struct BgpAnnounceSet { description: Result, @@ -29519,6 +30526,167 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct BgpCommunity { + addr: Result, + community: Result, + interface_name: Result, + port_settings_id: Result, + } + + impl Default for BgpCommunity { + fn default() -> Self { + Self { + addr: Err("no value supplied for addr".to_string()), + community: Err("no value supplied for community".to_string()), + interface_name: Err("no value supplied for interface_name".to_string()), + port_settings_id: Err("no value supplied for port_settings_id".to_string()), + } + } + } + + impl BgpCommunity { + pub fn addr(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.addr = value + .try_into() + .map_err(|e| format!("error converting supplied value for addr: {}", e)); + self + } + pub fn community(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.community = value + .try_into() + .map_err(|e| format!("error converting supplied value for community: {}", e)); + self + } + pub fn interface_name(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface_name = value.try_into().map_err(|e| { + format!("error converting supplied value for interface_name: {}", e) + }); + self + } + pub fn port_settings_id(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.port_settings_id = value.try_into().map_err(|e| { + format!( + "error converting supplied value for port_settings_id: {}", + e + ) + }); + self + } + } + + impl std::convert::TryFrom for super::BgpCommunity { + type Error = super::error::ConversionError; + fn try_from(value: BgpCommunity) -> Result { + Ok(Self { + addr: value.addr?, + community: value.community?, + interface_name: value.interface_name?, + port_settings_id: value.port_settings_id?, + }) + } + } + + impl From for BgpCommunity { + fn from(value: super::BgpCommunity) -> Self { + Self { + addr: Ok(value.addr), + community: Ok(value.community), + interface_name: Ok(value.interface_name), + port_settings_id: Ok(value.port_settings_id), + } + } + } + + #[derive(Clone, Debug)] + pub struct BgpCommunityAddRemove { + community: Result, + interface: Result, + peer_address: Result, + } + + impl Default for BgpCommunityAddRemove { + fn default() -> Self { + Self { + community: Err("no value supplied for community".to_string()), + interface: Err("no value supplied for interface".to_string()), + peer_address: Err("no value supplied for peer_address".to_string()), + } + } + } + + impl BgpCommunityAddRemove { + pub fn community(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.community = value + .try_into() + .map_err(|e| format!("error converting supplied value for community: {}", e)); + self + } + pub fn interface(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface = value + .try_into() + .map_err(|e| format!("error converting supplied value for interface: {}", e)); + self + } + pub fn peer_address(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.peer_address = value.try_into().map_err(|e| { + format!("error converting supplied value for peer_address: {}", e) + }); + self + } + } + + impl std::convert::TryFrom for super::BgpCommunityAddRemove { + type Error = super::error::ConversionError; + fn try_from( + value: BgpCommunityAddRemove, + ) -> Result { + Ok(Self { + community: value.community?, + interface: value.interface?, + peer_address: value.peer_address?, + }) + } + } + + impl From for BgpCommunityAddRemove { + fn from(value: super::BgpCommunityAddRemove) -> Self { + Self { + community: Ok(value.community), + interface: Ok(value.interface), + peer_address: Ok(value.peer_address), + } + } + } + #[derive(Clone, Debug)] pub struct BgpConfig { asn: Result, @@ -29941,6 +31109,289 @@ pub mod types { #[derive(Clone, Debug)] pub struct BgpPeer { + addr: Result, + allow_export_list_active: Result, + allow_import_list_active: Result, + bgp_config: Result, + connect_retry: Result, + delay_open: Result, + enforce_first_as: Result, + hold_time: Result, + idle_hold_time: Result, + interface_name: Result, + keepalive: Result, + local_pref: Result, String>, + md5_auth_key: Result, String>, + min_ttl: Result, String>, + multi_exit_discriminator: Result, String>, + remote_asn: Result, String>, + vlan_id: Result, String>, + } + + impl Default for BgpPeer { + fn default() -> Self { + Self { + addr: Err("no value supplied for addr".to_string()), + allow_export_list_active: Err( + "no value supplied for allow_export_list_active".to_string() + ), + allow_import_list_active: Err( + "no value supplied for allow_import_list_active".to_string() + ), + bgp_config: Err("no value supplied for bgp_config".to_string()), + connect_retry: Err("no value supplied for connect_retry".to_string()), + delay_open: Err("no value supplied for delay_open".to_string()), + enforce_first_as: Err("no value supplied for enforce_first_as".to_string()), + hold_time: Err("no value supplied for hold_time".to_string()), + idle_hold_time: Err("no value supplied for idle_hold_time".to_string()), + interface_name: Err("no value supplied for interface_name".to_string()), + keepalive: Err("no value supplied for keepalive".to_string()), + local_pref: Ok(Default::default()), + md5_auth_key: Ok(Default::default()), + min_ttl: Ok(Default::default()), + multi_exit_discriminator: Ok(Default::default()), + remote_asn: Ok(Default::default()), + vlan_id: Ok(Default::default()), + } + } + } + + impl BgpPeer { + pub fn addr(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.addr = value + .try_into() + .map_err(|e| format!("error converting supplied value for addr: {}", e)); + self + } + pub fn allow_export_list_active(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.allow_export_list_active = value.try_into().map_err(|e| { + format!( + "error converting supplied value for allow_export_list_active: {}", + e + ) + }); + self + } + pub fn allow_import_list_active(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.allow_import_list_active = value.try_into().map_err(|e| { + format!( + "error converting supplied value for allow_import_list_active: {}", + e + ) + }); + self + } + pub fn bgp_config(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.bgp_config = value + .try_into() + .map_err(|e| format!("error converting supplied value for bgp_config: {}", e)); + self + } + pub fn connect_retry(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.connect_retry = value.try_into().map_err(|e| { + format!("error converting supplied value for connect_retry: {}", e) + }); + self + } + pub fn delay_open(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.delay_open = value + .try_into() + .map_err(|e| format!("error converting supplied value for delay_open: {}", e)); + self + } + pub fn enforce_first_as(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.enforce_first_as = value.try_into().map_err(|e| { + format!( + "error converting supplied value for enforce_first_as: {}", + e + ) + }); + self + } + pub fn hold_time(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.hold_time = value + .try_into() + .map_err(|e| format!("error converting supplied value for hold_time: {}", e)); + self + } + pub fn idle_hold_time(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.idle_hold_time = value.try_into().map_err(|e| { + format!("error converting supplied value for idle_hold_time: {}", e) + }); + self + } + pub fn interface_name(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface_name = value.try_into().map_err(|e| { + format!("error converting supplied value for interface_name: {}", e) + }); + self + } + pub fn keepalive(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.keepalive = value + .try_into() + .map_err(|e| format!("error converting supplied value for keepalive: {}", e)); + self + } + pub fn local_pref(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.local_pref = value + .try_into() + .map_err(|e| format!("error converting supplied value for local_pref: {}", e)); + self + } + pub fn md5_auth_key(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.md5_auth_key = value.try_into().map_err(|e| { + format!("error converting supplied value for md5_auth_key: {}", e) + }); + self + } + pub fn min_ttl(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.min_ttl = value + .try_into() + .map_err(|e| format!("error converting supplied value for min_ttl: {}", e)); + self + } + pub fn multi_exit_discriminator(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.multi_exit_discriminator = value.try_into().map_err(|e| { + format!( + "error converting supplied value for multi_exit_discriminator: {}", + e + ) + }); + self + } + pub fn remote_asn(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.remote_asn = value + .try_into() + .map_err(|e| format!("error converting supplied value for remote_asn: {}", e)); + self + } + pub fn vlan_id(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.vlan_id = value + .try_into() + .map_err(|e| format!("error converting supplied value for vlan_id: {}", e)); + self + } + } + + impl std::convert::TryFrom for super::BgpPeer { + type Error = super::error::ConversionError; + fn try_from(value: BgpPeer) -> Result { + Ok(Self { + addr: value.addr?, + allow_export_list_active: value.allow_export_list_active?, + allow_import_list_active: value.allow_import_list_active?, + bgp_config: value.bgp_config?, + connect_retry: value.connect_retry?, + delay_open: value.delay_open?, + enforce_first_as: value.enforce_first_as?, + hold_time: value.hold_time?, + idle_hold_time: value.idle_hold_time?, + interface_name: value.interface_name?, + keepalive: value.keepalive?, + local_pref: value.local_pref?, + md5_auth_key: value.md5_auth_key?, + min_ttl: value.min_ttl?, + multi_exit_discriminator: value.multi_exit_discriminator?, + remote_asn: value.remote_asn?, + vlan_id: value.vlan_id?, + }) + } + } + + impl From for BgpPeer { + fn from(value: super::BgpPeer) -> Self { + Self { + addr: Ok(value.addr), + allow_export_list_active: Ok(value.allow_export_list_active), + allow_import_list_active: Ok(value.allow_import_list_active), + bgp_config: Ok(value.bgp_config), + connect_retry: Ok(value.connect_retry), + delay_open: Ok(value.delay_open), + enforce_first_as: Ok(value.enforce_first_as), + hold_time: Ok(value.hold_time), + idle_hold_time: Ok(value.idle_hold_time), + interface_name: Ok(value.interface_name), + keepalive: Ok(value.keepalive), + local_pref: Ok(value.local_pref), + md5_auth_key: Ok(value.md5_auth_key), + min_ttl: Ok(value.min_ttl), + multi_exit_discriminator: Ok(value.multi_exit_discriminator), + remote_asn: Ok(value.remote_asn), + vlan_id: Ok(value.vlan_id), + } + } + } + + #[derive(Clone, Debug)] + pub struct BgpPeerCombined { addr: Result, allowed_export: Result, allowed_import: Result, @@ -29961,7 +31412,7 @@ pub mod types { vlan_id: Result, String>, } - impl Default for BgpPeer { + impl Default for BgpPeerCombined { fn default() -> Self { Self { addr: Err("no value supplied for addr".to_string()), @@ -29986,7 +31437,7 @@ pub mod types { } } - impl BgpPeer { + impl BgpPeerCombined { pub fn addr(mut self, value: T) -> Self where T: std::convert::TryInto, @@ -30175,9 +31626,9 @@ pub mod types { } } - impl std::convert::TryFrom for super::BgpPeer { + impl std::convert::TryFrom for super::BgpPeerCombined { type Error = super::error::ConversionError; - fn try_from(value: BgpPeer) -> Result { + fn try_from(value: BgpPeerCombined) -> Result { Ok(Self { addr: value.addr?, allowed_export: value.allowed_export?, @@ -30201,8 +31652,8 @@ pub mod types { } } - impl From for BgpPeer { - fn from(value: super::BgpPeer) -> Self { + impl From for BgpPeerCombined { + fn from(value: super::BgpPeerCombined) -> Self { Self { addr: Ok(value.addr), allowed_export: Ok(value.allowed_export), @@ -30228,7 +31679,7 @@ pub mod types { #[derive(Clone, Debug)] pub struct BgpPeerConfig { - peers: Result, String>, + peers: Result, String>, } impl Default for BgpPeerConfig { @@ -30242,7 +31693,7 @@ pub mod types { impl BgpPeerConfig { pub fn peers(mut self, value: T) -> Self where - T: std::convert::TryInto>, + T: std::convert::TryInto>, T::Error: std::fmt::Display, { self.peers = value @@ -30269,6 +31720,77 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct BgpPeerRemove { + addr: Result, + bgp_config: Result, + interface_name: Result, + } + + impl Default for BgpPeerRemove { + fn default() -> Self { + Self { + addr: Err("no value supplied for addr".to_string()), + bgp_config: Err("no value supplied for bgp_config".to_string()), + interface_name: Err("no value supplied for interface_name".to_string()), + } + } + } + + impl BgpPeerRemove { + pub fn addr(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.addr = value + .try_into() + .map_err(|e| format!("error converting supplied value for addr: {}", e)); + self + } + pub fn bgp_config(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.bgp_config = value + .try_into() + .map_err(|e| format!("error converting supplied value for bgp_config: {}", e)); + self + } + pub fn interface_name(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface_name = value.try_into().map_err(|e| { + format!("error converting supplied value for interface_name: {}", e) + }); + self + } + } + + impl std::convert::TryFrom for super::BgpPeerRemove { + type Error = super::error::ConversionError; + fn try_from(value: BgpPeerRemove) -> Result { + Ok(Self { + addr: value.addr?, + bgp_config: value.bgp_config?, + interface_name: value.interface_name?, + }) + } + } + + impl From for BgpPeerRemove { + fn from(value: super::BgpPeerRemove) -> Self { + Self { + addr: Ok(value.addr), + bgp_config: Ok(value.bgp_config), + interface_name: Ok(value.interface_name), + } + } + } + #[derive(Clone, Debug)] pub struct BgpPeerStatus { addr: Result, @@ -39336,6 +40858,121 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct NamedLinkConfigCreate { + autoneg: Result, + fec: Result, + lldp_config: Result, String>, + mtu: Result, + name: Result, + speed: Result, + } + + impl Default for NamedLinkConfigCreate { + fn default() -> Self { + Self { + autoneg: Err("no value supplied for autoneg".to_string()), + fec: Err("no value supplied for fec".to_string()), + lldp_config: Ok(Default::default()), + mtu: Err("no value supplied for mtu".to_string()), + name: Err("no value supplied for name".to_string()), + speed: Err("no value supplied for speed".to_string()), + } + } + } + + impl NamedLinkConfigCreate { + pub fn autoneg(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.autoneg = value + .try_into() + .map_err(|e| format!("error converting supplied value for autoneg: {}", e)); + self + } + pub fn fec(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.fec = value + .try_into() + .map_err(|e| format!("error converting supplied value for fec: {}", e)); + self + } + pub fn lldp_config(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.lldp_config = value + .try_into() + .map_err(|e| format!("error converting supplied value for lldp_config: {}", e)); + self + } + pub fn mtu(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.mtu = value + .try_into() + .map_err(|e| format!("error converting supplied value for mtu: {}", e)); + self + } + pub fn name(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.name = value + .try_into() + .map_err(|e| format!("error converting supplied value for name: {}", e)); + self + } + pub fn speed(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.speed = value + .try_into() + .map_err(|e| format!("error converting supplied value for speed: {}", e)); + self + } + } + + impl std::convert::TryFrom for super::NamedLinkConfigCreate { + type Error = super::error::ConversionError; + fn try_from( + value: NamedLinkConfigCreate, + ) -> Result { + Ok(Self { + autoneg: value.autoneg?, + fec: value.fec?, + lldp_config: value.lldp_config?, + mtu: value.mtu?, + name: value.name?, + speed: value.speed?, + }) + } + } + + impl From for NamedLinkConfigCreate { + fn from(value: super::NamedLinkConfigCreate) -> Self { + Self { + autoneg: Ok(value.autoneg), + fec: Ok(value.fec), + lldp_config: Ok(value.lldp_config), + mtu: Ok(value.mtu), + name: Ok(value.name), + speed: Ok(value.speed), + } + } + } + #[derive(Clone, Debug)] pub struct NetworkInterface { id: Result, @@ -41140,6 +42777,105 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct RouteAddRemove { + dst: Result, + gw: Result, + interface: Result, + rib_priority: Result, String>, + vid: Result, String>, + } + + impl Default for RouteAddRemove { + fn default() -> Self { + Self { + dst: Err("no value supplied for dst".to_string()), + gw: Err("no value supplied for gw".to_string()), + interface: Err("no value supplied for interface".to_string()), + rib_priority: Ok(Default::default()), + vid: Ok(Default::default()), + } + } + } + + impl RouteAddRemove { + pub fn dst(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.dst = value + .try_into() + .map_err(|e| format!("error converting supplied value for dst: {}", e)); + self + } + pub fn gw(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.gw = value + .try_into() + .map_err(|e| format!("error converting supplied value for gw: {}", e)); + self + } + pub fn interface(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.interface = value + .try_into() + .map_err(|e| format!("error converting supplied value for interface: {}", e)); + self + } + pub fn rib_priority(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.rib_priority = value.try_into().map_err(|e| { + format!("error converting supplied value for rib_priority: {}", e) + }); + self + } + pub fn vid(mut self, value: T) -> Self + where + T: std::convert::TryInto>, + T::Error: std::fmt::Display, + { + self.vid = value + .try_into() + .map_err(|e| format!("error converting supplied value for vid: {}", e)); + self + } + } + + impl std::convert::TryFrom for super::RouteAddRemove { + type Error = super::error::ConversionError; + fn try_from(value: RouteAddRemove) -> Result { + Ok(Self { + dst: value.dst?, + gw: value.gw?, + interface: value.interface?, + rib_priority: value.rib_priority?, + vid: value.vid?, + }) + } + } + + impl From for RouteAddRemove { + fn from(value: super::RouteAddRemove) -> Self { + Self { + dst: Ok(value.dst), + gw: Ok(value.gw), + interface: Ok(value.interface), + rib_priority: Ok(value.rib_priority), + vid: Ok(value.vid), + } + } + } + #[derive(Clone, Debug)] pub struct RouteConfig { routes: Result, String>, @@ -45567,7 +47303,7 @@ pub mod types { #[derive(Clone, Debug)] pub struct SwitchPortSettingsView { addresses: Result, String>, - bgp_peers: Result, String>, + bgp_peers: Result, String>, groups: Result, String>, interfaces: Result, String>, link_lldp: Result, String>, @@ -45608,7 +47344,7 @@ pub mod types { } pub fn bgp_peers(mut self, value: T) -> Self where - T: std::convert::TryInto>, + T: std::convert::TryInto>, T::Error: std::fmt::Display, { self.bgp_peers = value @@ -50680,6 +52416,71 @@ pub trait ClientSystemHardwareExt { /// .await; /// ``` fn rack_view(&self) -> builder::RackView; + /// View switch port configuration + /// + /// Sends a `GET` request to + /// `/v1/system/hardware/racks/{rack_id}/switch/{switch}/switch-port/{port}/ + /// configuration` + /// + /// Arguments: + /// - `rack_id`: A rack id to use when selecting switch ports. + /// - `switch`: A switch location to use when selecting switch ports. + /// - `port`: A name to use when selecting switch ports. + /// ```ignore + /// let response = client.networking_switch_port_active_configuration_view() + /// .rack_id(rack_id) + /// .switch(switch) + /// .port(port) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_active_configuration_view( + &self, + ) -> builder::NetworkingSwitchPortActiveConfigurationView; + /// Set switch port configuration + /// + /// Sends a `PUT` request to + /// `/v1/system/hardware/racks/{rack_id}/switch/{switch}/switch-port/{port}/ + /// configuration` + /// + /// Arguments: + /// - `rack_id`: A rack id to use when selecting switch ports. + /// - `switch`: A switch location to use when selecting switch ports. + /// - `port`: A name to use when selecting switch ports. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_active_configuration_set() + /// .rack_id(rack_id) + /// .switch(switch) + /// .port(port) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_active_configuration_set( + &self, + ) -> builder::NetworkingSwitchPortActiveConfigurationSet; + /// Clear switch port configuration + /// + /// Sends a `DELETE` request to + /// `/v1/system/hardware/racks/{rack_id}/switch/{switch}/switch-port/{port}/ + /// configuration` + /// + /// Arguments: + /// - `rack_id`: A rack id to use when selecting switch ports. + /// - `switch`: A switch location to use when selecting switch ports. + /// - `port`: A name to use when selecting switch ports. + /// ```ignore + /// let response = client.networking_switch_port_active_configuration_clear() + /// .rack_id(rack_id) + /// .switch(switch) + /// .port(port) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_active_configuration_clear( + &self, + ) -> builder::NetworkingSwitchPortActiveConfigurationClear; /// List sleds /// /// Sends a `GET` request to `/v1/system/hardware/sleds` @@ -50923,6 +52724,24 @@ impl ClientSystemHardwareExt for Client { builder::RackView::new(self) } + fn networking_switch_port_active_configuration_view( + &self, + ) -> builder::NetworkingSwitchPortActiveConfigurationView { + builder::NetworkingSwitchPortActiveConfigurationView::new(self) + } + + fn networking_switch_port_active_configuration_set( + &self, + ) -> builder::NetworkingSwitchPortActiveConfigurationSet { + builder::NetworkingSwitchPortActiveConfigurationSet::new(self) + } + + fn networking_switch_port_active_configuration_clear( + &self, + ) -> builder::NetworkingSwitchPortActiveConfigurationClear { + builder::NetworkingSwitchPortActiveConfigurationClear::new(self) + } + fn sled_list(&self) -> builder::SledList { builder::SledList::new(self) } @@ -51418,6 +53237,38 @@ pub trait ClientSystemNetworkingExt { /// .await; /// ``` fn networking_address_lot_block_list(&self) -> builder::NetworkingAddressLotBlockList; + /// Add block to address lot + /// + /// Sends a `POST` request to + /// `/v1/system/networking/address-lot/{address_lot}/blocks/add` + /// + /// Arguments: + /// - `address_lot`: Name or ID of the address lot + /// - `body` + /// ```ignore + /// let response = client.networking_address_lot_block_add() + /// .address_lot(address_lot) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_address_lot_block_add(&self) -> builder::NetworkingAddressLotBlockAdd; + /// Remove block from address lot + /// + /// Sends a `POST` request to + /// `/v1/system/networking/address-lot/{address_lot}/blocks/remove` + /// + /// Arguments: + /// - `address_lot`: Name or ID of the address lot + /// - `body` + /// ```ignore + /// let response = client.networking_address_lot_block_remove() + /// .address_lot(address_lot) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_address_lot_block_remove(&self) -> builder::NetworkingAddressLotBlockRemove; /// Get user-facing services IP allowlist /// /// Sends a `GET` request to `/v1/system/networking/allow-list` @@ -51502,13 +53353,13 @@ pub trait ClientSystemNetworkingExt { fn networking_bgp_config_create(&self) -> builder::NetworkingBgpConfigCreate; /// Delete BGP configuration /// - /// Sends a `DELETE` request to `/v1/system/networking/bgp` + /// Sends a `DELETE` request to `/v1/system/networking/bgp/{bgp_config}` /// /// Arguments: - /// - `name_or_id`: A name or id to use when selecting BGP config. + /// - `bgp_config`: A name or id to use when selecting BGP config. /// ```ignore /// let response = client.networking_bgp_config_delete() - /// .name_or_id(name_or_id) + /// .bgp_config(bgp_config) /// .send() /// .await; /// ``` @@ -51674,67 +53525,543 @@ pub trait ClientSystemNetworkingExt { fn networking_loopback_address_delete(&self) -> builder::NetworkingLoopbackAddressDelete; /// List switch port settings /// - /// Sends a `GET` request to `/v1/system/networking/switch-port-settings` + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration` /// /// Arguments: + /// - `configuration`: An optional name or id to use when selecting a switch + /// port configuration. /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - /// - `port_settings`: An optional name or id to use when selecting port - /// settings. /// - `sort_by` /// ```ignore - /// let response = client.networking_switch_port_settings_list() + /// let response = client.networking_switch_port_configuration_list() + /// .configuration(configuration) /// .limit(limit) /// .page_token(page_token) - /// .port_settings(port_settings) /// .sort_by(sort_by) /// .send() /// .await; /// ``` - fn networking_switch_port_settings_list(&self) -> builder::NetworkingSwitchPortSettingsList; + fn networking_switch_port_configuration_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationList; /// Create switch port settings /// - /// Sends a `POST` request to `/v1/system/networking/switch-port-settings` + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration` /// /// ```ignore - /// let response = client.networking_switch_port_settings_create() + /// let response = client.networking_switch_port_configuration_create() /// .body(body) /// .send() /// .await; /// ``` - fn networking_switch_port_settings_create(&self) - -> builder::NetworkingSwitchPortSettingsCreate; + fn networking_switch_port_configuration_create( + &self, + ) -> builder::NetworkingSwitchPortConfigurationCreate; + /// View a switch port configuration + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// ```ignore + /// let response = client.networking_switch_port_configuration_view() + /// .configuration(configuration) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_view( + &self, + ) -> builder::NetworkingSwitchPortConfigurationView; /// Delete switch port settings /// - /// Sends a `DELETE` request to `/v1/system/networking/switch-port-settings` + /// Sends a `DELETE` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}` /// /// Arguments: - /// - `port_settings`: An optional name or id to use when selecting port - /// settings. + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. /// ```ignore - /// let response = client.networking_switch_port_settings_delete() - /// .port_settings(port_settings) + /// let response = client.networking_switch_port_configuration_delete() + /// .configuration(configuration) /// .send() /// .await; /// ``` - fn networking_switch_port_settings_delete(&self) - -> builder::NetworkingSwitchPortSettingsDelete; - /// Get information about switch port + fn networking_switch_port_configuration_delete( + &self, + ) -> builder::NetworkingSwitchPortConfigurationDelete; + /// List addresses assigned to a provided interface configuration /// /// Sends a `GET` request to - /// `/v1/system/networking/switch-port-settings/{port}` + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// address` /// /// Arguments: - /// - `port`: A name or id to use when selecting switch port settings info - /// objects. + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. /// ```ignore - /// let response = client.networking_switch_port_settings_view() - /// .port(port) + /// let response = client.networking_switch_port_configuration_address_list() + /// .configuration(configuration) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_address_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationAddressList; + /// Add address to an interface configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// address/add` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_address_add() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_address_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationAddressAdd; + /// Remove address from an interface configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// address/remove` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_address_remove() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_address_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationAddressRemove; + /// List bgp peers assigned to a provided interface configuration + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_list() + /// .configuration(configuration) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerList; + /// Add bgp peer to an interface configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/add` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_add() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAdd; + /// List prefixes allowed to be exported by a given bgp peer + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-export` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `peer_address`: An address identifying a configured bgp peer. + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_allow_export_list() + /// .configuration(configuration) + /// .peer_address(peer_address) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_allow_export_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportList; + /// Add prefix to bgp peer allowed export list + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-export/add` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_allow_export_add() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_allow_export_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd; + /// Remove prefix from bgp peer allowed export list + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-export/remove` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_allow_export_remove() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_allow_export_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove; + /// List prefixes allowed to be imported by a given bgp peer + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-import` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `peer_address`: An address identifying a configured bgp peer. + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_allow_import_list() + /// .configuration(configuration) + /// .peer_address(peer_address) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_allow_import_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportList; + /// Add prefix to bgp peer allowed import list + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-import/add` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_allow_import_add() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_allow_import_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd; + /// Remove prefix from bgp peer allowed import list + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-import/remove` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_allow_import_remove() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_allow_import_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove; + /// List communities assigned to a bgp peer + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/community` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `peer_address`: An address identifying a configured bgp peer. + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_community_list() + /// .configuration(configuration) + /// .peer_address(peer_address) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_community_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerCommunityList; + /// Add community to bgp peer + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/community/add` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_community_add() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_community_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd; + /// Remove community from bgp peer + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/community/remove` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_community_remove() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_community_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove; + /// Remove bgp peer from an interface configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/remove` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_bgp_peer_remove() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_bgp_peer_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerRemove; + /// Get switch port geometry for a provided switch port configuration + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// geometry` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// ```ignore + /// let response = client.networking_switch_port_configuration_geometry_view() + /// .configuration(configuration) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_geometry_view( + &self, + ) -> builder::NetworkingSwitchPortConfigurationGeometryView; + /// Set switch port geometry for a provided switch port configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// geometry` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_geometry_set() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_geometry_set( + &self, + ) -> builder::NetworkingSwitchPortConfigurationGeometrySet; + /// List links for a provided switch port configuration + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/link` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// ```ignore + /// let response = client.networking_switch_port_configuration_link_list() + /// .configuration(configuration) /// .send() /// .await; /// ``` - fn networking_switch_port_settings_view(&self) -> builder::NetworkingSwitchPortSettingsView; + fn networking_switch_port_configuration_link_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkList; + /// Create a link for a provided switch port configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/link` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_link_create() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_link_create( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkCreate; + /// View a link for a provided switch port configuration + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/link/ + /// {link}` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `link`: Link name + /// ```ignore + /// let response = client.networking_switch_port_configuration_link_view() + /// .configuration(configuration) + /// .link(link) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_link_view( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkView; + /// Delete a link for a provided switch port configuration + /// + /// Sends a `DELETE` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/link/ + /// {link}` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `link`: Link name + /// ```ignore + /// let response = client.networking_switch_port_configuration_link_delete() + /// .configuration(configuration) + /// .link(link) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_link_delete( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkDelete; + /// List routes assigned to a provided interface configuration + /// + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/route` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// ```ignore + /// let response = client.networking_switch_port_configuration_route_list() + /// .configuration(configuration) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_route_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationRouteList; + /// Add route to an interface configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/route/ + /// add` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_route_add() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_route_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationRouteAdd; + /// Remove route from an interface configuration + /// + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/route/ + /// remove` + /// + /// Arguments: + /// - `configuration`: A name or id to use when selecting a switch port + /// configuration. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_configuration_route_remove() + /// .configuration(configuration) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_configuration_route_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationRouteRemove; } impl ClientSystemNetworkingExt for Client { @@ -51754,6 +54081,14 @@ impl ClientSystemNetworkingExt for Client { builder::NetworkingAddressLotBlockList::new(self) } + fn networking_address_lot_block_add(&self) -> builder::NetworkingAddressLotBlockAdd { + builder::NetworkingAddressLotBlockAdd::new(self) + } + + fn networking_address_lot_block_remove(&self) -> builder::NetworkingAddressLotBlockRemove { + builder::NetworkingAddressLotBlockRemove::new(self) + } + fn networking_allow_list_view(&self) -> builder::NetworkingAllowListView { builder::NetworkingAllowListView::new(self) } @@ -51830,24 +54165,172 @@ impl ClientSystemNetworkingExt for Client { builder::NetworkingLoopbackAddressDelete::new(self) } - fn networking_switch_port_settings_list(&self) -> builder::NetworkingSwitchPortSettingsList { - builder::NetworkingSwitchPortSettingsList::new(self) + fn networking_switch_port_configuration_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationList { + builder::NetworkingSwitchPortConfigurationList::new(self) + } + + fn networking_switch_port_configuration_create( + &self, + ) -> builder::NetworkingSwitchPortConfigurationCreate { + builder::NetworkingSwitchPortConfigurationCreate::new(self) + } + + fn networking_switch_port_configuration_view( + &self, + ) -> builder::NetworkingSwitchPortConfigurationView { + builder::NetworkingSwitchPortConfigurationView::new(self) + } + + fn networking_switch_port_configuration_delete( + &self, + ) -> builder::NetworkingSwitchPortConfigurationDelete { + builder::NetworkingSwitchPortConfigurationDelete::new(self) + } + + fn networking_switch_port_configuration_address_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationAddressList { + builder::NetworkingSwitchPortConfigurationAddressList::new(self) + } + + fn networking_switch_port_configuration_address_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationAddressAdd { + builder::NetworkingSwitchPortConfigurationAddressAdd::new(self) + } + + fn networking_switch_port_configuration_address_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationAddressRemove { + builder::NetworkingSwitchPortConfigurationAddressRemove::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerList { + builder::NetworkingSwitchPortConfigurationBgpPeerList::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAdd { + builder::NetworkingSwitchPortConfigurationBgpPeerAdd::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_allow_export_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportList { + builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportList::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_allow_export_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd { + builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_allow_export_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove { + builder::NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_allow_import_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportList { + builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportList::new(self) } - fn networking_switch_port_settings_create( + fn networking_switch_port_configuration_bgp_peer_allow_import_add( &self, - ) -> builder::NetworkingSwitchPortSettingsCreate { - builder::NetworkingSwitchPortSettingsCreate::new(self) + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd { + builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd::new(self) } - fn networking_switch_port_settings_delete( + fn networking_switch_port_configuration_bgp_peer_allow_import_remove( &self, - ) -> builder::NetworkingSwitchPortSettingsDelete { - builder::NetworkingSwitchPortSettingsDelete::new(self) + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove { + builder::NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove::new(self) } - fn networking_switch_port_settings_view(&self) -> builder::NetworkingSwitchPortSettingsView { - builder::NetworkingSwitchPortSettingsView::new(self) + fn networking_switch_port_configuration_bgp_peer_community_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerCommunityList { + builder::NetworkingSwitchPortConfigurationBgpPeerCommunityList::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_community_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd { + builder::NetworkingSwitchPortConfigurationBgpPeerCommunityAdd::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_community_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove { + builder::NetworkingSwitchPortConfigurationBgpPeerCommunityRemove::new(self) + } + + fn networking_switch_port_configuration_bgp_peer_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationBgpPeerRemove { + builder::NetworkingSwitchPortConfigurationBgpPeerRemove::new(self) + } + + fn networking_switch_port_configuration_geometry_view( + &self, + ) -> builder::NetworkingSwitchPortConfigurationGeometryView { + builder::NetworkingSwitchPortConfigurationGeometryView::new(self) + } + + fn networking_switch_port_configuration_geometry_set( + &self, + ) -> builder::NetworkingSwitchPortConfigurationGeometrySet { + builder::NetworkingSwitchPortConfigurationGeometrySet::new(self) + } + + fn networking_switch_port_configuration_link_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkList { + builder::NetworkingSwitchPortConfigurationLinkList::new(self) + } + + fn networking_switch_port_configuration_link_create( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkCreate { + builder::NetworkingSwitchPortConfigurationLinkCreate::new(self) + } + + fn networking_switch_port_configuration_link_view( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkView { + builder::NetworkingSwitchPortConfigurationLinkView::new(self) + } + + fn networking_switch_port_configuration_link_delete( + &self, + ) -> builder::NetworkingSwitchPortConfigurationLinkDelete { + builder::NetworkingSwitchPortConfigurationLinkDelete::new(self) + } + + fn networking_switch_port_configuration_route_list( + &self, + ) -> builder::NetworkingSwitchPortConfigurationRouteList { + builder::NetworkingSwitchPortConfigurationRouteList::new(self) + } + + fn networking_switch_port_configuration_route_add( + &self, + ) -> builder::NetworkingSwitchPortConfigurationRouteAdd { + builder::NetworkingSwitchPortConfigurationRouteAdd::new(self) + } + + fn networking_switch_port_configuration_route_remove( + &self, + ) -> builder::NetworkingSwitchPortConfigurationRouteRemove { + builder::NetworkingSwitchPortConfigurationRouteRemove::new(self) } } @@ -63471,6 +65954,329 @@ pub mod builder { } } + /// Builder for + /// [`ClientSystemHardwareExt::networking_switch_port_active_configuration_view`] + /// + /// [`ClientSystemHardwareExt::networking_switch_port_active_configuration_view`]: super::ClientSystemHardwareExt::networking_switch_port_active_configuration_view + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortActiveConfigurationView<'a> { + client: &'a super::Client, + rack_id: Result, + switch: Result, + port: Result, + } + + impl<'a> NetworkingSwitchPortActiveConfigurationView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + rack_id: Err("rack_id was not initialized".to_string()), + switch: Err("switch was not initialized".to_string()), + port: Err("port was not initialized".to_string()), + } + } + + pub fn rack_id(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.rack_id = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for rack_id failed".to_string()); + self + } + + pub fn switch(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.switch = value + .try_into() + .map_err(|_| "conversion to `SwitchLocation` for switch failed".to_string()); + self + } + + pub fn port(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.port = value + .try_into() + .map_err(|_| "conversion to `Name` for port failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/hardware/racks/{rack_id}/switch/{switch}/switch-port/ + /// {port}/configuration` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + rack_id, + switch, + port, + } = self; + let rack_id = rack_id.map_err(Error::InvalidRequest)?; + let switch = switch.map_err(Error::InvalidRequest)?; + let port = port.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/racks/{}/switch/{}/switch-port/{}/configuration", + client.baseurl, + encode_path(&rack_id.to_string()), + encode_path(&switch.to_string()), + encode_path(&port.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemHardwareExt::networking_switch_port_active_configuration_set`] + /// + /// [`ClientSystemHardwareExt::networking_switch_port_active_configuration_set`]: super::ClientSystemHardwareExt::networking_switch_port_active_configuration_set + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortActiveConfigurationSet<'a> { + client: &'a super::Client, + rack_id: Result, + switch: Result, + port: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortActiveConfigurationSet<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + rack_id: Err("rack_id was not initialized".to_string()), + switch: Err("switch was not initialized".to_string()), + port: Err("port was not initialized".to_string()), + body: Ok(types::builder::SwitchPortApplySettings::default()), + } + } + + pub fn rack_id(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.rack_id = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for rack_id failed".to_string()); + self + } + + pub fn switch(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.switch = value + .try_into() + .map_err(|_| "conversion to `SwitchLocation` for switch failed".to_string()); + self + } + + pub fn port(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.port = value + .try_into() + .map_err(|_| "conversion to `Name` for port failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `SwitchPortApplySettings` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::SwitchPortApplySettings, + ) -> types::builder::SwitchPortApplySettings, + { + self.body = self.body.map(f); + self + } + + /// Sends a `PUT` request to + /// `/v1/system/hardware/racks/{rack_id}/switch/{switch}/switch-port/ + /// {port}/configuration` + pub async fn send(self) -> Result, Error> { + let Self { + client, + rack_id, + switch, + port, + body, + } = self; + let rack_id = rack_id.map_err(Error::InvalidRequest)?; + let switch = switch.map_err(Error::InvalidRequest)?; + let port = port.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| { + types::SwitchPortApplySettings::try_from(v).map_err(|e| e.to_string()) + }) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/racks/{}/switch/{}/switch-port/{}/configuration", + client.baseurl, + encode_path(&rack_id.to_string()), + encode_path(&switch.to_string()), + encode_path(&port.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .put(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemHardwareExt::networking_switch_port_active_configuration_clear`] + /// + /// [`ClientSystemHardwareExt::networking_switch_port_active_configuration_clear`]: super::ClientSystemHardwareExt::networking_switch_port_active_configuration_clear + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortActiveConfigurationClear<'a> { + client: &'a super::Client, + rack_id: Result, + switch: Result, + port: Result, + } + + impl<'a> NetworkingSwitchPortActiveConfigurationClear<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + rack_id: Err("rack_id was not initialized".to_string()), + switch: Err("switch was not initialized".to_string()), + port: Err("port was not initialized".to_string()), + } + } + + pub fn rack_id(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.rack_id = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for rack_id failed".to_string()); + self + } + + pub fn switch(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.switch = value + .try_into() + .map_err(|_| "conversion to `SwitchLocation` for switch failed".to_string()); + self + } + + pub fn port(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.port = value + .try_into() + .map_err(|_| "conversion to `Name` for port failed".to_string()); + self + } + + /// Sends a `DELETE` request to + /// `/v1/system/hardware/racks/{rack_id}/switch/{switch}/switch-port/ + /// {port}/configuration` + pub async fn send(self) -> Result, Error> { + let Self { + client, + rack_id, + switch, + port, + } = self; + let rack_id = rack_id.map_err(Error::InvalidRequest)?; + let switch = switch.map_err(Error::InvalidRequest)?; + let port = port.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/racks/{}/switch/{}/switch-port/{}/configuration", + client.baseurl, + encode_path(&rack_id.to_string()), + encode_path(&switch.to_string()), + encode_path(&port.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .delete(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + /// Builder for [`ClientSystemHardwareExt::sled_list`] /// /// [`ClientSystemHardwareExt::sled_list`]: super::ClientSystemHardwareExt::sled_list @@ -64493,7 +67299,7 @@ pub mod builder { client: &'a super::Client, port: Result, rack_id: Result, - switch_location: Result, + switch_location: Result, body: Result, } @@ -64530,11 +67336,11 @@ pub mod builder { pub fn switch_location(mut self, value: V) -> Self where - V: std::convert::TryInto, + V: std::convert::TryInto, { - self.switch_location = value - .try_into() - .map_err(|_| "conversion to `Name` for switch_location failed".to_string()); + self.switch_location = value.try_into().map_err(|_| { + "conversion to `SwitchLocation` for switch_location failed".to_string() + }); self } @@ -64623,7 +67429,7 @@ pub mod builder { client: &'a super::Client, port: Result, rack_id: Result, - switch_location: Result, + switch_location: Result, } impl<'a> NetworkingSwitchPortClearSettings<'a> { @@ -64658,11 +67464,11 @@ pub mod builder { pub fn switch_location(mut self, value: V) -> Self where - V: std::convert::TryInto, + V: std::convert::TryInto, { - self.switch_location = value - .try_into() - .map_err(|_| "conversion to `Name` for switch_location failed".to_string()); + self.switch_location = value.try_into().map_err(|_| { + "conversion to `SwitchLocation` for switch_location failed".to_string() + }); self } @@ -64719,7 +67525,7 @@ pub mod builder { client: &'a super::Client, port: Result, rack_id: Result, - switch_location: Result, + switch_location: Result, } impl<'a> NetworkingSwitchPortStatus<'a> { @@ -64754,11 +67560,11 @@ pub mod builder { pub fn switch_location(mut self, value: V) -> Self where - V: std::convert::TryInto, + V: std::convert::TryInto, { - self.switch_location = value - .try_into() - .map_err(|_| "conversion to `Name` for switch_location failed".to_string()); + self.switch_location = value.try_into().map_err(|_| { + "conversion to `SwitchLocation` for switch_location failed".to_string() + }); self } @@ -67812,6 +70618,204 @@ pub mod builder { } } + /// Builder for + /// [`ClientSystemNetworkingExt::networking_address_lot_block_add`] + /// + /// [`ClientSystemNetworkingExt::networking_address_lot_block_add`]: super::ClientSystemNetworkingExt::networking_address_lot_block_add + #[derive(Debug, Clone)] + pub struct NetworkingAddressLotBlockAdd<'a> { + client: &'a super::Client, + address_lot: Result, + body: Result, + } + + impl<'a> NetworkingAddressLotBlockAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + address_lot: Err("address_lot was not initialized".to_string()), + body: Ok(types::builder::AddressLotBlockAddRemove::default()), + } + } + + pub fn address_lot(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.address_lot = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for address_lot failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `AddressLotBlockAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AddressLotBlockAddRemove, + ) -> types::builder::AddressLotBlockAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/address-lot/{address_lot}/blocks/add` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + address_lot, + body, + } = self; + let address_lot = address_lot.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| { + types::AddressLotBlockAddRemove::try_from(v).map_err(|e| e.to_string()) + }) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/address-lot/{}/blocks/add", + client.baseurl, + encode_path(&address_lot.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_address_lot_block_remove`] + /// + /// [`ClientSystemNetworkingExt::networking_address_lot_block_remove`]: super::ClientSystemNetworkingExt::networking_address_lot_block_remove + #[derive(Debug, Clone)] + pub struct NetworkingAddressLotBlockRemove<'a> { + client: &'a super::Client, + address_lot: Result, + body: Result, + } + + impl<'a> NetworkingAddressLotBlockRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + address_lot: Err("address_lot was not initialized".to_string()), + body: Ok(types::builder::AddressLotBlockAddRemove::default()), + } + } + + pub fn address_lot(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.address_lot = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for address_lot failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `AddressLotBlockAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AddressLotBlockAddRemove, + ) -> types::builder::AddressLotBlockAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/address-lot/{address_lot}/blocks/remove` + pub async fn send(self) -> Result, Error> { + let Self { + client, + address_lot, + body, + } = self; + let address_lot = address_lot.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| { + types::AddressLotBlockAddRemove::try_from(v).map_err(|e| e.to_string()) + }) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/address-lot/{}/blocks/remove", + client.baseurl, + encode_path(&address_lot.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + /// Builder for [`ClientSystemNetworkingExt::networking_allow_list_view`] /// /// [`ClientSystemNetworkingExt::networking_allow_list_view`]: super::ClientSystemNetworkingExt::networking_allow_list_view @@ -68330,34 +71334,36 @@ pub mod builder { #[derive(Debug, Clone)] pub struct NetworkingBgpConfigDelete<'a> { client: &'a super::Client, - name_or_id: Result, + bgp_config: Result, } impl<'a> NetworkingBgpConfigDelete<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, - name_or_id: Err("name_or_id was not initialized".to_string()), + bgp_config: Err("bgp_config was not initialized".to_string()), } } - pub fn name_or_id(mut self, value: V) -> Self + pub fn bgp_config(mut self, value: V) -> Self where V: std::convert::TryInto, { - self.name_or_id = value + self.bgp_config = value .try_into() - .map_err(|_| "conversion to `NameOrId` for name_or_id failed".to_string()); + .map_err(|_| "conversion to `NameOrId` for bgp_config failed".to_string()); self } - /// Sends a `DELETE` request to `/v1/system/networking/bgp` + /// Sends a `DELETE` request to `/v1/system/networking/bgp/{bgp_config}` pub async fn send(self) -> Result, Error> { - let Self { client, name_or_id } = self; - let name_or_id = name_or_id.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/networking/bgp", client.baseurl,); - let mut query = Vec::with_capacity(1usize); - query.push(("name_or_id", name_or_id.to_string())); + let Self { client, bgp_config } = self; + let bgp_config = bgp_config.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/bgp/{}", + client.baseurl, + encode_path(&bgp_config.to_string()), + ); #[allow(unused_mut)] let mut request = client .client @@ -68366,7 +71372,6 @@ pub mod builder { reqwest::header::ACCEPT, reqwest::header::HeaderValue::from_static("application/json"), ) - .query(&query) .build()?; let result = client.client.execute(request).await; let response = result?; @@ -68550,7 +71555,7 @@ pub mod builder { let result = client.client.execute(request).await; let response = result?; match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, + 200u16 => ResponseValue::from_response(response).await, 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -69242,29 +72247,40 @@ pub mod builder { } /// Builder for - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_list`] + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_list`] /// - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_list`]: super::ClientSystemNetworkingExt::networking_switch_port_settings_list + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_list #[derive(Debug, Clone)] - pub struct NetworkingSwitchPortSettingsList<'a> { + pub struct NetworkingSwitchPortConfigurationList<'a> { client: &'a super::Client, + configuration: Result, String>, limit: Result, String>, page_token: Result, String>, - port_settings: Result, String>, sort_by: Result, String>, } - impl<'a> NetworkingSwitchPortSettingsList<'a> { + impl<'a> NetworkingSwitchPortConfigurationList<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, + configuration: Ok(None), limit: Ok(None), page_token: Ok(None), - port_settings: Ok(None), sort_by: Ok(None), } } + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + pub fn limit(mut self, value: V) -> Self where V: std::convert::TryInto, @@ -69286,17 +72302,6 @@ pub mod builder { self } - pub fn port_settings(mut self, value: V) -> Self - where - V: std::convert::TryInto, - { - self.port_settings = value - .try_into() - .map(Some) - .map_err(|_| "conversion to `NameOrId` for port_settings failed".to_string()); - self - } - pub fn sort_by(mut self, value: V) -> Self where V: std::convert::TryInto, @@ -69309,36 +72314,36 @@ pub mod builder { } /// Sends a `GET` request to - /// `/v1/system/networking/switch-port-settings` + /// `/v1/system/networking/switch-port-configuration` pub async fn send( self, ) -> Result, Error> { let Self { client, + configuration, limit, page_token, - port_settings, sort_by, } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let port_settings = port_settings.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/system/networking/switch-port-settings", + "{}/v1/system/networking/switch-port-configuration", client.baseurl, ); let mut query = Vec::with_capacity(4usize); + if let Some(v) = &configuration { + query.push(("configuration", v.to_string())); + } if let Some(v) = &limit { query.push(("limit", v.to_string())); } if let Some(v) = &page_token { query.push(("page_token", v.to_string())); } - if let Some(v) = &port_settings { - query.push(("port_settings", v.to_string())); - } if let Some(v) = &sort_by { query.push(("sort_by", v.to_string())); } @@ -69367,7 +72372,7 @@ pub mod builder { } /// Streams `GET` requests to - /// `/v1/system/networking/switch-port-settings` + /// `/v1/system/networking/switch-port-configuration` pub fn stream( self, ) -> impl futures::Stream>> @@ -69377,8 +72382,8 @@ pub mod builder { use futures::TryFutureExt; use futures::TryStreamExt; let next = Self { + configuration: Ok(None), page_token: Ok(None), - port_settings: Ok(None), sort_by: Ok(None), ..self.clone() }; @@ -69417,16 +72422,16 @@ pub mod builder { } /// Builder for - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_create`] + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_create`] /// - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_create`]: super::ClientSystemNetworkingExt::networking_switch_port_settings_create + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_create`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_create #[derive(Debug, Clone)] - pub struct NetworkingSwitchPortSettingsCreate<'a> { + pub struct NetworkingSwitchPortConfigurationCreate<'a> { client: &'a super::Client, body: Result, } - impl<'a> NetworkingSwitchPortSettingsCreate<'a> { + impl<'a> NetworkingSwitchPortConfigurationCreate<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, @@ -69459,7 +72464,7 @@ pub mod builder { } /// Sends a `POST` request to - /// `/v1/system/networking/switch-port-settings` + /// `/v1/system/networking/switch-port-configuration` pub async fn send( self, ) -> Result, Error> { @@ -69470,7 +72475,7 @@ pub mod builder { }) .map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/system/networking/switch-port-settings", + "{}/v1/system/networking/switch-port-configuration", client.baseurl, ); #[allow(unused_mut)] @@ -69499,50 +72504,113 @@ pub mod builder { } /// Builder for - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_delete`] + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_view`] /// - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_delete`]: super::ClientSystemNetworkingExt::networking_switch_port_settings_delete + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_view`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_view #[derive(Debug, Clone)] - pub struct NetworkingSwitchPortSettingsDelete<'a> { + pub struct NetworkingSwitchPortConfigurationView<'a> { client: &'a super::Client, - port_settings: Result, String>, + configuration: Result, } - impl<'a> NetworkingSwitchPortSettingsDelete<'a> { + impl<'a> NetworkingSwitchPortConfigurationView<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, - port_settings: Ok(None), + configuration: Err("configuration was not initialized".to_string()), } } - pub fn port_settings(mut self, value: V) -> Self + pub fn configuration(mut self, value: V) -> Self where V: std::convert::TryInto, { - self.port_settings = value + self.configuration = value .try_into() - .map(Some) - .map_err(|_| "conversion to `NameOrId` for port_settings failed".to_string()); + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_delete`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_delete`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_delete + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationDelete<'a> { + client: &'a super::Client, + configuration: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationDelete<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); self } /// Sends a `DELETE` request to - /// `/v1/system/networking/switch-port-settings` + /// `/v1/system/networking/switch-port-configuration/{configuration}` pub async fn send(self) -> Result, Error> { let Self { client, - port_settings, + configuration, } = self; - let port_settings = port_settings.map_err(Error::InvalidRequest)?; + let configuration = configuration.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/system/networking/switch-port-settings", + "{}/v1/system/networking/switch-port-configuration/{}", client.baseurl, + encode_path(&configuration.to_string()), ); - let mut query = Vec::with_capacity(1usize); - if let Some(v) = &port_settings { - query.push(("port_settings", v.to_string())); - } #[allow(unused_mut)] let mut request = client .client @@ -69551,7 +72619,6 @@ pub mod builder { reqwest::header::ACCEPT, reqwest::header::HeaderValue::from_static("application/json"), ) - .query(&query) .build()?; let result = client.client.execute(request).await; let response = result?; @@ -69569,44 +72636,1900 @@ pub mod builder { } /// Builder for - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_view`] + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_address_list`] /// - /// [`ClientSystemNetworkingExt::networking_switch_port_settings_view`]: super::ClientSystemNetworkingExt::networking_switch_port_settings_view + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_address_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_address_list #[derive(Debug, Clone)] - pub struct NetworkingSwitchPortSettingsView<'a> { + pub struct NetworkingSwitchPortConfigurationAddressList<'a> { client: &'a super::Client, - port: Result, + configuration: Result, } - impl<'a> NetworkingSwitchPortSettingsView<'a> { + impl<'a> NetworkingSwitchPortConfigurationAddressList<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, - port: Err("port was not initialized".to_string()), + configuration: Err("configuration was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// address` + pub async fn send( + self, + ) -> Result>, Error> + { + let Self { + client, + configuration, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/address", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_address_add`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_address_add`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_address_add + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationAddressAdd<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationAddressAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::AddressAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value + .try_into() + .map(From::from) + .map_err(|s| format!("conversion to `AddressAddRemove` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AddressAddRemove, + ) -> types::builder::AddressAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// address/add` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::AddressAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/address/add", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_address_remove`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_address_remove`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_address_remove + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationAddressRemove<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationAddressRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::AddressAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value + .try_into() + .map(From::from) + .map_err(|s| format!("conversion to `AddressAddRemove` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AddressAddRemove, + ) -> types::builder::AddressAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// address/remove` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::AddressAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/address/remove", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_list`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_list + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerList<'a> { + client: &'a super::Client, + configuration: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerList<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer` + pub async fn send(self) -> Result>, Error> { + let Self { + client, + configuration, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_add`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_add`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_add + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerAdd<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::BgpPeer::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value + .try_into() + .map(From::from) + .map_err(|s| format!("conversion to `BgpPeer` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce(types::builder::BgpPeer) -> types::builder::BgpPeer, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/add` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::BgpPeer::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/add", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_list`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_list + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportList<'a> { + client: &'a super::Client, + configuration: Result, + peer_address: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerAllowExportList<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + peer_address: Err("peer_address was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn peer_address(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.peer_address = value.try_into().map_err(|_| { + "conversion to `std :: net :: IpAddr` for peer_address failed".to_string() + }); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-export` + pub async fn send( + self, + ) -> Result>, Error> { + let Self { + client, + configuration, + peer_address, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let peer_address = peer_address.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-export", + client.baseurl, + encode_path(&configuration.to_string()), + ); + let mut query = Vec::with_capacity(1usize); + query.push(("peer_address", peer_address.to_string())); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&query) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_add`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_add`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_add + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerAllowExportAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::AllowedPrefixAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `AllowedPrefixAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AllowedPrefixAddRemove, + ) -> types::builder::AllowedPrefixAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-export/add` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::AllowedPrefixAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-export/add", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_remove`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_remove`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_export_remove + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerAllowExportRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::AllowedPrefixAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `AllowedPrefixAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AllowedPrefixAddRemove, + ) -> types::builder::AllowedPrefixAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-export/remove` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::AllowedPrefixAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-export/remove", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_list`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_list + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportList<'a> { + client: &'a super::Client, + configuration: Result, + peer_address: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerAllowImportList<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + peer_address: Err("peer_address was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn peer_address(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.peer_address = value.try_into().map_err(|_| { + "conversion to `std :: net :: IpAddr` for peer_address failed".to_string() + }); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-import` + pub async fn send( + self, + ) -> Result>, Error> { + let Self { + client, + configuration, + peer_address, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let peer_address = peer_address.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-import", + client.baseurl, + encode_path(&configuration.to_string()), + ); + let mut query = Vec::with_capacity(1usize); + query.push(("peer_address", peer_address.to_string())); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&query) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_add`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_add`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_add + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerAllowImportAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::AllowedPrefixAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `AllowedPrefixAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AllowedPrefixAddRemove, + ) -> types::builder::AllowedPrefixAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-import/add` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::AllowedPrefixAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-import/add", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_remove`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_remove`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_allow_import_remove + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerAllowImportRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::AllowedPrefixAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `AllowedPrefixAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::AllowedPrefixAddRemove, + ) -> types::builder::AllowedPrefixAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/allow-import/remove` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::AllowedPrefixAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/allow-import/remove", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_list`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_list + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityList<'a> { + client: &'a super::Client, + configuration: Result, + peer_address: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerCommunityList<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + peer_address: Err("peer_address was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn peer_address(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.peer_address = value.try_into().map_err(|_| { + "conversion to `std :: net :: IpAddr` for peer_address failed".to_string() + }); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/community` + pub async fn send( + self, + ) -> Result>, Error> { + let Self { + client, + configuration, + peer_address, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let peer_address = peer_address.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/community", + client.baseurl, + encode_path(&configuration.to_string()), + ); + let mut query = Vec::with_capacity(1usize); + query.push(("peer_address", peer_address.to_string())); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&query) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_add`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_add`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_add + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityAdd<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerCommunityAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::BgpCommunityAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `BgpCommunityAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::BgpCommunityAddRemove, + ) -> types::builder::BgpCommunityAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/community/add` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::BgpCommunityAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/community/add", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_remove`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_remove`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_community_remove + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerCommunityRemove<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerCommunityRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::BgpCommunityAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `BgpCommunityAddRemove` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::BgpCommunityAddRemove, + ) -> types::builder::BgpCommunityAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/community/remove` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::BgpCommunityAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/community/remove", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_remove`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_remove`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_bgp_peer_remove + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationBgpPeerRemove<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationBgpPeerRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::BgpPeerRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value + .try_into() + .map(From::from) + .map_err(|s| format!("conversion to `BgpPeerRemove` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce(types::builder::BgpPeerRemove) -> types::builder::BgpPeerRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// bgp-peer/remove` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::BgpPeerRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/bgp-peer/remove", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_geometry_view`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_geometry_view`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_geometry_view + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationGeometryView<'a> { + client: &'a super::Client, + configuration: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationGeometryView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// geometry` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/geometry", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), } } + } - pub fn port(mut self, value: V) -> Self + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_geometry_set`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_geometry_set`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_geometry_set + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationGeometrySet<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationGeometrySet<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::SwitchPortConfigCreate::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self where V: std::convert::TryInto, { - self.port = value + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `SwitchPortConfigCreate` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::SwitchPortConfigCreate, + ) -> types::builder::SwitchPortConfigCreate, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// geometry` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::SwitchPortConfigCreate::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/geometry", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_list`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_link_list + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationLinkList<'a> { + client: &'a super::Client, + configuration: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationLinkList<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value .try_into() - .map_err(|_| "conversion to `NameOrId` for port failed".to_string()); + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); self } /// Sends a `GET` request to - /// `/v1/system/networking/switch-port-settings/{port}` + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// link` pub async fn send( self, - ) -> Result, Error> { - let Self { client, port } = self; - let port = port.map_err(Error::InvalidRequest)?; + ) -> Result>, Error> { + let Self { + client, + configuration, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/system/networking/switch-port-settings/{}", + "{}/v1/system/networking/switch-port-configuration/{}/link", client.baseurl, - encode_path(&port.to_string()), + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_create`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_create`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_link_create + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationLinkCreate<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationLinkCreate<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::NamedLinkConfigCreate::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `NamedLinkConfigCreate` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::NamedLinkConfigCreate, + ) -> types::builder::NamedLinkConfigCreate, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// link` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::NamedLinkConfigCreate::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/link", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_view`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_view`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_link_view + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationLinkView<'a> { + client: &'a super::Client, + configuration: Result, + link: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationLinkView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + link: Err("link was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn link(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.link = value + .try_into() + .map_err(|_| "conversion to `Name` for link failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// link/{link}` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + link, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let link = link.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/link/{}", + client.baseurl, + encode_path(&configuration.to_string()), + encode_path(&link.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_delete`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_link_delete`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_link_delete + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationLinkDelete<'a> { + client: &'a super::Client, + configuration: Result, + link: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationLinkDelete<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + link: Err("link was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn link(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.link = value + .try_into() + .map_err(|_| "conversion to `Name` for link failed".to_string()); + self + } + + /// Sends a `DELETE` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// link/{link}` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + link, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let link = link.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/link/{}", + client.baseurl, + encode_path(&configuration.to_string()), + encode_path(&link.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .delete(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_route_list`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_route_list`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_route_list + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationRouteList<'a> { + client: &'a super::Client, + configuration: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationRouteList<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// route` + pub async fn send( + self, + ) -> Result>, Error> { + let Self { + client, + configuration, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/route", + client.baseurl, + encode_path(&configuration.to_string()), ); #[allow(unused_mut)] let mut request = client @@ -69632,6 +74555,194 @@ pub mod builder { } } + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_route_add`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_route_add`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_route_add + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationRouteAdd<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationRouteAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::RouteAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value + .try_into() + .map(From::from) + .map_err(|s| format!("conversion to `RouteAddRemove` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce(types::builder::RouteAddRemove) -> types::builder::RouteAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// route/add` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::RouteAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/route/add", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_route_remove`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_configuration_route_remove`]: super::ClientSystemNetworkingExt::networking_switch_port_configuration_route_remove + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortConfigurationRouteRemove<'a> { + client: &'a super::Client, + configuration: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortConfigurationRouteRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + configuration: Err("configuration was not initialized".to_string()), + body: Ok(types::builder::RouteAddRemove::default()), + } + } + + pub fn configuration(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.configuration = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for configuration failed".to_string()); + self + } + + pub fn body(mut self, value: V) -> Self + where + V: std::convert::TryInto, + >::Error: std::fmt::Display, + { + self.body = value + .try_into() + .map(From::from) + .map_err(|s| format!("conversion to `RouteAddRemove` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce(types::builder::RouteAddRemove) -> types::builder::RouteAddRemove, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/networking/switch-port-configuration/{configuration}/ + /// route/remove` + pub async fn send(self) -> Result, Error> { + let Self { + client, + configuration, + body, + } = self; + let configuration = configuration.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::RouteAddRemove::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/networking/switch-port-configuration/{}/route/remove", + client.baseurl, + encode_path(&configuration.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + /// Builder for [`ClientPolicyExt::system_policy_view`] /// /// [`ClientPolicyExt::system_policy_view`]: super::ClientPolicyExt::system_policy_view