@@ -66,6 +66,22 @@ pub enum GetAWSIntegrationIAMPermissionsError {
6666 UnknownValue ( serde_json:: Value ) ,
6767}
6868
69+ /// GetAWSIntegrationIAMPermissionsResourceCollectionError is a struct for typed errors of method [`AWSIntegrationAPI::get_aws_integration_iam_permissions_resource_collection`]
70+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
71+ #[ serde( untagged) ]
72+ pub enum GetAWSIntegrationIAMPermissionsResourceCollectionError {
73+ APIErrorResponse ( crate :: datadogV2:: model:: APIErrorResponse ) ,
74+ UnknownValue ( serde_json:: Value ) ,
75+ }
76+
77+ /// GetAWSIntegrationIAMPermissionsStandardError is a struct for typed errors of method [`AWSIntegrationAPI::get_aws_integration_iam_permissions_standard`]
78+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
79+ #[ serde( untagged) ]
80+ pub enum GetAWSIntegrationIAMPermissionsStandardError {
81+ APIErrorResponse ( crate :: datadogV2:: model:: APIErrorResponse ) ,
82+ UnknownValue ( serde_json:: Value ) ,
83+ }
84+
6985/// ListAWSAccountsError is a struct for typed errors of method [`AWSIntegrationAPI::list_aws_accounts`]
7086#[ derive( Debug , Clone , Serialize , Deserialize ) ]
7187#[ serde( untagged) ]
@@ -725,6 +741,226 @@ impl AWSIntegrationAPI {
725741 }
726742 }
727743
744+ /// Get all resource collection AWS IAM permissions required for the AWS integration.
745+ pub async fn get_aws_integration_iam_permissions_resource_collection (
746+ & self ,
747+ ) -> Result <
748+ crate :: datadogV2:: model:: AWSIntegrationIamPermissionsResponse ,
749+ datadog:: Error < GetAWSIntegrationIAMPermissionsResourceCollectionError > ,
750+ > {
751+ match self
752+ . get_aws_integration_iam_permissions_resource_collection_with_http_info ( )
753+ . await
754+ {
755+ Ok ( response_content) => {
756+ if let Some ( e) = response_content. entity {
757+ Ok ( e)
758+ } else {
759+ Err ( datadog:: Error :: Serde ( serde:: de:: Error :: custom (
760+ "response content was None" ,
761+ ) ) )
762+ }
763+ }
764+ Err ( err) => Err ( err) ,
765+ }
766+ }
767+
768+ /// Get all resource collection AWS IAM permissions required for the AWS integration.
769+ pub async fn get_aws_integration_iam_permissions_resource_collection_with_http_info (
770+ & self ,
771+ ) -> Result <
772+ datadog:: ResponseContent < crate :: datadogV2:: model:: AWSIntegrationIamPermissionsResponse > ,
773+ datadog:: Error < GetAWSIntegrationIAMPermissionsResourceCollectionError > ,
774+ > {
775+ let local_configuration = & self . config ;
776+ let operation_id = "v2.get_aws_integration_iam_permissions_resource_collection" ;
777+
778+ let local_client = & self . client ;
779+
780+ let local_uri_str = format ! (
781+ "{}/api/v2/integration/aws/iam_permissions/resource_collection" ,
782+ local_configuration. get_operation_host( operation_id)
783+ ) ;
784+ let mut local_req_builder =
785+ local_client. request ( reqwest:: Method :: GET , local_uri_str. as_str ( ) ) ;
786+
787+ // build headers
788+ let mut headers = HeaderMap :: new ( ) ;
789+ headers. insert ( "Accept" , HeaderValue :: from_static ( "application/json" ) ) ;
790+
791+ // build user agent
792+ match HeaderValue :: from_str ( local_configuration. user_agent . as_str ( ) ) {
793+ Ok ( user_agent) => headers. insert ( reqwest:: header:: USER_AGENT , user_agent) ,
794+ Err ( e) => {
795+ log:: warn!( "Failed to parse user agent header: {e}, falling back to default" ) ;
796+ headers. insert (
797+ reqwest:: header:: USER_AGENT ,
798+ HeaderValue :: from_static ( datadog:: DEFAULT_USER_AGENT . as_str ( ) ) ,
799+ )
800+ }
801+ } ;
802+
803+ // build auth
804+ if let Some ( local_key) = local_configuration. auth_keys . get ( "apiKeyAuth" ) {
805+ headers. insert (
806+ "DD-API-KEY" ,
807+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
808+ . expect ( "failed to parse DD-API-KEY header" ) ,
809+ ) ;
810+ } ;
811+ if let Some ( local_key) = local_configuration. auth_keys . get ( "appKeyAuth" ) {
812+ headers. insert (
813+ "DD-APPLICATION-KEY" ,
814+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
815+ . expect ( "failed to parse DD-APPLICATION-KEY header" ) ,
816+ ) ;
817+ } ;
818+
819+ local_req_builder = local_req_builder. headers ( headers) ;
820+ let local_req = local_req_builder. build ( ) ?;
821+ log:: debug!( "request content: {:?}" , local_req. body( ) ) ;
822+ let local_resp = local_client. execute ( local_req) . await ?;
823+
824+ let local_status = local_resp. status ( ) ;
825+ let local_content = local_resp. text ( ) . await ?;
826+ log:: debug!( "response content: {}" , local_content) ;
827+
828+ if !local_status. is_client_error ( ) && !local_status. is_server_error ( ) {
829+ match serde_json:: from_str :: <
830+ crate :: datadogV2:: model:: AWSIntegrationIamPermissionsResponse ,
831+ > ( & local_content)
832+ {
833+ Ok ( e) => {
834+ return Ok ( datadog:: ResponseContent {
835+ status : local_status,
836+ content : local_content,
837+ entity : Some ( e) ,
838+ } )
839+ }
840+ Err ( e) => return Err ( datadog:: Error :: Serde ( e) ) ,
841+ } ;
842+ } else {
843+ let local_entity: Option < GetAWSIntegrationIAMPermissionsResourceCollectionError > =
844+ serde_json:: from_str ( & local_content) . ok ( ) ;
845+ let local_error = datadog:: ResponseContent {
846+ status : local_status,
847+ content : local_content,
848+ entity : local_entity,
849+ } ;
850+ Err ( datadog:: Error :: ResponseError ( local_error) )
851+ }
852+ }
853+
854+ /// Get all standard AWS IAM permissions required for the AWS integration.
855+ pub async fn get_aws_integration_iam_permissions_standard (
856+ & self ,
857+ ) -> Result <
858+ crate :: datadogV2:: model:: AWSIntegrationIamPermissionsResponse ,
859+ datadog:: Error < GetAWSIntegrationIAMPermissionsStandardError > ,
860+ > {
861+ match self
862+ . get_aws_integration_iam_permissions_standard_with_http_info ( )
863+ . await
864+ {
865+ Ok ( response_content) => {
866+ if let Some ( e) = response_content. entity {
867+ Ok ( e)
868+ } else {
869+ Err ( datadog:: Error :: Serde ( serde:: de:: Error :: custom (
870+ "response content was None" ,
871+ ) ) )
872+ }
873+ }
874+ Err ( err) => Err ( err) ,
875+ }
876+ }
877+
878+ /// Get all standard AWS IAM permissions required for the AWS integration.
879+ pub async fn get_aws_integration_iam_permissions_standard_with_http_info (
880+ & self ,
881+ ) -> Result <
882+ datadog:: ResponseContent < crate :: datadogV2:: model:: AWSIntegrationIamPermissionsResponse > ,
883+ datadog:: Error < GetAWSIntegrationIAMPermissionsStandardError > ,
884+ > {
885+ let local_configuration = & self . config ;
886+ let operation_id = "v2.get_aws_integration_iam_permissions_standard" ;
887+
888+ let local_client = & self . client ;
889+
890+ let local_uri_str = format ! (
891+ "{}/api/v2/integration/aws/iam_permissions/standard" ,
892+ local_configuration. get_operation_host( operation_id)
893+ ) ;
894+ let mut local_req_builder =
895+ local_client. request ( reqwest:: Method :: GET , local_uri_str. as_str ( ) ) ;
896+
897+ // build headers
898+ let mut headers = HeaderMap :: new ( ) ;
899+ headers. insert ( "Accept" , HeaderValue :: from_static ( "application/json" ) ) ;
900+
901+ // build user agent
902+ match HeaderValue :: from_str ( local_configuration. user_agent . as_str ( ) ) {
903+ Ok ( user_agent) => headers. insert ( reqwest:: header:: USER_AGENT , user_agent) ,
904+ Err ( e) => {
905+ log:: warn!( "Failed to parse user agent header: {e}, falling back to default" ) ;
906+ headers. insert (
907+ reqwest:: header:: USER_AGENT ,
908+ HeaderValue :: from_static ( datadog:: DEFAULT_USER_AGENT . as_str ( ) ) ,
909+ )
910+ }
911+ } ;
912+
913+ // build auth
914+ if let Some ( local_key) = local_configuration. auth_keys . get ( "apiKeyAuth" ) {
915+ headers. insert (
916+ "DD-API-KEY" ,
917+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
918+ . expect ( "failed to parse DD-API-KEY header" ) ,
919+ ) ;
920+ } ;
921+ if let Some ( local_key) = local_configuration. auth_keys . get ( "appKeyAuth" ) {
922+ headers. insert (
923+ "DD-APPLICATION-KEY" ,
924+ HeaderValue :: from_str ( local_key. key . as_str ( ) )
925+ . expect ( "failed to parse DD-APPLICATION-KEY header" ) ,
926+ ) ;
927+ } ;
928+
929+ local_req_builder = local_req_builder. headers ( headers) ;
930+ let local_req = local_req_builder. build ( ) ?;
931+ log:: debug!( "request content: {:?}" , local_req. body( ) ) ;
932+ let local_resp = local_client. execute ( local_req) . await ?;
933+
934+ let local_status = local_resp. status ( ) ;
935+ let local_content = local_resp. text ( ) . await ?;
936+ log:: debug!( "response content: {}" , local_content) ;
937+
938+ if !local_status. is_client_error ( ) && !local_status. is_server_error ( ) {
939+ match serde_json:: from_str :: <
940+ crate :: datadogV2:: model:: AWSIntegrationIamPermissionsResponse ,
941+ > ( & local_content)
942+ {
943+ Ok ( e) => {
944+ return Ok ( datadog:: ResponseContent {
945+ status : local_status,
946+ content : local_content,
947+ entity : Some ( e) ,
948+ } )
949+ }
950+ Err ( e) => return Err ( datadog:: Error :: Serde ( e) ) ,
951+ } ;
952+ } else {
953+ let local_entity: Option < GetAWSIntegrationIAMPermissionsStandardError > =
954+ serde_json:: from_str ( & local_content) . ok ( ) ;
955+ let local_error = datadog:: ResponseContent {
956+ status : local_status,
957+ content : local_content,
958+ entity : local_entity,
959+ } ;
960+ Err ( datadog:: Error :: ResponseError ( local_error) )
961+ }
962+ }
963+
728964 /// Get a list of AWS Account Integration Configs.
729965 pub async fn list_aws_accounts (
730966 & self ,
0 commit comments