diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 42533fb4..0e261266 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: b5c8bf75-06e1-47c8-b9ae-ce49ba56069d management: - docChecksum: 8c5ff931262f50559a06ad555a45f347 + docChecksum: e8993b4731cca02d274df5b85062c1bb docVersion: "1.0" - speakeasyVersion: 1.487.0 - generationVersion: 2.506.0 - releaseVersion: 0.30.10 - configChecksum: 0e8ccc12e4b4ed9fcc7c18d2ab7dc4be + speakeasyVersion: 1.498.1 + generationVersion: 2.518.1 + releaseVersion: 0.31.0 + configChecksum: 843e91e7ae55350429e80066467a7799 repoURL: https://github.com/opalsecurity/terraform-provider-opal.git repoSubDirectory: . published: true @@ -14,11 +14,11 @@ features: terraform: additionalDependencies: 0.1.0 additionalProperties: 0.1.2 - constsAndDefaults: 0.2.0 - core: 3.30.0 + constsAndDefaults: 0.2.1 + core: 3.31.1 deprecations: 2.82.0 envVarSecurityUsage: 0.1.0 - globalSecurity: 2.81.9 + globalSecurity: 2.81.10 globalServerURLs: 2.82.1 ignores: 2.81.1 nameOverrides: 2.81.2 @@ -88,7 +88,9 @@ generatedFiles: - go.mod - go.sum - internal/planmodifiers/boolplanmodifier/suppress_diff.go + - internal/planmodifiers/float32planmodifier/suppress_diff.go - internal/planmodifiers/float64planmodifier/suppress_diff.go + - internal/planmodifiers/int32planmodifier/suppress_diff.go - internal/planmodifiers/int64planmodifier/suppress_diff.go - internal/planmodifiers/listplanmodifier/suppress_diff.go - internal/planmodifiers/mapplanmodifier/suppress_diff.go @@ -497,7 +499,9 @@ generatedFiles: - internal/validators/JSONParseValidator.go - internal/validators/RFC3339Validator.go - internal/validators/boolvalidators/not_null.go + - internal/validators/float32validators/not_null.go - internal/validators/float64validators/not_null.go + - internal/validators/int32validators/not_null.go - internal/validators/int64validators/not_null.go - internal/validators/listvalidators/not_null.go - internal/validators/mapvalidators/not_null.go @@ -539,10 +543,10 @@ examples: createConfigurationTemplate: speakeasy-default-create-configuration-template: requestBody: - application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "name": "Prod AWS Template", "require_mfa_to_approve": false, "require_mfa_to_connect": false, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} + application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "custom_request_notification": "Check your email to register your account.", "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "name": "Prod AWS Template", "request_configurations": [{"allow_requests": true, "auto_approval": false, "condition": {"group_ids": [], "role_remote_ids": []}, "max_duration_minutes": 120, "priority": 1, "recommended_duration_minutes": 120, "require_mfa_to_request": false, "require_support_ticket": false, "reviewer_stages": [{"operator": "AND", "owner_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "require_manager_approval": false}]}], "require_mfa_to_approve": false, "require_mfa_to_connect": false, "ticket_propagation": {"enabled_on_grant": true, "enabled_on_revocation": false, "ticket_provider": "LINEAR"}, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} responses: "200": - application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "configuration_template_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "name": "Prod AWS Template", "request_configuration_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "require_mfa_to_approve": false, "require_mfa_to_connect": false, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} + application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "configuration_template_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "custom_request_notification": "Check your email to register your account.", "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "name": "Prod AWS Template", "request_configuration_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "require_mfa_to_approve": false, "require_mfa_to_connect": false, "ticket_propagation": {"enabled_on_grant": true, "enabled_on_revocation": true, "ticket_provider": "LINEAR"}, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} deleteConfigurationTemplate: "": parameters: @@ -556,10 +560,10 @@ examples: updateConfigurationTemplate: speakeasy-default-update-configuration-template: requestBody: - application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "configuration_template_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "7c86c85d-0651-43e2-a748-d69d658418e8"], "name": "Prod AWS Template", "require_mfa_to_approve": false, "require_mfa_to_connect": false, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} + application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "configuration_template_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "custom_request_notification": "Check your email to register your account.", "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "7c86c85d-0651-43e2-a748-d69d658418e8"], "name": "Prod AWS Template", "request_configurations": [{"allow_requests": true, "auto_approval": false, "condition": {"group_ids": [], "role_remote_ids": []}, "max_duration_minutes": 120, "priority": 1, "recommended_duration_minutes": 120, "require_mfa_to_request": false, "require_support_ticket": false, "reviewer_stages": [{"operator": "AND", "owner_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "require_manager_approval": false}]}], "require_mfa_to_approve": false, "require_mfa_to_connect": false, "ticket_propagation": {"enabled_on_grant": false, "enabled_on_revocation": false, "ticket_provider": "LINEAR"}, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} responses: "200": - application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "configuration_template_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "name": "Prod AWS Template", "request_configuration_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "require_mfa_to_approve": false, "require_mfa_to_connect": false, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} + application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "break_glass_user_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "configuration_template_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "custom_request_notification": "Check your email to register your account.", "linked_audit_message_channel_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "member_oncall_schedule_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "name": "Prod AWS Template", "request_configuration_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "require_mfa_to_approve": false, "require_mfa_to_connect": false, "ticket_propagation": {"enabled_on_grant": true, "enabled_on_revocation": false, "ticket_provider": "LINEAR"}, "visibility": {"visibility": "GLOBAL", "visibility_group_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]}} getEvents: withDate: parameters: @@ -637,10 +641,10 @@ examples: createGroup: speakeasy-default-create-group: requestBody: - application/json: {"app_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "description": "Engineering team Okta group.", "group_type": "OPAL_GROUP", "name": "mongo-db-prod"} + application/json: {"app_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "custom_request_notification": "Check your email to register your account.", "description": "Engineering team Okta group.", "group_type": "OPAL_GROUP", "name": "mongo-db-prod", "remote_info": {"active_directory_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "azure_ad_microsoft_365_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "azure_ad_security_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "duo_group": {"group_id": "DSRD8W89B9DNDBY4RHAC"}, "github_team": {"team_slug": "opal-security"}, "gitlab_group": {"group_id": "898931321"}, "google_group": {"group_id": "1y6w882181n7sg"}, "ldap_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "okta_group": {"group_id": "00gjs33pe8rtmRrp3rd6"}}} responses: "200": - application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "app_id": "b5a5ca27-0ea3-4d86-9199-2126d57d1fbd", "description": "This group represents Active Directory group \"Payments Production Admin\". We use this AD group to facilitate staging deployments and qualifying new releases.", "group_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "remote_name": "Finance team", "require_mfa_to_approve": false} + application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "app_id": "b5a5ca27-0ea3-4d86-9199-2126d57d1fbd", "custom_request_notification": "Check your email to register your account.", "description": "This group represents Active Directory group \"Payments Production Admin\". We use this AD group to facilitate staging deployments and qualifying new releases.", "group_binding_id": "06851574-e50d-40ca-8c78-f72ae6ab4304", "group_type": "OPAL_GROUP", "group_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "name": "API Group", "remote_info": {"active_directory_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "azure_ad_microsoft_365_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "azure_ad_security_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "duo_group": {"group_id": "DSRD8W89B9DNDBY4RHAC"}, "github_team": {"team_slug": "opal-security"}, "gitlab_group": {"group_id": "898931321"}, "google_group": {"group_id": "1y6w882181n7sg"}, "ldap_group": {"group_id": "01fa7402-01d8-103b-8deb-5f3a0ab7884"}, "okta_group": {"group_id": "00gjs33pe8rtmRrp3rd6"}}, "remote_name": "Finance team", "request_configurations": [{"allow_requests": true, "auto_approval": false, "condition": {"group_ids": [], "role_remote_ids": []}, "max_duration_minutes": 120, "priority": 1, "recommended_duration_minutes": 120, "require_mfa_to_request": false, "require_support_ticket": false, "reviewer_stages": [{"operator": "AND", "owner_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "require_manager_approval": false}]}], "require_mfa_to_approve": false} createGroupResources: "": parameters: @@ -869,10 +873,10 @@ examples: createOwner: speakeasy-default-create-owner: requestBody: - application/json: {"access_request_escalation_period": 120, "description": "This owner represents the API team owners.", "name": "API Owner", "user_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]} + application/json: {"access_request_escalation_period": 120, "description": "This owner represents the API team owners.", "name": "API Owner", "reviewer_message_channel_id": "37cb7e41-12ba-46da-92ff-030abe0450b1", "source_group_id": "1b978423-db0a-4037-a4cf-f79c60cb67b3", "user_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"]} responses: "200": - application/json: {"access_request_escalation_period": 120, "description": "This owner represents the API team owners.", "owner_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "name": "API Owner"} + application/json: {"access_request_escalation_period": 120, "description": "This owner represents the API team owners.", "owner_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "name": "API Owner", "reviewer_message_channel_id": "37cb7e41-12ba-46da-92ff-030abe0450b1", "source_group_id": "1b978423-db0a-4037-a4cf-f79c60cb67b3"} deleteOwner: "": parameters: @@ -951,10 +955,10 @@ examples: createResource: speakeasy-default-create-resource: requestBody: - application/json: {"app_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "description": "Engineering team Okta role.", "name": "mongo-db-prod", "resource_type": "AWS_IAM_ROLE"} + application/json: {"app_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "custom_request_notification": "Check your email to register your account.", "description": "Engineering team Okta role.", "name": "mongo-db-prod", "remote_info": {"aws_account": {"account_id": "234234234234"}, "aws_ec2_instance": {"account_id": "234234234234", "instance_id": "i-13f1a1e2899f9e93a", "region": "us-east-2"}, "aws_eks_cluster": {"account_id": "234234234234", "arn": "arn:aws:eks:us-east-2:234234234234:cluster/testcluster"}, "aws_iam_role": {"account_id": "234234234234", "arn": "arn:aws:iam::179308207300:role/MyRole"}, "aws_permission_set": {"account_id": "234234234234", "arn": "arn:aws:sso:::permissionSet/asdf-32139302d201d32/ps-f03323201211e1b9"}, "aws_rds_instance": {"account_id": "234234234234", "instance_id": "demo-mysql-db", "region": "us-east-2", "resource_id": "db-AOO8V0XUCNU13XLZXQDQRSN0NQ"}, "gcp_big_query_dataset": {"dataset_id": "example-dataset-898931321", "project_id": "example-project-898931321"}, "gcp_big_query_table": {"dataset_id": "example-dataset-898931321", "project_id": "example-project-898931321", "table_id": "example-table-898931321"}, "gcp_bucket": {"bucket_id": "example-bucket-898931321"}, "gcp_compute_instance": {"instance_id": "example-instance-898931321", "project_id": "example-project-898931321", "zone": "us-central1-a"}, "gcp_folder": {"folder_id": "folder/898931321"}, "gcp_gke_cluster": {"cluster_name": "example-cluster-898931321"}, "gcp_organization": {"organization_id": "organizations/898931321"}, "gcp_project": {"project_id": "example-project-898931321"}, "gcp_service_account": {"email": "production@project.iam.gserviceaccount.com", "project_id": "example-project-898931321", "service_account_id": "103561576023829460000"}, "gcp_sql_instance": {"instance_id": "example-sql-898931321", "project_id": "example-project-898931321"}, "github_repo": {"repo_name": "Opal Security"}, "gitlab_project": {"project_id": "898931321"}, "okta_app": {"app_id": "a9dfas0f678asdf67867"}, "okta_custom_role": {"role_id": "a9dfas0f678asdf67867"}, "okta_standard_role": {"role_type": "ORG_ADMIN"}, "pagerduty_role": {"role_name": "owner"}, "salesforce_permission_set": {"permission_set_id": "0PS5Y090202wOV7WAM"}, "salesforce_profile": {"profile_id": "0PS5Y090202wOV7WAM", "user_license_id": "1005Y030081Qb5XJHS"}, "salesforce_role": {"role_id": "0PS5Y090202wOV7WAM"}, "teleport_role": {"role_name": "admin_role"}}, "resource_type": "AWS_IAM_ROLE"} responses: "200": - application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "app_id": "b5a5ca27-0ea3-4d86-9199-2126d57d1fbd", "description": "This resource represents AWS IAM role \"SupportUser\".", "resource_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "parent_resource_id": "06851574-e50d-40ca-8c78-f72ae6ab4305", "require_mfa_to_approve": false} + application/json: {"admin_owner_id": "7c86c85d-0651-43e2-a748-d69d658418e8", "app_id": "b5a5ca27-0ea3-4d86-9199-2126d57d1fbd", "description": "This resource represents AWS IAM role \"SupportUser\".", "resource_id": "f454d283-ca87-4a8a-bdbb-df212eca5353", "name": "mongo-db-prod", "parent_resource_id": "06851574-e50d-40ca-8c78-f72ae6ab4305", "remote_info": {"aws_account": {"account_id": "234234234234"}, "aws_ec2_instance": {"account_id": "234234234234", "instance_id": "i-13f1a1e2899f9e93a", "region": "us-east-2"}, "aws_eks_cluster": {"account_id": "234234234234", "arn": "arn:aws:eks:us-east-2:234234234234:cluster/testcluster"}, "aws_iam_role": {"account_id": "234234234234", "arn": "arn:aws:iam::179308207300:role/MyRole"}, "aws_permission_set": {"account_id": "234234234234", "arn": "arn:aws:sso:::permissionSet/asdf-32139302d201d32/ps-f03323201211e1b9"}, "aws_rds_instance": {"account_id": "234234234234", "instance_id": "demo-mysql-db", "region": "us-east-2", "resource_id": "db-AOO8V0XUCNU13XLZXQDQRSN0NQ"}, "gcp_big_query_dataset": {"dataset_id": "example-dataset-898931321", "project_id": "example-project-898931321"}, "gcp_big_query_table": {"dataset_id": "example-dataset-898931321", "project_id": "example-project-898931321", "table_id": "example-table-898931321"}, "gcp_bucket": {"bucket_id": "example-bucket-898931321"}, "gcp_compute_instance": {"instance_id": "example-instance-898931321", "project_id": "example-project-898931321", "zone": "us-central1-a"}, "gcp_folder": {"folder_id": "folder/898931321"}, "gcp_gke_cluster": {"cluster_name": "example-cluster-898931321"}, "gcp_organization": {"organization_id": "organizations/898931321"}, "gcp_project": {"project_id": "example-project-898931321"}, "gcp_service_account": {"email": "production@project.iam.gserviceaccount.com", "project_id": "example-project-898931321", "service_account_id": "103561576023829460000"}, "gcp_sql_instance": {"instance_id": "example-sql-898931321", "project_id": "example-project-898931321"}, "github_repo": {"repo_name": "Opal Security"}, "gitlab_project": {"project_id": "898931321"}, "okta_app": {"app_id": "a9dfas0f678asdf67867"}, "okta_custom_role": {"role_id": "a9dfas0f678asdf67867"}, "okta_standard_role": {"role_type": "ORG_ADMIN"}, "pagerduty_role": {"role_name": "owner"}, "salesforce_permission_set": {"permission_set_id": "0PS5Y090202wOV7WAM"}, "salesforce_profile": {"profile_id": "0PS5Y090202wOV7WAM", "user_license_id": "1005Y030081Qb5XJHS"}, "salesforce_role": {"role_id": "0PS5Y090202wOV7WAM"}, "teleport_role": {"role_name": "admin_role"}}, "request_configurations": [{"allow_requests": true, "auto_approval": false, "condition": {"group_ids": [], "role_remote_ids": []}, "max_duration_minutes": 120, "priority": 1, "recommended_duration_minutes": 120, "require_mfa_to_request": false, "require_support_ticket": false, "reviewer_stages": [{"operator": "AND", "owner_ids": ["37cb7e41-12ba-46da-92ff-030abe0450b1", "37cb7e41-12ba-46da-92ff-030abe0450b2"], "require_manager_approval": false}]}], "require_mfa_to_approve": false, "require_mfa_to_connect": false, "resource_type": "AWS_IAM_ROLE", "ticket_propagation": {"enabled_on_grant": true, "enabled_on_revocation": false, "ticket_provider": "LINEAR"}} deleteResource: "": parameters: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 52049748..b82dfa0b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.487.0 +speakeasyVersion: 1.498.1 sources: opal-terraform-provider: sourceNamespace: opal-terraform-provider - sourceRevisionDigest: sha256:42ba6fc418274bc7f15f9eb922c7fdedaa6eea1c0dfed4cb784651f70880ed3c - sourceBlobDigest: sha256:755b3b8c7ad3c38e5ef40d6b6bc4ed3a627966e0f5092c25c80b068ca2633369 + sourceRevisionDigest: sha256:df08a6efad107dc8ab1335cbcbfe3ebb3ebab71aee4e21d86f62a3050d786eaa + sourceBlobDigest: sha256:651d7ad66c89c2004cfc63c160e3d103996dfcdd1931cd001a95ff7410f4a74b tags: - latest - "1.0" @@ -11,8 +11,8 @@ targets: terraform: source: opal-terraform-provider sourceNamespace: opal-terraform-provider - sourceRevisionDigest: sha256:42ba6fc418274bc7f15f9eb922c7fdedaa6eea1c0dfed4cb784651f70880ed3c - sourceBlobDigest: sha256:755b3b8c7ad3c38e5ef40d6b6bc4ed3a627966e0f5092c25c80b068ca2633369 + sourceRevisionDigest: sha256:df08a6efad107dc8ab1335cbcbfe3ebb3ebab71aee4e21d86f62a3050d786eaa + sourceBlobDigest: sha256:651d7ad66c89c2004cfc63c160e3d103996dfcdd1931cd001a95ff7410f4a74b workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 3349335b..cbd92c97 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ terraform { required_providers { opal = { source = "opalsecurity/opal" - version = "0.30.10" + version = "0.31.0" } } } diff --git a/docs/index.md b/docs/index.md index 1c776d42..b0dfda2c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,7 +17,7 @@ terraform { required_providers { opal = { source = "opalsecurity/opal" - version = "0.30.10" + version = "0.31.0" } } } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 814c897f..8dc4d947 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { opal = { source = "opalsecurity/opal" - version = "0.30.10" + version = "0.31.0" } } } diff --git a/gen.yaml b/gen.yaml index a12c4585..1e96f8fb 100644 --- a/gen.yaml +++ b/gen.yaml @@ -4,15 +4,16 @@ generation: usageSnippets: optionalPropertyRendering: withExample fixes: - nameResolutionDec2023: false + nameResolutionFeb2025: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false + securityFeb2025: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false flattenGlobalSecurity: true terraform: - version: 0.30.10 + version: 0.31.0 additionalDataSources: [] additionalDependencies: {} additionalProviderAttributes: diff --git a/internal/planmodifiers/float32planmodifier/suppress_diff.go b/internal/planmodifiers/float32planmodifier/suppress_diff.go new file mode 100644 index 00000000..1f7777ec --- /dev/null +++ b/internal/planmodifiers/float32planmodifier/suppress_diff.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package float32planmodifier + +import ( + "context" + "github.com/opalsecurity/terraform-provider-opal/internal/planmodifiers/utils" + + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" +) + +const ( + // ExplicitSuppress strategy suppresses "(known after changes)" messages unless we're in the initial creation + ExplicitSuppress = iota +) + +// SuppressDiff returns a plan modifier that propagates a state value into the planned value, when it is Known, and the Plan Value is Unknown +func SuppressDiff(strategy int) planmodifier.Float32 { + return suppressDiff{ + strategy: strategy, + } +} + +// suppressDiff implements the plan modifier. +type suppressDiff struct { + strategy int +} + +// Description returns a human-readable description of the plan modifier. +func (m suppressDiff) Description(_ context.Context) string { + return "Once set, the value of this attribute in state will not change." +} + +// MarkdownDescription returns a markdown description of the plan modifier. +func (m suppressDiff) MarkdownDescription(_ context.Context) string { + return "Once set, the value of this attribute in state will not change." +} + +// PlanModifyFloat32 implements the plan modification logic. +func (m suppressDiff) PlanModifyFloat32(ctx context.Context, req planmodifier.Float32Request, resp *planmodifier.Float32Response) { + // Do nothing if there is a known planned value. + if !req.PlanValue.IsUnknown() { + return + } + + // Do nothing if there is an unknown configuration value + if req.ConfigValue.IsUnknown() { + return + } + + if utils.IsAllStateUnknown(ctx, req.State) { + return + } + + resp.PlanValue = req.StateValue +} diff --git a/internal/planmodifiers/int32planmodifier/suppress_diff.go b/internal/planmodifiers/int32planmodifier/suppress_diff.go new file mode 100644 index 00000000..7bfc71f0 --- /dev/null +++ b/internal/planmodifiers/int32planmodifier/suppress_diff.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package int32planmodifier + +import ( + "context" + "github.com/opalsecurity/terraform-provider-opal/internal/planmodifiers/utils" + + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" +) + +const ( + // ExplicitSuppress strategy suppresses "(known after changes)" messages unless we're in the initial creation + ExplicitSuppress = iota +) + +// SuppressDiff returns a plan modifier that propagates a state value into the planned value, when it is Known, and the Plan Value is Unknown +func SuppressDiff(strategy int) planmodifier.Int32 { + return suppressDiff{ + strategy: strategy, + } +} + +// suppressDiff implements the plan modifier. +type suppressDiff struct { + strategy int +} + +// Description returns a human-readable description of the plan modifier. +func (m suppressDiff) Description(_ context.Context) string { + return "Once set, the value of this attribute in state will not change." +} + +// MarkdownDescription returns a markdown description of the plan modifier. +func (m suppressDiff) MarkdownDescription(_ context.Context) string { + return "Once set, the value of this attribute in state will not change." +} + +// PlanModifyInt32 implements the plan modification logic. +func (m suppressDiff) PlanModifyInt32(ctx context.Context, req planmodifier.Int32Request, resp *planmodifier.Int32Response) { + // Do nothing if there is a known planned value. + if !req.PlanValue.IsUnknown() { + return + } + + // Do nothing if there is an unknown configuration value + if req.ConfigValue.IsUnknown() { + return + } + + if utils.IsAllStateUnknown(ctx, req.State) { + return + } + + resp.PlanValue = req.StateValue +} diff --git a/internal/provider/apps_data_source.go b/internal/provider/apps_data_source.go index 5e9af920..e02d2ab7 100644 --- a/internal/provider/apps_data_source.go +++ b/internal/provider/apps_data_source.go @@ -30,9 +30,9 @@ type AppsDataSource struct { // AppsDataSourceModel describes the data model. type AppsDataSourceModel struct { - AppTypeFilter []types.String `tfsdk:"app_type_filter"` + AppTypeFilter []types.String `queryParam:"style=form,explode=false,name=app_type_filter" tfsdk:"app_type_filter"` Apps []tfTypes.App `tfsdk:"apps"` - OwnerFilter types.String `tfsdk:"owner_filter"` + OwnerFilter types.String `queryParam:"style=form,explode=true,name=owner_filter" tfsdk:"owner_filter"` } // Metadata returns the data source type name. diff --git a/internal/provider/configurationtemplate_resource.go b/internal/provider/configurationtemplate_resource.go index b9c32f56..ca6090f2 100644 --- a/internal/provider/configurationtemplate_resource.go +++ b/internal/provider/configurationtemplate_resource.go @@ -170,7 +170,7 @@ func (r *ConfigurationTemplateResource) Schema(ctx context.Context, req resource "operator": schema.StringAttribute{ Computed: true, Optional: true, - Default: stringdefault.StaticString("AND"), + Default: stringdefault.StaticString(`AND`), Description: `The operator of the reviewer stage. Admin and manager approval are also treated as reviewers. Default: "AND"; must be one of ["AND", "OR"]`, Validators: []validator.String{ stringvalidator.OneOf( diff --git a/internal/provider/events_data_source.go b/internal/provider/events_data_source.go index 116ea96d..4d60b8d6 100644 --- a/internal/provider/events_data_source.go +++ b/internal/provider/events_data_source.go @@ -29,17 +29,17 @@ type EventsDataSource struct { // EventsDataSourceModel describes the data model. type EventsDataSourceModel struct { - ActorFilter types.String `tfsdk:"actor_filter"` - APITokenFilter types.String `tfsdk:"api_token_filter"` - Cursor types.String `tfsdk:"cursor"` - EndDateFilter types.String `tfsdk:"end_date_filter"` - EventTypeFilter types.String `tfsdk:"event_type_filter"` + ActorFilter types.String `queryParam:"style=form,explode=true,name=actor_filter" tfsdk:"actor_filter"` + APITokenFilter types.String `queryParam:"style=form,explode=true,name=api_token_filter" tfsdk:"api_token_filter"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` + EndDateFilter types.String `queryParam:"style=form,explode=true,name=end_date_filter" tfsdk:"end_date_filter"` + EventTypeFilter types.String `queryParam:"style=form,explode=true,name=event_type_filter" tfsdk:"event_type_filter"` Next types.String `tfsdk:"next"` - ObjectFilter types.String `tfsdk:"object_filter"` - PageSize types.Int64 `tfsdk:"page_size"` + ObjectFilter types.String `queryParam:"style=form,explode=true,name=object_filter" tfsdk:"object_filter"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` Previous types.String `tfsdk:"previous"` Results []tfTypes.Event `tfsdk:"results"` - StartDateFilter types.String `tfsdk:"start_date_filter"` + StartDateFilter types.String `queryParam:"style=form,explode=true,name=start_date_filter" tfsdk:"start_date_filter"` } // Metadata returns the data source type name. diff --git a/internal/provider/group_list_data_source.go b/internal/provider/group_list_data_source.go index e7b2edaa..cc8990d5 100644 --- a/internal/provider/group_list_data_source.go +++ b/internal/provider/group_list_data_source.go @@ -30,10 +30,10 @@ type GroupListDataSource struct { // GroupListDataSourceModel describes the data model. type GroupListDataSourceModel struct { - GroupIds []types.String `tfsdk:"group_ids"` - GroupName types.String `tfsdk:"group_name"` - GroupTypeFilter types.String `tfsdk:"group_type_filter"` - PageSize types.Int64 `tfsdk:"page_size"` + GroupIds []types.String `queryParam:"style=form,explode=false,name=group_ids" tfsdk:"group_ids"` + GroupName types.String `queryParam:"style=form,explode=true,name=group_name" tfsdk:"group_name"` + GroupTypeFilter types.String `queryParam:"style=form,explode=true,name=group_type_filter" tfsdk:"group_type_filter"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` Results []tfTypes.Group `tfsdk:"results"` } diff --git a/internal/provider/group_resource.go b/internal/provider/group_resource.go index 49bbb05a..7ea27164 100644 --- a/internal/provider/group_resource.go +++ b/internal/provider/group_resource.go @@ -627,7 +627,7 @@ func (r *GroupResource) Schema(ctx context.Context, req resource.SchemaRequest, "operator": schema.StringAttribute{ Computed: true, Optional: true, - Default: stringdefault.StaticString("AND"), + Default: stringdefault.StaticString(`AND`), PlanModifiers: []planmodifier.String{ speakeasy_stringplanmodifier.SuppressDiff(speakeasy_stringplanmodifier.ExplicitSuppress), }, diff --git a/internal/provider/owners_data_source.go b/internal/provider/owners_data_source.go index 37f38d55..f223eace 100644 --- a/internal/provider/owners_data_source.go +++ b/internal/provider/owners_data_source.go @@ -29,10 +29,10 @@ type OwnersDataSource struct { // OwnersDataSourceModel describes the data model. type OwnersDataSourceModel struct { - Cursor types.String `tfsdk:"cursor"` - Name types.String `tfsdk:"name"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` + Name types.String `queryParam:"style=form,explode=true,name=name" tfsdk:"name"` Next types.String `tfsdk:"next"` - PageSize types.Int64 `tfsdk:"page_size"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` Previous types.String `tfsdk:"previous"` Results []tfTypes.Owner `tfsdk:"results"` } diff --git a/internal/provider/requests_data_source.go b/internal/provider/requests_data_source.go index 5e2d7fbb..b4070f5e 100644 --- a/internal/provider/requests_data_source.go +++ b/internal/provider/requests_data_source.go @@ -29,10 +29,10 @@ type RequestsDataSource struct { // RequestsDataSourceModel describes the data model. type RequestsDataSourceModel struct { - Cursor types.String `tfsdk:"cursor"` - PageSize types.Int64 `tfsdk:"page_size"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` Requests []tfTypes.Request `tfsdk:"requests"` - ShowPendingOnly types.Bool `tfsdk:"show_pending_only"` + ShowPendingOnly types.Bool `queryParam:"style=form,explode=true,name=show_pending_only" tfsdk:"show_pending_only"` } // Metadata returns the data source type name. diff --git a/internal/provider/resource_resource.go b/internal/provider/resource_resource.go index 877ea30e..984c7481 100644 --- a/internal/provider/resource_resource.go +++ b/internal/provider/resource_resource.go @@ -1044,7 +1044,7 @@ func (r *ResourceResource) Schema(ctx context.Context, req resource.SchemaReques "operator": schema.StringAttribute{ Computed: true, Optional: true, - Default: stringdefault.StaticString("AND"), + Default: stringdefault.StaticString(`AND`), PlanModifiers: []planmodifier.String{ speakeasy_stringplanmodifier.SuppressDiff(speakeasy_stringplanmodifier.ExplicitSuppress), }, diff --git a/internal/provider/resources_list_data_source.go b/internal/provider/resources_list_data_source.go index 4052430a..31df0515 100644 --- a/internal/provider/resources_list_data_source.go +++ b/internal/provider/resources_list_data_source.go @@ -30,14 +30,14 @@ type ResourcesListDataSource struct { // ResourcesListDataSourceModel describes the data model. type ResourcesListDataSourceModel struct { - Cursor types.String `tfsdk:"cursor"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` Next types.String `tfsdk:"next"` - PageSize types.Int64 `tfsdk:"page_size"` - ParentResourceID types.String `tfsdk:"parent_resource_id"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` + ParentResourceID types.String `queryParam:"style=form,explode=false,name=parent_resource_id" tfsdk:"parent_resource_id"` Previous types.String `tfsdk:"previous"` - ResourceIds []types.String `tfsdk:"resource_ids"` - ResourceName types.String `tfsdk:"resource_name"` - ResourceTypeFilter types.String `tfsdk:"resource_type_filter"` + ResourceIds []types.String `queryParam:"style=form,explode=false,name=resource_ids" tfsdk:"resource_ids"` + ResourceName types.String `queryParam:"style=form,explode=true,name=resource_name" tfsdk:"resource_name"` + ResourceTypeFilter types.String `queryParam:"style=form,explode=true,name=resource_type_filter" tfsdk:"resource_type_filter"` Results []tfTypes.Resource `tfsdk:"results"` } diff --git a/internal/provider/resourcesaccessstatus_data_source.go b/internal/provider/resourcesaccessstatus_data_source.go index 93f69de9..ac8cfe59 100644 --- a/internal/provider/resourcesaccessstatus_data_source.go +++ b/internal/provider/resourcesaccessstatus_data_source.go @@ -30,10 +30,10 @@ type ResourcesAccessStatusDataSource struct { // ResourcesAccessStatusDataSourceModel describes the data model. type ResourcesAccessStatusDataSourceModel struct { AccessLevel *tfTypes.ResourceAccessLevel `tfsdk:"access_level"` - AccessLevelRemoteID types.String `tfsdk:"access_level_remote_id"` - Cursor types.String `tfsdk:"cursor"` + AccessLevelRemoteID types.String `queryParam:"style=form,explode=true,name=access_level_remote_id" tfsdk:"access_level_remote_id"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` ExpirationDate types.String `tfsdk:"expiration_date"` - PageSize types.Int64 `tfsdk:"page_size"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` ResourceID types.String `tfsdk:"resource_id"` Status types.String `tfsdk:"status"` UserID types.String `tfsdk:"user_id"` diff --git a/internal/provider/resourcesusers_list_data_source.go b/internal/provider/resourcesusers_list_data_source.go index c9cf7661..3c98f2f4 100644 --- a/internal/provider/resourcesusers_list_data_source.go +++ b/internal/provider/resourcesusers_list_data_source.go @@ -29,7 +29,7 @@ type ResourcesUsersListDataSource struct { // ResourcesUsersListDataSourceModel describes the data model. type ResourcesUsersListDataSourceModel struct { - Limit types.Int64 `tfsdk:"limit"` + Limit types.Int64 `queryParam:"style=form,explode=true,name=limit" tfsdk:"limit"` ResourceID types.String `tfsdk:"resource_id"` Results []tfTypes.ResourceAccessUser `tfsdk:"results"` } @@ -93,7 +93,7 @@ func (r *ResourcesUsersListDataSource) Schema(ctx context.Context, req datasourc Computed: true, Description: `The user has direct access to this resources (vs. indirectly, like through a group).`, }, - "num_access_paths": schema.Int64Attribute{ + "num_access_paths": schema.Int32Attribute{ Computed: true, Description: `The number of ways in which the user has access through this resource (directly and indirectly).`, }, diff --git a/internal/provider/resourcesusers_list_data_source_sdk.go b/internal/provider/resourcesusers_list_data_source_sdk.go index 6028c74c..3b322c69 100644 --- a/internal/provider/resourcesusers_list_data_source_sdk.go +++ b/internal/provider/resourcesusers_list_data_source_sdk.go @@ -27,7 +27,7 @@ func (r *ResourcesUsersListDataSourceModel) RefreshFromSharedResourceAccessUserL } results1.FullName = types.StringValue(resultsItem.FullName) results1.HasDirectAccess = types.BoolValue(resultsItem.HasDirectAccess) - results1.NumAccessPaths = types.Int64Value(int64(resultsItem.NumAccessPaths)) + results1.NumAccessPaths = types.Int32Value(int32(resultsItem.NumAccessPaths)) if resultsItem.PropagationStatus == nil { results1.PropagationStatus = nil } else { diff --git a/internal/provider/sessions_data_source.go b/internal/provider/sessions_data_source.go index 406f7652..40ec0369 100644 --- a/internal/provider/sessions_data_source.go +++ b/internal/provider/sessions_data_source.go @@ -31,9 +31,9 @@ type SessionsDataSource struct { type SessionsDataSourceModel struct { Next types.String `tfsdk:"next"` Previous types.String `tfsdk:"previous"` - ResourceID types.String `tfsdk:"resource_id"` + ResourceID types.String `queryParam:"style=form,explode=true,name=resource_id" tfsdk:"resource_id"` Results []tfTypes.Session `tfsdk:"results"` - UserID types.String `tfsdk:"user_id"` + UserID types.String `queryParam:"style=form,explode=true,name=user_id" tfsdk:"user_id"` } // Metadata returns the data source type name. diff --git a/internal/provider/tags_list_data_source.go b/internal/provider/tags_list_data_source.go index 777fa32d..aa4a3d71 100644 --- a/internal/provider/tags_list_data_source.go +++ b/internal/provider/tags_list_data_source.go @@ -29,9 +29,9 @@ type TagsListDataSource struct { // TagsListDataSourceModel describes the data model. type TagsListDataSourceModel struct { - Cursor types.String `tfsdk:"cursor"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` Next types.String `tfsdk:"next"` - PageSize types.Int64 `tfsdk:"page_size"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` Previous types.String `tfsdk:"previous"` Results []tfTypes.Tag `tfsdk:"results"` } diff --git a/internal/provider/types/field_value.go b/internal/provider/types/field_value.go index e190374f..7476c927 100644 --- a/internal/provider/types/field_value.go +++ b/internal/provider/types/field_value.go @@ -5,6 +5,6 @@ package types import "github.com/hashicorp/terraform-plugin-framework/types" type FieldValue struct { - Str types.String `tfsdk:"str" tfPlanOnly:"true"` - Boolean types.Bool `tfsdk:"boolean" tfPlanOnly:"true"` + Str types.String `queryParam:"inline" tfsdk:"str" tfPlanOnly:"true"` + Boolean types.Bool `queryParam:"inline" tfsdk:"boolean" tfPlanOnly:"true"` } diff --git a/internal/provider/types/resource_access_user.go b/internal/provider/types/resource_access_user.go index 2761990b..1a0c86b8 100644 --- a/internal/provider/types/resource_access_user.go +++ b/internal/provider/types/resource_access_user.go @@ -10,7 +10,7 @@ type ResourceAccessUser struct { ExpirationDate types.String `tfsdk:"expiration_date"` FullName types.String `tfsdk:"full_name"` HasDirectAccess types.Bool `tfsdk:"has_direct_access"` - NumAccessPaths types.Int64 `tfsdk:"num_access_paths"` + NumAccessPaths types.Int32 `tfsdk:"num_access_paths"` PropagationStatus *PropagationStatus `tfsdk:"propagation_status"` ResourceID types.String `tfsdk:"resource_id"` UserID types.String `tfsdk:"user_id"` diff --git a/internal/provider/uars_list_data_source.go b/internal/provider/uars_list_data_source.go index 2d46ac7d..80cafd3e 100644 --- a/internal/provider/uars_list_data_source.go +++ b/internal/provider/uars_list_data_source.go @@ -29,9 +29,9 @@ type UARSListDataSource struct { // UARSListDataSourceModel describes the data model. type UARSListDataSourceModel struct { - Cursor types.String `tfsdk:"cursor"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` Next types.String `tfsdk:"next"` - PageSize types.Int64 `tfsdk:"page_size"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` Previous types.String `tfsdk:"previous"` Results []tfTypes.Uar `tfsdk:"results"` } diff --git a/internal/provider/user_data_source.go b/internal/provider/user_data_source.go index 02a7bdce..606b14f6 100644 --- a/internal/provider/user_data_source.go +++ b/internal/provider/user_data_source.go @@ -28,10 +28,10 @@ type UserDataSource struct { // UserDataSourceModel describes the data model. type UserDataSourceModel struct { - Email types.String `tfsdk:"email"` + Email types.String `queryParam:"style=form,explode=true,name=email" tfsdk:"email"` FirstName types.String `tfsdk:"first_name"` HrIdpStatus types.String `tfsdk:"hr_idp_status"` - ID types.String `tfsdk:"id"` + ID types.String `queryParam:"style=form,explode=true,name=user_id" tfsdk:"id"` LastName types.String `tfsdk:"last_name"` Name types.String `tfsdk:"name"` Position types.String `tfsdk:"position"` diff --git a/internal/provider/users_data_source.go b/internal/provider/users_data_source.go index a72d72e4..04b22b38 100644 --- a/internal/provider/users_data_source.go +++ b/internal/provider/users_data_source.go @@ -29,9 +29,9 @@ type UsersDataSource struct { // UsersDataSourceModel describes the data model. type UsersDataSourceModel struct { - Cursor types.String `tfsdk:"cursor"` + Cursor types.String `queryParam:"style=form,explode=true,name=cursor" tfsdk:"cursor"` Next types.String `tfsdk:"next"` - PageSize types.Int64 `tfsdk:"page_size"` + PageSize types.Int64 `queryParam:"style=form,explode=true,name=page_size" tfsdk:"page_size"` Previous types.String `tfsdk:"previous"` Results []tfTypes.User `tfsdk:"results"` } diff --git a/internal/sdk/apps.go b/internal/sdk/apps.go index 60ed7d6f..f28fc6cf 100644 --- a/internal/sdk/apps.go +++ b/internal/sdk/apps.go @@ -29,13 +29,6 @@ func newApps(sdkConfig sdkConfiguration) *Apps { // Get - Returns a list of `App` objects. func (s *Apps) Get(ctx context.Context, request operations.GetAppsRequest, opts ...operations.Option) (*operations.GetAppsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getApps", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,14 @@ func (s *Apps) Get(ctx context.Context, request operations.GetAppsRequest, opts return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getApps", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -227,13 +228,6 @@ func (s *Apps) Get(ctx context.Context, request operations.GetAppsRequest, opts // GetSyncErrors - Returns a list of recent sync errors that have occurred since the last successful sync. func (s *Apps) GetSyncErrors(ctx context.Context, request operations.GetSyncErrorsRequest, opts ...operations.Option) (*operations.GetSyncErrorsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getSyncErrors", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -257,6 +251,14 @@ func (s *Apps) GetSyncErrors(ctx context.Context, request operations.GetSyncErro return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getSyncErrors", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -424,13 +426,6 @@ func (s *Apps) GetSyncErrors(ctx context.Context, request operations.GetSyncErro // GetID - Returns an `App` object. func (s *Apps) GetID(ctx context.Context, request operations.GetAppIDRequest, opts ...operations.Option) (*operations.GetAppIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getAppID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -454,6 +449,14 @@ func (s *Apps) GetID(ctx context.Context, request operations.GetAppIDRequest, op return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getAppID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/configurationtemplates.go b/internal/sdk/configurationtemplates.go index 0b0d360e..9cafb82b 100644 --- a/internal/sdk/configurationtemplates.go +++ b/internal/sdk/configurationtemplates.go @@ -29,13 +29,6 @@ func newConfigurationTemplates(sdkConfig sdkConfiguration) *ConfigurationTemplat // Create - Creates a configuration template. func (s *ConfigurationTemplates) Create(ctx context.Context, request shared.CreateConfigurationTemplateInfo, opts ...operations.Option) (*operations.CreateConfigurationTemplateResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createConfigurationTemplate", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *ConfigurationTemplates) Create(ctx context.Context, request shared.Crea return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createConfigurationTemplate", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *ConfigurationTemplates) Create(ctx context.Context, request shared.Crea // Delete - Deletes a configuration template. func (s *ConfigurationTemplates) Delete(ctx context.Context, request operations.DeleteConfigurationTemplateRequest, opts ...operations.Option) (*operations.DeleteConfigurationTemplateResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteConfigurationTemplate", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,14 @@ func (s *ConfigurationTemplates) Delete(ctx context.Context, request operations. return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteConfigurationTemplate", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -403,13 +404,6 @@ func (s *ConfigurationTemplates) Delete(ctx context.Context, request operations. // Get - Returns a list of `ConfigurationTemplate` objects. func (s *ConfigurationTemplates) Get(ctx context.Context, opts ...operations.Option) (*operations.GetConfigurationTemplatesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getConfigurationTemplates", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -433,6 +427,14 @@ func (s *ConfigurationTemplates) Get(ctx context.Context, opts ...operations.Opt return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getConfigurationTemplates", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -597,13 +599,6 @@ func (s *ConfigurationTemplates) Get(ctx context.Context, opts ...operations.Opt // Update a configuration template. func (s *ConfigurationTemplates) Update(ctx context.Context, request shared.UpdateConfigurationTemplateInfo, opts ...operations.Option) (*operations.UpdateConfigurationTemplateResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateConfigurationTemplate", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -627,6 +622,13 @@ func (s *ConfigurationTemplates) Update(ctx context.Context, request shared.Upda return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateConfigurationTemplate", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err diff --git a/internal/sdk/events.go b/internal/sdk/events.go index e2e50ba0..7f895f3d 100644 --- a/internal/sdk/events.go +++ b/internal/sdk/events.go @@ -29,13 +29,6 @@ func newEvents(sdkConfig sdkConfiguration) *Events { // Get - Returns a list of `Event` objects. func (s *Events) Get(ctx context.Context, request operations.GetEventsRequest, opts ...operations.Option) (*operations.GetEventsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getEvents", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,14 @@ func (s *Events) Get(ctx context.Context, request operations.GetEventsRequest, o return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getEvents", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/groupbindings.go b/internal/sdk/groupbindings.go index 95299dea..94718b0c 100644 --- a/internal/sdk/groupbindings.go +++ b/internal/sdk/groupbindings.go @@ -28,13 +28,6 @@ func newGroupBindings(sdkConfig sdkConfiguration) *GroupBindings { // CreateGroupBinding - Creates a group binding. func (s *GroupBindings) CreateGroupBinding(ctx context.Context, request shared.CreateGroupBindingInfo, opts ...operations.Option) (*operations.CreateGroupBindingResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createGroupBinding", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -58,6 +51,13 @@ func (s *GroupBindings) CreateGroupBinding(ctx context.Context, request shared.C return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createGroupBinding", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -229,13 +229,6 @@ func (s *GroupBindings) CreateGroupBinding(ctx context.Context, request shared.C // DeleteGroupBinding - Deletes a group binding. func (s *GroupBindings) DeleteGroupBinding(ctx context.Context, request operations.DeleteGroupBindingRequest, opts ...operations.Option) (*operations.DeleteGroupBindingResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteGroupBinding", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -259,6 +252,14 @@ func (s *GroupBindings) DeleteGroupBinding(ctx context.Context, request operatio return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteGroupBinding", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -402,13 +403,6 @@ func (s *GroupBindings) DeleteGroupBinding(ctx context.Context, request operatio // GetGroupBinding - Returns a `GroupBinding` object. func (s *GroupBindings) GetGroupBinding(ctx context.Context, request operations.GetGroupBindingRequest, opts ...operations.Option) (*operations.GetGroupBindingResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupBinding", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -432,6 +426,14 @@ func (s *GroupBindings) GetGroupBinding(ctx context.Context, request operations. return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupBinding", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -596,13 +598,6 @@ func (s *GroupBindings) GetGroupBinding(ctx context.Context, request operations. // GetGroupBindings - Returns a list of `GroupBinding` objects. func (s *GroupBindings) GetGroupBindings(ctx context.Context, request operations.GetGroupBindingsRequest, opts ...operations.Option) (*operations.GetGroupBindingsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupBindings", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -626,6 +621,14 @@ func (s *GroupBindings) GetGroupBindings(ctx context.Context, request operations return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupBindings", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -794,13 +797,6 @@ func (s *GroupBindings) GetGroupBindings(ctx context.Context, request operations // UpdateGroupBindings - Bulk updates a list of group bindings. func (s *GroupBindings) UpdateGroupBindings(ctx context.Context, request shared.UpdateGroupBindingInfoList, opts ...operations.Option) (*operations.UpdateGroupBindingsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateGroupBindings", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -824,6 +820,13 @@ func (s *GroupBindings) UpdateGroupBindings(ctx context.Context, request shared. return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateGroupBindings", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err diff --git a/internal/sdk/groups.go b/internal/sdk/groups.go index 3d11ae70..604d1eab 100644 --- a/internal/sdk/groups.go +++ b/internal/sdk/groups.go @@ -29,13 +29,6 @@ func newGroups(sdkConfig sdkConfiguration) *Groups { // Create - Creates a group. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing groups. func (s *Groups) Create(ctx context.Context, request shared.CreateGroupInfo, opts ...operations.Option) (*operations.CreateGroupResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createGroup", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *Groups) Create(ctx context.Context, request shared.CreateGroupInfo, opt return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createGroup", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *Groups) Create(ctx context.Context, request shared.CreateGroupInfo, opt // CreateResources - Adds a resource to a group. func (s *Groups) CreateResources(ctx context.Context, request operations.CreateGroupResourcesRequest, opts ...operations.Option) (*operations.CreateGroupResourcesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createGroupResources", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,13 @@ func (s *Groups) CreateResources(ctx context.Context, request operations.CreateG return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createGroupResources", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -435,13 +435,6 @@ func (s *Groups) CreateResources(ctx context.Context, request operations.CreateG // CreateUser - Adds a user to this group. func (s *Groups) CreateUser(ctx context.Context, request operations.CreateGroupUserRequest, opts ...operations.Option) (*operations.CreateGroupUserResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createGroupUser", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -465,6 +458,13 @@ func (s *Groups) CreateUser(ctx context.Context, request operations.CreateGroupU return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createGroupUser", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -636,13 +636,6 @@ func (s *Groups) CreateUser(ctx context.Context, request operations.CreateGroupU // Delete - Deletes a group. func (s *Groups) Delete(ctx context.Context, request operations.DeleteGroupRequest, opts ...operations.Option) (*operations.DeleteGroupResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteGroup", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -666,6 +659,14 @@ func (s *Groups) Delete(ctx context.Context, request operations.DeleteGroupReque return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteGroup", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -809,13 +810,6 @@ func (s *Groups) Delete(ctx context.Context, request operations.DeleteGroupReque // DeleteUser - Removes a user's access from this group. func (s *Groups) DeleteUser(ctx context.Context, request operations.DeleteGroupUserRequest, opts ...operations.Option) (*operations.DeleteGroupUserResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteGroupUser", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -839,6 +833,14 @@ func (s *Groups) DeleteUser(ctx context.Context, request operations.DeleteGroupU return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteGroupUser", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -982,13 +984,6 @@ func (s *Groups) DeleteUser(ctx context.Context, request operations.DeleteGroupU // GetGroup - Returns a `Group` object. func (s *Groups) GetGroup(ctx context.Context, request operations.GetGroupRequest, opts ...operations.Option) (*operations.GetGroupResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroup", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1012,6 +1007,14 @@ func (s *Groups) GetGroup(ctx context.Context, request operations.GetGroupReques return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroup", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1176,13 +1179,6 @@ func (s *Groups) GetGroup(ctx context.Context, request operations.GetGroupReques // GetMessageChannels - Gets the list of audit and reviewer message channels attached to a group. func (s *Groups) GetMessageChannels(ctx context.Context, request operations.GetGroupMessageChannelsRequest, opts ...operations.Option) (*operations.GetGroupMessageChannelsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupMessageChannels", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1206,6 +1202,14 @@ func (s *Groups) GetMessageChannels(ctx context.Context, request operations.GetG return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupMessageChannels", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1370,13 +1374,6 @@ func (s *Groups) GetMessageChannels(ctx context.Context, request operations.GetG // GetOnCallSchedule - Gets the list of on call schedules attached to a group. func (s *Groups) GetOnCallSchedule(ctx context.Context, request operations.GetGroupOnCallSchedulesRequest, opts ...operations.Option) (*operations.GetGroupOnCallSchedulesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupOnCallSchedules", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1400,6 +1397,14 @@ func (s *Groups) GetOnCallSchedule(ctx context.Context, request operations.GetGr return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupOnCallSchedules", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1564,13 +1569,6 @@ func (s *Groups) GetOnCallSchedule(ctx context.Context, request operations.GetGr // GetResources - Gets the list of resources that the group gives access to. func (s *Groups) GetResources(ctx context.Context, request operations.GetGroupResourcesRequest, opts ...operations.Option) (*operations.GetGroupResourcesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupResources", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1594,6 +1592,14 @@ func (s *Groups) GetResources(ctx context.Context, request operations.GetGroupRe return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupResources", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1760,13 +1766,6 @@ func (s *Groups) GetResources(ctx context.Context, request operations.GetGroupRe // // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. func (s *Groups) GetReviewersStages(ctx context.Context, request operations.GetGroupReviewersStagesRequest, opts ...operations.Option) (*operations.GetGroupReviewersStagesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupReviewersStages", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1790,6 +1789,14 @@ func (s *Groups) GetReviewersStages(ctx context.Context, request operations.GetG return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupReviewersStages", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1954,13 +1961,6 @@ func (s *Groups) GetReviewersStages(ctx context.Context, request operations.GetG // GetTags - Returns all tags applied to the group. func (s *Groups) GetTags(ctx context.Context, request operations.GetGroupTagsRequest, opts ...operations.Option) (*operations.GetGroupTagsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupTags", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1984,6 +1984,14 @@ func (s *Groups) GetTags(ctx context.Context, request operations.GetGroupTagsReq return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupTags", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -2148,13 +2156,6 @@ func (s *Groups) GetTags(ctx context.Context, request operations.GetGroupTagsReq // GetUsers - Gets the list of users for this group. func (s *Groups) GetUsers(ctx context.Context, request operations.GetGroupUsersRequest, opts ...operations.Option) (*operations.GetGroupUsersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupUsers", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2178,6 +2179,14 @@ func (s *Groups) GetUsers(ctx context.Context, request operations.GetGroupUsersR return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupUsers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -2342,13 +2351,6 @@ func (s *Groups) GetUsers(ctx context.Context, request operations.GetGroupUsersR // GetVisibility - Gets the visibility of this group. func (s *Groups) GetVisibility(ctx context.Context, request operations.GetGroupVisibilityRequest, opts ...operations.Option) (*operations.GetGroupVisibilityResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroupVisibility", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2372,6 +2374,14 @@ func (s *Groups) GetVisibility(ctx context.Context, request operations.GetGroupV return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroupVisibility", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -2536,13 +2546,6 @@ func (s *Groups) GetVisibility(ctx context.Context, request operations.GetGroupV // List - Returns a list of groups for your organization. func (s *Groups) List(ctx context.Context, request operations.GetGroupsRequest, opts ...operations.Option) (*operations.GetGroupsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getGroups", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2566,6 +2569,14 @@ func (s *Groups) List(ctx context.Context, request operations.GetGroupsRequest, return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getGroups", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -2734,13 +2745,6 @@ func (s *Groups) List(ctx context.Context, request operations.GetGroupsRequest, // Update - Bulk updates a list of groups. func (s *Groups) Update(ctx context.Context, request shared.UpdateGroupInfoList, opts ...operations.Option) (*operations.UpdateGroupsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateGroups", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2764,6 +2768,13 @@ func (s *Groups) Update(ctx context.Context, request shared.UpdateGroupInfoList, return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateGroups", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -2935,13 +2946,6 @@ func (s *Groups) Update(ctx context.Context, request shared.UpdateGroupInfoList, // UpdateMessageChannels - Sets the list of audit message channels attached to a group. func (s *Groups) UpdateMessageChannels(ctx context.Context, request operations.UpdateGroupMessageChannelsRequest, opts ...operations.Option) (*operations.UpdateGroupMessageChannelsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateGroupMessageChannels", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2965,6 +2969,13 @@ func (s *Groups) UpdateMessageChannels(ctx context.Context, request operations.U return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateGroupMessageChannels", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "MessageChannelIDList", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -3116,13 +3127,6 @@ func (s *Groups) UpdateMessageChannels(ctx context.Context, request operations.U // UpdateOnCallSchedule - Sets the list of on call schedules attached to a group. func (s *Groups) UpdateOnCallSchedule(ctx context.Context, request operations.UpdateGroupOnCallSchedulesRequest, opts ...operations.Option) (*operations.UpdateGroupOnCallSchedulesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateGroupOnCallSchedules", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -3146,6 +3150,13 @@ func (s *Groups) UpdateOnCallSchedule(ctx context.Context, request operations.Up return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateGroupOnCallSchedules", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "OnCallScheduleIDList", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -3297,13 +3308,6 @@ func (s *Groups) UpdateOnCallSchedule(ctx context.Context, request operations.Up // UpdateResources - Sets the list of resources that the group gives access to. func (s *Groups) UpdateResources(ctx context.Context, request operations.UpdateGroupResourcesRequest, opts ...operations.Option) (*operations.UpdateGroupResourcesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateGroupResources", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -3327,6 +3331,13 @@ func (s *Groups) UpdateResources(ctx context.Context, request operations.UpdateG return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateGroupResources", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpdateGroupResourcesInfo", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -3480,13 +3491,6 @@ func (s *Groups) UpdateResources(ctx context.Context, request operations.UpdateG // // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. func (s *Groups) UpdateReviewersStages(ctx context.Context, request operations.UpdateGroupReviewersStagesRequest, opts ...operations.Option) (*operations.UpdateGroupReviewersStagesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateGroupReviewersStages", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -3510,6 +3514,13 @@ func (s *Groups) UpdateReviewersStages(ctx context.Context, request operations.U return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateGroupReviewersStages", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ReviewerStageList", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -3681,13 +3692,6 @@ func (s *Groups) UpdateReviewersStages(ctx context.Context, request operations.U // UpdateVisibility - Sets the visibility of this group. func (s *Groups) UpdateVisibility(ctx context.Context, request operations.UpdateGroupVisibilityRequest, opts ...operations.Option) (*operations.UpdateGroupVisibilityResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateGroupVisibility", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -3711,6 +3715,13 @@ func (s *Groups) UpdateVisibility(ctx context.Context, request operations.Update return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateGroupVisibility", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "VisibilityInfo", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err diff --git a/internal/sdk/idpgroupmappings.go b/internal/sdk/idpgroupmappings.go index 1a990310..9faf0733 100644 --- a/internal/sdk/idpgroupmappings.go +++ b/internal/sdk/idpgroupmappings.go @@ -27,13 +27,6 @@ func newIdpGroupMappings(sdkConfig sdkConfiguration) *IdpGroupMappings { // DeleteIdpGroupMappings - Deletes an `IdpGroupMapping` object. func (s *IdpGroupMappings) DeleteIdpGroupMappings(ctx context.Context, request operations.DeleteIdpGroupMappingsRequest, opts ...operations.Option) (*operations.DeleteIdpGroupMappingsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "delete_idp_group_mappings", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -57,6 +50,14 @@ func (s *IdpGroupMappings) DeleteIdpGroupMappings(ctx context.Context, request o return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "delete_idp_group_mappings", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -200,13 +201,6 @@ func (s *IdpGroupMappings) DeleteIdpGroupMappings(ctx context.Context, request o // GetIdpGroupMappings - Returns the configured set of available `IdpGroupMapping` objects for an Okta app. func (s *IdpGroupMappings) GetIdpGroupMappings(ctx context.Context, request operations.GetIdpGroupMappingsRequest, opts ...operations.Option) (*operations.GetIdpGroupMappingsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getIdpGroupMappings", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -230,6 +224,14 @@ func (s *IdpGroupMappings) GetIdpGroupMappings(ctx context.Context, request oper return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getIdpGroupMappings", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -393,13 +395,6 @@ func (s *IdpGroupMappings) GetIdpGroupMappings(ctx context.Context, request oper // UpdateIdpGroupMappings - Updates the list of available `IdpGroupMapping` objects for an Okta app. func (s *IdpGroupMappings) UpdateIdpGroupMappings(ctx context.Context, request operations.UpdateIdpGroupMappingsRequest, opts ...operations.Option) (*operations.UpdateIdpGroupMappingsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateIdpGroupMappings", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -423,6 +418,13 @@ func (s *IdpGroupMappings) UpdateIdpGroupMappings(ctx context.Context, request o return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateIdpGroupMappings", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err diff --git a/internal/sdk/internal/hooks/hooks.go b/internal/sdk/internal/hooks/hooks.go index 8ea491ae..a0b49da2 100644 --- a/internal/sdk/internal/hooks/hooks.go +++ b/internal/sdk/internal/hooks/hooks.go @@ -24,6 +24,7 @@ type HTTPClient interface { } type HookContext struct { + BaseURL string Context context.Context OperationID string OAuth2Scopes []string diff --git a/internal/sdk/internal/utils/form.go b/internal/sdk/internal/utils/form.go index ae81d78b..42ba1375 100644 --- a/internal/sdk/internal/utils/form.go +++ b/internal/sdk/internal/utils/form.go @@ -15,11 +15,15 @@ import ( "github.com/opalsecurity/terraform-provider-opal/internal/sdk/types" ) -func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, getFieldName func(reflect.StructField) string) url.Values { +func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string, getFieldName func(reflect.StructField) string) url.Values { formValues := url.Values{} if isNil(objType, objValue) { + if defaultValue != nil { + formValues.Add(paramName, *defaultValue) + } + return formValues } diff --git a/internal/sdk/internal/utils/queryparams.go b/internal/sdk/internal/utils/queryparams.go index 69b0fc44..75f31fd9 100644 --- a/internal/sdk/internal/utils/queryparams.go +++ b/internal/sdk/internal/utils/queryparams.go @@ -71,6 +71,8 @@ func populateQueryParams(queryParams interface{}, globals interface{}, values ur continue } + defaultValue := parseDefaultTag(fieldType) + if globals != nil { var globalFound bool fieldType, valType, globalFound = populateFromGlobals(fieldType, valType, queryParamTagKey, globals) @@ -97,14 +99,14 @@ func populateQueryParams(queryParams interface{}, globals interface{}, values ur } } case "form": - vals := populateFormParams(qpTag, fieldType.Type, valType, ",") + vals := populateFormParams(qpTag, fieldType.Type, valType, ",", defaultValue) for k, v := range vals { for _, vv := range v { values.Add(k, vv) } } case "pipeDelimited": - vals := populateFormParams(qpTag, fieldType.Type, valType, "|") + vals := populateFormParams(qpTag, fieldType.Type, valType, "|", defaultValue) for k, v := range vals { for _, vv := range v { values.Add(k, vv) @@ -246,8 +248,8 @@ func populateDeepObjectParamsStruct(qsValues url.Values, priorScope string, stru } } -func populateFormParams(tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string) url.Values { - return populateForm(tag.ParamName, tag.Explode, objType, objValue, delimiter, func(fieldType reflect.StructField) string { +func populateFormParams(tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string) url.Values { + return populateForm(tag.ParamName, tag.Explode, objType, objValue, delimiter, defaultValue, func(fieldType reflect.StructField) string { qpTag := parseQueryParamTag(fieldType) if qpTag == nil { return "" diff --git a/internal/sdk/internal/utils/requestbody.go b/internal/sdk/internal/utils/requestbody.go index 78479c6b..8fe01ad4 100644 --- a/internal/sdk/internal/utils/requestbody.go +++ b/internal/sdk/internal/utils/requestbody.go @@ -292,7 +292,7 @@ func encodeFormData(fieldName string, w io.Writer, data interface{}) error { switch tag.Style { // TODO: support other styles case "form": - values := populateForm(tag.Name, tag.Explode, fieldType, valType, ",", func(sf reflect.StructField) string { + values := populateForm(tag.Name, tag.Explode, fieldType, valType, ",", nil, func(sf reflect.StructField) string { tag := parseFormTag(field) if tag == nil { return "" diff --git a/internal/sdk/internal/utils/utils.go b/internal/sdk/internal/utils/utils.go index 49cba6d1..6f1f538b 100644 --- a/internal/sdk/internal/utils/utils.go +++ b/internal/sdk/internal/utils/utils.go @@ -106,6 +106,16 @@ func parseConstTag(field reflect.StructField) *string { return &value } +func parseDefaultTag(field reflect.StructField) *string { + value := field.Tag.Get("default") + + if value == "" { + return nil + } + + return &value +} + func parseStructTag(tagKey string, field reflect.StructField) map[string]string { tag := field.Tag.Get(tagKey) if tag == "" { diff --git a/internal/sdk/messagechannels.go b/internal/sdk/messagechannels.go index 93847651..36e861f7 100644 --- a/internal/sdk/messagechannels.go +++ b/internal/sdk/messagechannels.go @@ -29,13 +29,6 @@ func newMessageChannels(sdkConfig sdkConfiguration) *MessageChannels { // Create - Creates a `MessageChannel` objects. func (s *MessageChannels) Create(ctx context.Context, request shared.CreateMessageChannelInfo, opts ...operations.Option) (*operations.CreateMessageChannelResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createMessageChannel", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *MessageChannels) Create(ctx context.Context, request shared.CreateMessa return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createMessageChannel", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *MessageChannels) Create(ctx context.Context, request shared.CreateMessa // Get - Returns a list of `MessageChannel` objects. func (s *MessageChannels) Get(ctx context.Context, opts ...operations.Option) (*operations.GetMessageChannelsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getMessageChannels", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,14 @@ func (s *MessageChannels) Get(ctx context.Context, opts ...operations.Option) (* return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getMessageChannels", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -424,13 +425,6 @@ func (s *MessageChannels) Get(ctx context.Context, opts ...operations.Option) (* // GetID - Gets a `MessageChannel` object. func (s *MessageChannels) GetID(ctx context.Context, request operations.GetMessageChannelIDRequest, opts ...operations.Option) (*operations.GetMessageChannelIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getMessageChannelID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -454,6 +448,14 @@ func (s *MessageChannels) GetID(ctx context.Context, request operations.GetMessa return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getMessageChannelID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/nonhumanidentities.go b/internal/sdk/nonhumanidentities.go index 37fb5439..eb8b9ae8 100644 --- a/internal/sdk/nonhumanidentities.go +++ b/internal/sdk/nonhumanidentities.go @@ -28,13 +28,6 @@ func newNonHumanIdentities(sdkConfig sdkConfiguration) *NonHumanIdentities { // GetNhis - Returns a list of non-human identities for your organization. func (s *NonHumanIdentities) GetNhis(ctx context.Context, request operations.GetNhisRequest, opts ...operations.Option) (*operations.GetNhisResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "get_nhis", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -58,6 +51,14 @@ func (s *NonHumanIdentities) GetNhis(ctx context.Context, request operations.Get return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "get_nhis", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/oncallschedules.go b/internal/sdk/oncallschedules.go index 6ad33a71..c35f0fb7 100644 --- a/internal/sdk/oncallschedules.go +++ b/internal/sdk/oncallschedules.go @@ -29,13 +29,6 @@ func newOnCallSchedules(sdkConfig sdkConfiguration) *OnCallSchedules { // Create - Creates a `OnCallSchedule` objects. func (s *OnCallSchedules) Create(ctx context.Context, request shared.CreateOnCallScheduleInfo, opts ...operations.Option) (*operations.CreateOnCallScheduleResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createOnCallSchedule", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *OnCallSchedules) Create(ctx context.Context, request shared.CreateOnCal return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createOnCallSchedule", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *OnCallSchedules) Create(ctx context.Context, request shared.CreateOnCal // Get - Returns a list of `OnCallSchedule` objects. func (s *OnCallSchedules) Get(ctx context.Context, opts ...operations.Option) (*operations.GetOnCallScheduleResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getOnCallSchedule", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,14 @@ func (s *OnCallSchedules) Get(ctx context.Context, opts ...operations.Option) (* return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getOnCallSchedule", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -424,13 +425,6 @@ func (s *OnCallSchedules) Get(ctx context.Context, opts ...operations.Option) (* // GetID - Gets a `OnCallSchedule` object. func (s *OnCallSchedules) GetID(ctx context.Context, request operations.GetOnCallScheduleIDRequest, opts ...operations.Option) (*operations.GetOnCallScheduleIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getOnCallScheduleID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -454,6 +448,14 @@ func (s *OnCallSchedules) GetID(ctx context.Context, request operations.GetOnCal return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getOnCallScheduleID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/opalapi.go b/internal/sdk/opalapi.go index 95e374c0..3f089db4 100644 --- a/internal/sdk/opalapi.go +++ b/internal/sdk/opalapi.go @@ -185,9 +185,9 @@ func New(opts ...SDKOption) *OpalAPI { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0", - SDKVersion: "0.30.10", - GenVersion: "2.506.0", - UserAgent: "speakeasy-sdk/terraform 0.30.10 2.506.0 1.0 github.com/opalsecurity/terraform-provider-opal/internal/sdk", + SDKVersion: "0.31.0", + GenVersion: "2.518.1", + UserAgent: "speakeasy-sdk/terraform 0.31.0 2.518.1 1.0 github.com/opalsecurity/terraform-provider-opal/internal/sdk", Hooks: hooks.New(), }, } diff --git a/internal/sdk/owners.go b/internal/sdk/owners.go index 00418653..30fb6e15 100644 --- a/internal/sdk/owners.go +++ b/internal/sdk/owners.go @@ -29,13 +29,6 @@ func newOwners(sdkConfig sdkConfiguration) *Owners { // Create - Creates an owner. func (s *Owners) Create(ctx context.Context, request shared.CreateOwnerInfo, opts ...operations.Option) (*operations.CreateOwnerResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createOwner", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *Owners) Create(ctx context.Context, request shared.CreateOwnerInfo, opt return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createOwner", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *Owners) Create(ctx context.Context, request shared.CreateOwnerInfo, opt // Delete - Deletes an owner. func (s *Owners) Delete(ctx context.Context, request operations.DeleteOwnerRequest, opts ...operations.Option) (*operations.DeleteOwnerResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteOwner", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,14 @@ func (s *Owners) Delete(ctx context.Context, request operations.DeleteOwnerReque return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteOwner", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -403,13 +404,6 @@ func (s *Owners) Delete(ctx context.Context, request operations.DeleteOwnerReque // Get - Returns a list of `Owner` objects. func (s *Owners) Get(ctx context.Context, request operations.GetOwnersRequest, opts ...operations.Option) (*operations.GetOwnersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getOwners", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -433,6 +427,14 @@ func (s *Owners) Get(ctx context.Context, request operations.GetOwnersRequest, o return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getOwners", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -601,13 +603,6 @@ func (s *Owners) Get(ctx context.Context, request operations.GetOwnersRequest, o // GetFromName - Returns an `Owner` object. Does not support owners with `/` in their name, use /owners?name=... instead. func (s *Owners) GetFromName(ctx context.Context, request operations.GetOwnerFromNameRequest, opts ...operations.Option) (*operations.GetOwnerFromNameResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getOwnerFromName", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -631,6 +626,14 @@ func (s *Owners) GetFromName(ctx context.Context, request operations.GetOwnerFro return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getOwnerFromName", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -795,13 +798,6 @@ func (s *Owners) GetFromName(ctx context.Context, request operations.GetOwnerFro // GetID - Returns an `Owner` object. func (s *Owners) GetID(ctx context.Context, request operations.GetOwnerIDRequest, opts ...operations.Option) (*operations.GetOwnerIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getOwnerID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -825,6 +821,14 @@ func (s *Owners) GetID(ctx context.Context, request operations.GetOwnerIDRequest return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getOwnerID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -989,13 +993,6 @@ func (s *Owners) GetID(ctx context.Context, request operations.GetOwnerIDRequest // Update - Bulk updates a list of owners. func (s *Owners) Update(ctx context.Context, request shared.UpdateOwnerInfoList, opts ...operations.Option) (*operations.UpdateOwnersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateOwners", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1019,6 +1016,13 @@ func (s *Owners) Update(ctx context.Context, request shared.UpdateOwnerInfoList, return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateOwners", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -1190,13 +1194,6 @@ func (s *Owners) Update(ctx context.Context, request shared.UpdateOwnerInfoList, // UpdateUsers - Sets the list of users for this owner. If escalation is enabled, the order of this list is the escalation priority order of the users. If the owner has a source group, adding or removing users from this list won't be possible. func (s *Owners) UpdateUsers(ctx context.Context, request operations.UpdateOwnerUsersRequest, opts ...operations.Option) (*operations.UpdateOwnerUsersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "update_owner_users", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1220,6 +1217,13 @@ func (s *Owners) UpdateUsers(ctx context.Context, request operations.UpdateOwner return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "update_owner_users", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UserIDList", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err diff --git a/internal/sdk/requests.go b/internal/sdk/requests.go index 16fdc7d5..390b56d0 100644 --- a/internal/sdk/requests.go +++ b/internal/sdk/requests.go @@ -29,13 +29,6 @@ func newRequests(sdkConfig sdkConfiguration) *Requests { // CreateRequest - Create an access request func (s *Requests) CreateRequest(ctx context.Context, request shared.CreateRequestInfo, opts ...operations.Option) (*operations.CreateRequestResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createRequest", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *Requests) CreateRequest(ctx context.Context, request shared.CreateReque return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createRequest", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *Requests) CreateRequest(ctx context.Context, request shared.CreateReque // Get - Returns a list of requests for your organization that is visible by the admin. func (s *Requests) Get(ctx context.Context, request operations.GetRequestsRequest, opts ...operations.Option) (*operations.GetRequestsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getRequests", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,14 @@ func (s *Requests) Get(ctx context.Context, request operations.GetRequestsReques return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getRequests", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/resources.go b/internal/sdk/resources.go index ec5d0709..5d36b0a2 100644 --- a/internal/sdk/resources.go +++ b/internal/sdk/resources.go @@ -29,13 +29,6 @@ func newResources(sdkConfig sdkConfiguration) *Resources { // AddResourceNhi - Gives a non-human identity access to this resource. func (s *Resources) AddResourceNhi(ctx context.Context, request operations.AddResourceNhiRequest, opts ...operations.Option) (*operations.AddResourceNhiResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "add_resource_nhi", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *Resources) AddResourceNhi(ctx context.Context, request operations.AddRe return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "add_resource_nhi", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *Resources) AddResourceNhi(ctx context.Context, request operations.AddRe // Create - Creates a resource. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing resources. func (s *Resources) Create(ctx context.Context, request shared.CreateResourceInfo, opts ...operations.Option) (*operations.CreateResourceResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createResource", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,13 @@ func (s *Resources) Create(ctx context.Context, request shared.CreateResourceInf return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createResource", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -431,13 +431,6 @@ func (s *Resources) Create(ctx context.Context, request shared.CreateResourceInf // Delete - Deletes a resource. func (s *Resources) Delete(ctx context.Context, request operations.DeleteResourceRequest, opts ...operations.Option) (*operations.DeleteResourceResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteResource", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -461,6 +454,14 @@ func (s *Resources) Delete(ctx context.Context, request operations.DeleteResourc return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteResource", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -604,13 +605,6 @@ func (s *Resources) Delete(ctx context.Context, request operations.DeleteResourc // DeleteResourceNhi - Removes a non-human identity's direct access from this resource. func (s *Resources) DeleteResourceNhi(ctx context.Context, request operations.DeleteResourceNhiRequest, opts ...operations.Option) (*operations.DeleteResourceNhiResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "delete_resource_nhi", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -634,6 +628,14 @@ func (s *Resources) DeleteResourceNhi(ctx context.Context, request operations.De return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "delete_resource_nhi", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -781,13 +783,6 @@ func (s *Resources) DeleteResourceNhi(ctx context.Context, request operations.De // Get - Returns a list of resources for your organization. func (s *Resources) Get(ctx context.Context, request operations.GetResourcesRequest, opts ...operations.Option) (*operations.GetResourcesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResources", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -811,6 +806,14 @@ func (s *Resources) Get(ctx context.Context, request operations.GetResourcesRequ return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResources", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -979,13 +982,6 @@ func (s *Resources) Get(ctx context.Context, request operations.GetResourcesRequ // GetAccessStatus - Get user's access status to a resource. func (s *Resources) GetAccessStatus(ctx context.Context, request operations.GetResourceUserAccessStatusRequest, opts ...operations.Option) (*operations.GetResourceUserAccessStatusResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResourceUserAccessStatus", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1009,6 +1005,14 @@ func (s *Resources) GetAccessStatus(ctx context.Context, request operations.GetR return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResourceUserAccessStatus", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1177,13 +1181,6 @@ func (s *Resources) GetAccessStatus(ctx context.Context, request operations.GetR // GetID - Retrieves a resource. func (s *Resources) GetID(ctx context.Context, request operations.GetResourceIDRequest, opts ...operations.Option) (*operations.GetResourceIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResourceID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1207,6 +1204,14 @@ func (s *Resources) GetID(ctx context.Context, request operations.GetResourceIDR return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResourceID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1371,13 +1376,6 @@ func (s *Resources) GetID(ctx context.Context, request operations.GetResourceIDR // GetMessageChannels - Gets the list of audit message channels attached to a resource. func (s *Resources) GetMessageChannels(ctx context.Context, request operations.GetResourceMessageChannelsRequest, opts ...operations.Option) (*operations.GetResourceMessageChannelsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResourceMessageChannels", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1401,6 +1399,14 @@ func (s *Resources) GetMessageChannels(ctx context.Context, request operations.G return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResourceMessageChannels", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1565,13 +1571,6 @@ func (s *Resources) GetMessageChannels(ctx context.Context, request operations.G // GetResourceNhis - Gets the list of non-human identities with access to this resource. func (s *Resources) GetResourceNhis(ctx context.Context, request operations.GetResourceNhisRequest, opts ...operations.Option) (*operations.GetResourceNhisResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "get_resource_nhis", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1595,6 +1594,14 @@ func (s *Resources) GetResourceNhis(ctx context.Context, request operations.GetR return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "get_resource_nhis", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1763,13 +1770,6 @@ func (s *Resources) GetResourceNhis(ctx context.Context, request operations.GetR // GetReviewers - Gets the list of owner IDs of the reviewers for a resource. func (s *Resources) GetReviewers(ctx context.Context, request operations.GetResourceReviewersRequest, opts ...operations.Option) (*operations.GetResourceReviewersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResourceReviewers", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1793,6 +1793,14 @@ func (s *Resources) GetReviewers(ctx context.Context, request operations.GetReso return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResourceReviewers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1957,13 +1965,6 @@ func (s *Resources) GetReviewers(ctx context.Context, request operations.GetReso // GetTags - Returns all tags applied to the resource. func (s *Resources) GetTags(ctx context.Context, request operations.GetResourceTagsRequest, opts ...operations.Option) (*operations.GetResourceTagsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResourceTags", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1987,6 +1988,14 @@ func (s *Resources) GetTags(ctx context.Context, request operations.GetResourceT return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResourceTags", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -2151,13 +2160,6 @@ func (s *Resources) GetTags(ctx context.Context, request operations.GetResourceT // GetUsers - Gets the list of users for this resource. func (s *Resources) GetUsers(ctx context.Context, request operations.GetResourceUsersRequest, opts ...operations.Option) (*operations.GetResourceUsersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResourceUsers", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2181,6 +2183,14 @@ func (s *Resources) GetUsers(ctx context.Context, request operations.GetResource return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResourceUsers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -2349,13 +2359,6 @@ func (s *Resources) GetUsers(ctx context.Context, request operations.GetResource // GetVisibility - Gets the visibility of this resource. func (s *Resources) GetVisibility(ctx context.Context, request operations.GetResourceVisibilityRequest, opts ...operations.Option) (*operations.GetResourceVisibilityResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getResourceVisibility", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2379,6 +2382,14 @@ func (s *Resources) GetVisibility(ctx context.Context, request operations.GetRes return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getResourceVisibility", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -2543,13 +2554,6 @@ func (s *Resources) GetVisibility(ctx context.Context, request operations.GetRes // Update - Bulk updates a list of resources. func (s *Resources) Update(ctx context.Context, request shared.UpdateResourceInfoList, opts ...operations.Option) (*operations.UpdateResourcesResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateResources", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2573,6 +2577,13 @@ func (s *Resources) Update(ctx context.Context, request shared.UpdateResourceInf return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateResources", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -2744,13 +2755,6 @@ func (s *Resources) Update(ctx context.Context, request shared.UpdateResourceInf // UpdateMessageChannels - Sets the list of audit message channels attached to a resource. func (s *Resources) UpdateMessageChannels(ctx context.Context, request operations.UpdateResourceMessageChannelsRequest, opts ...operations.Option) (*operations.UpdateResourceMessageChannelsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateResourceMessageChannels", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2774,6 +2778,13 @@ func (s *Resources) UpdateMessageChannels(ctx context.Context, request operation return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateResourceMessageChannels", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "MessageChannelIDList", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -2945,13 +2956,6 @@ func (s *Resources) UpdateMessageChannels(ctx context.Context, request operation // UpdateReviewers - Sets the list of reviewers for a resource. func (s *Resources) UpdateReviewers(ctx context.Context, request operations.UpdateResourceReviewersRequest, opts ...operations.Option) (*operations.UpdateResourceReviewersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateResourceReviewers", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -2975,6 +2979,13 @@ func (s *Resources) UpdateReviewers(ctx context.Context, request operations.Upda return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateResourceReviewers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ReviewerIDList", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -3146,13 +3157,6 @@ func (s *Resources) UpdateReviewers(ctx context.Context, request operations.Upda // UpdateVisibility - Sets the visibility of this resource. func (s *Resources) UpdateVisibility(ctx context.Context, request operations.UpdateResourceVisibilityRequest, opts ...operations.Option) (*operations.UpdateResourceVisibilityResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "updateResourceVisibility", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -3176,6 +3180,13 @@ func (s *Resources) UpdateVisibility(ctx context.Context, request operations.Upd return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "updateResourceVisibility", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "VisibilityInfo", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err diff --git a/internal/sdk/sessions.go b/internal/sdk/sessions.go index 0dc5ce7d..21acd3db 100644 --- a/internal/sdk/sessions.go +++ b/internal/sdk/sessions.go @@ -29,13 +29,6 @@ func newSessions(sdkConfig sdkConfiguration) *Sessions { // Get - Returns a list of `Session` objects. func (s *Sessions) Get(ctx context.Context, request operations.GetSessionsRequest, opts ...operations.Option) (*operations.GetSessionsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getSessions", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,14 @@ func (s *Sessions) Get(ctx context.Context, request operations.GetSessionsReques return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getSessions", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/tags.go b/internal/sdk/tags.go index 17b21ef0..e8a56e13 100644 --- a/internal/sdk/tags.go +++ b/internal/sdk/tags.go @@ -29,13 +29,6 @@ func newTags(sdkConfig sdkConfiguration) *Tags { // CreateTag - Creates a tag with the given key and value. func (s *Tags) CreateTag(ctx context.Context, request shared.CreateTagInfo, opts ...operations.Option) (*operations.CreateTagResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createTag", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *Tags) CreateTag(ctx context.Context, request shared.CreateTagInfo, opts return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createTag", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *Tags) CreateTag(ctx context.Context, request shared.CreateTagInfo, opts // CreateGroup - Applies a tag to a group. func (s *Tags) CreateGroup(ctx context.Context, request operations.CreateGroupTagRequest, opts ...operations.Option) (*operations.CreateGroupTagResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createGroupTag", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,14 @@ func (s *Tags) CreateGroup(ctx context.Context, request operations.CreateGroupTa return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createGroupTag", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -403,13 +404,6 @@ func (s *Tags) CreateGroup(ctx context.Context, request operations.CreateGroupTa // CreateResource - Applies a tag to a resource. func (s *Tags) CreateResource(ctx context.Context, request operations.CreateResourceTagRequest, opts ...operations.Option) (*operations.CreateResourceTagResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createResourceTag", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -433,6 +427,14 @@ func (s *Tags) CreateResource(ctx context.Context, request operations.CreateReso return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createResourceTag", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -576,13 +578,6 @@ func (s *Tags) CreateResource(ctx context.Context, request operations.CreateReso // CreateUser - Applies a tag to a user. func (s *Tags) CreateUser(ctx context.Context, request operations.CreateUserTagRequest, opts ...operations.Option) (*operations.CreateUserTagResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createUserTag", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -606,6 +601,14 @@ func (s *Tags) CreateUser(ctx context.Context, request operations.CreateUserTagR return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createUserTag", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -749,13 +752,6 @@ func (s *Tags) CreateUser(ctx context.Context, request operations.CreateUserTagR // Delete - Removes a tag from a user. func (s *Tags) Delete(ctx context.Context, request operations.DeleteUserTagRequest, opts ...operations.Option) (*operations.DeleteUserTagResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteUserTag", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -779,6 +775,14 @@ func (s *Tags) Delete(ctx context.Context, request operations.DeleteUserTagReque return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteUserTag", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -922,13 +926,6 @@ func (s *Tags) Delete(ctx context.Context, request operations.DeleteUserTagReque // DeleteGroup - Removes a tag from a group. func (s *Tags) DeleteGroup(ctx context.Context, request operations.DeleteGroupTagRequest, opts ...operations.Option) (*operations.DeleteGroupTagResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteGroupTag", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -952,6 +949,14 @@ func (s *Tags) DeleteGroup(ctx context.Context, request operations.DeleteGroupTa return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteGroupTag", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1095,13 +1100,6 @@ func (s *Tags) DeleteGroup(ctx context.Context, request operations.DeleteGroupTa // DeleteResource - Removes a tag from a resource. func (s *Tags) DeleteResource(ctx context.Context, request operations.DeleteResourceTagRequest, opts ...operations.Option) (*operations.DeleteResourceTagResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "deleteResourceTag", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1125,6 +1123,14 @@ func (s *Tags) DeleteResource(ctx context.Context, request operations.DeleteReso return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteResourceTag", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1268,13 +1274,6 @@ func (s *Tags) DeleteResource(ctx context.Context, request operations.DeleteReso // DeleteTagByID - UNSTABLE. May be removed at any time. Deletes a tag with the given id. func (s *Tags) DeleteTagByID(ctx context.Context, request operations.DeleteTagByIDRequest, opts ...operations.Option) (*operations.DeleteTagByIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "delete_tag_by_ID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1298,6 +1297,14 @@ func (s *Tags) DeleteTagByID(ctx context.Context, request operations.DeleteTagBy return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "delete_tag_by_ID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1441,13 +1448,6 @@ func (s *Tags) DeleteTagByID(ctx context.Context, request operations.DeleteTagBy // GetTagByID - UNSTABLE. May be removed at any time. Gets a tag with the given id. func (s *Tags) GetTagByID(ctx context.Context, request operations.GetTagByIDRequest, opts ...operations.Option) (*operations.GetTagByIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "get_tag_by_ID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1471,6 +1471,14 @@ func (s *Tags) GetTagByID(ctx context.Context, request operations.GetTagByIDRequ return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "get_tag_by_ID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -1635,13 +1643,6 @@ func (s *Tags) GetTagByID(ctx context.Context, request operations.GetTagByIDRequ // GetTags - Returns a list of tags created by your organization. func (s *Tags) GetTags(ctx context.Context, request operations.GetTagsRequest, opts ...operations.Option) (*operations.GetTagsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getTags", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -1665,6 +1666,14 @@ func (s *Tags) GetTags(ctx context.Context, request operations.GetTagsRequest, o return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getTags", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/uars.go b/internal/sdk/uars.go index d26145c6..81e566a6 100644 --- a/internal/sdk/uars.go +++ b/internal/sdk/uars.go @@ -29,13 +29,6 @@ func newUars(sdkConfig sdkConfiguration) *Uars { // Create - Starts a User Access Review. func (s *Uars) Create(ctx context.Context, request shared.CreateUARInfo, opts ...operations.Option) (*operations.CreateUARResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "createUAR", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,13 @@ func (s *Uars) Create(ctx context.Context, request shared.CreateUARInfo, opts .. return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "createUAR", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err @@ -230,13 +230,6 @@ func (s *Uars) Create(ctx context.Context, request shared.CreateUARInfo, opts .. // Get - Returns a list of `UAR` objects. func (s *Uars) Get(ctx context.Context, request operations.GetUARsRequest, opts ...operations.Option) (*operations.GetUARsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getUARs", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -260,6 +253,14 @@ func (s *Uars) Get(ctx context.Context, request operations.GetUARsRequest, opts return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getUARs", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -428,13 +429,6 @@ func (s *Uars) Get(ctx context.Context, request operations.GetUARsRequest, opts // GetID - Retrieves a specific UAR. func (s *Uars) GetID(ctx context.Context, request operations.GetUARIDRequest, opts ...operations.Option) (*operations.GetUARIDResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getUARID", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -458,6 +452,14 @@ func (s *Uars) GetID(ctx context.Context, request operations.GetUARIDRequest, op return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getUARID", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/sdk/users.go b/internal/sdk/users.go index 2ca04e64..527ed5b1 100644 --- a/internal/sdk/users.go +++ b/internal/sdk/users.go @@ -29,13 +29,6 @@ func newUsers(sdkConfig sdkConfiguration) *Users { // Get - Returns a `User` object. func (s *Users) Get(ctx context.Context, request operations.GetUserRequest, opts ...operations.Option) (*operations.GetUserResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getUser", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -59,6 +52,14 @@ func (s *Users) Get(ctx context.Context, request operations.GetUserRequest, opts return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getUser", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -227,13 +228,6 @@ func (s *Users) Get(ctx context.Context, request operations.GetUserRequest, opts // GetUserTags - Returns all tags applied to the user. func (s *Users) GetUserTags(ctx context.Context, request operations.GetUserTagsRequest, opts ...operations.Option) (*operations.GetUserTagsResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getUserTags", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -257,6 +251,14 @@ func (s *Users) GetUserTags(ctx context.Context, request operations.GetUserTagsR return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getUserTags", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout @@ -421,13 +423,6 @@ func (s *Users) GetUserTags(ctx context.Context, request operations.GetUserTagsR // GetUsers - Returns a list of users for your organization. func (s *Users) GetUsers(ctx context.Context, request operations.GetUsersRequest, opts ...operations.Option) (*operations.GetUsersResponse, error) { - hookCtx := hooks.HookContext{ - Context: ctx, - OperationID: "getUsers", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -451,6 +446,14 @@ func (s *Users) GetUsers(ctx context.Context, request operations.GetUsersRequest return nil, fmt.Errorf("error generating URL: %w", err) } + hookCtx := hooks.HookContext{ + BaseURL: baseURL, + Context: ctx, + OperationID: "getUsers", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + timeout := o.Timeout if timeout == nil { timeout = s.sdkConfiguration.Timeout diff --git a/internal/validators/float32validators/not_null.go b/internal/validators/float32validators/not_null.go new file mode 100644 index 00000000..c9a8973c --- /dev/null +++ b/internal/validators/float32validators/not_null.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package float32validators + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/schema/validator" +) + +var _ validator.Float32 = Float32NotNullValidator{} + +// Float32NotNullValidator validates that an attribute is not null. Most +// attributes should set Required: true instead, however in certain scenarios, +// such as a computed nested attribute, all underlying attributes must also be +// computed for planning to not show unexpected differences. +type Float32NotNullValidator struct{} + +// Description describes the validation in plain text formatting. +func (v Float32NotNullValidator) Description(_ context.Context) string { + return "value must be configured" +} + +// MarkdownDescription describes the validation in Markdown formatting. +func (v Float32NotNullValidator) MarkdownDescription(ctx context.Context) string { + return v.Description(ctx) +} + +// Validate performs the validation. +func (v Float32NotNullValidator) ValidateFloat32(ctx context.Context, req validator.Float32Request, resp *validator.Float32Response) { + if !req.ConfigValue.IsNull() { + return + } + + resp.Diagnostics.AddAttributeError( + req.Path, + "Missing Attribute Value", + req.Path.String()+": "+v.Description(ctx), + ) +} + +// NotNull returns an validator which ensures that the attribute is +// configured. Most attributes should set Required: true instead, however in +// certain scenarios, such as a computed nested attribute, all underlying +// attributes must also be computed for planning to not show unexpected +// differences. +func NotNull() validator.Float32 { + return Float32NotNullValidator{} +} diff --git a/internal/validators/int32validators/not_null.go b/internal/validators/int32validators/not_null.go new file mode 100644 index 00000000..ec9a3f10 --- /dev/null +++ b/internal/validators/int32validators/not_null.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package int32validators + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/schema/validator" +) + +var _ validator.Int32 = Int32NotNullValidator{} + +// Int32NotNullValidator validates that an attribute is not null. Most +// attributes should set Required: true instead, however in certain scenarios, +// such as a computed nested attribute, all underlying attributes must also be +// computed for planning to not show unexpected differences. +type Int32NotNullValidator struct{} + +// Description describes the validation in plain text formatting. +func (v Int32NotNullValidator) Description(_ context.Context) string { + return "value must be configured" +} + +// MarkdownDescription describes the validation in Markdown formatting. +func (v Int32NotNullValidator) MarkdownDescription(ctx context.Context) string { + return v.Description(ctx) +} + +// Validate performs the validation. +func (v Int32NotNullValidator) ValidateInt32(ctx context.Context, req validator.Int32Request, resp *validator.Int32Response) { + if !req.ConfigValue.IsNull() { + return + } + + resp.Diagnostics.AddAttributeError( + req.Path, + "Missing Attribute Value", + req.Path.String()+": "+v.Description(ctx), + ) +} + +// NotNull returns an validator which ensures that the attribute is +// configured. Most attributes should set Required: true instead, however in +// certain scenarios, such as a computed nested attribute, all underlying +// attributes must also be computed for planning to not show unexpected +// differences. +func NotNull() validator.Int32 { + return Int32NotNullValidator{} +} diff --git a/openapi.yaml b/openapi.yaml index b4ba58ff..21fd7910 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1576,7 +1576,7 @@ paths: x-speakeasy-entity-operation: Requests#get post: description: "Create an access request" - operationId: "createRequest" # TODO amruth confirm naming + operationId: "createRequest" requestBody: description: Resources to be updated required: true @@ -4898,13 +4898,26 @@ components: IdpGroupMapping: description: Information about a group mapping. example: - id: 7870617d-e72a-47f5-a84c-693817ab4567 - organization_id: 1520617d-e72a-47f5-a84c-693817ab48ad2 - app_resource_id: 6f99639b-7928-4043-8184-47cbc6766145 group_id: 6f99639b-7928-4043-8184-47cbc6766145 alias: "finance-team" hidden_from_end_user: False + id: 7870617d-e72a-47f5-a84c-693817ab4567 + organization_id: 1520617d-e72a-47f5-a84c-693817ab48ad2 + app_resource_id: 6f99639b-7928-4043-8184-47cbc6766145 properties: + group_id: + description: The ID of the group. + example: 6f99639b-7928-4043-8184-47cbc6766145 + format: uuid + type: string + alias: + description: The alias of the group. + example: finance-team + type: string + hidden_from_end_user: + description: A bool representing whether or not the group is hidden from the end user. + example: False + type: boolean id: description: The ID of the idp group mapping. example: 7870617d-e72a-47f5-a84c-693817ab4567 @@ -4920,19 +4933,6 @@ components: example: 6f99639b-7928-4043-8184-47cbc6766145 format: uuid type: string - group_id: - description: The ID of the group. - example: 6f99639b-7928-4043-8184-47cbc6766145 - format: uuid - type: string - alias: - description: The alias of the group. - example: finance-team - type: string - hidden_from_end_user: - description: A bool representing whether or not the group is hidden from the end user. - example: False - type: boolean required: - id - organization_id @@ -8096,7 +8096,7 @@ components: identifier: type: string url: - type: string # TODO amruth Does url format exist? + type: string required: - ticketing_provider - remote_id diff --git a/terraform_overlay.yaml b/terraform_overlay.yaml index e4e2f4ee..97de1a53 100644 --- a/terraform_overlay.yaml +++ b/terraform_overlay.yaml @@ -398,6 +398,8 @@ actions: update: "404": description: Not Found + - target: $["paths"]["/idp-group-mappings/{app_resource_id}"]["put"]["requestBody"]["content"]["application/json"]["schema"]["properties"]["mappings"]["items"]["properties"]["hidden_from_end_user"] + remove: true - target: $["paths"]["/owners"]["get"]["operationId"] update: getOwners - target: $["paths"]["/owners"]["get"]["responses"] @@ -1177,6 +1179,72 @@ actions: - target: $["components"]["schemas"]["UpdateGroupResourcesInfo"] update: x-speakeasy-entity: GroupResourceList + - target: $["components"]["schemas"]["IdpGroupMapping"]["example"] + update: + id: 7870617d-e72a-47f5-a84c-693817ab4567 + - target: $["components"]["schemas"]["IdpGroupMapping"]["example"] + update: + organization_id: 1520617d-e72a-47f5-a84c-693817ab48ad2 + - target: $["components"]["schemas"]["IdpGroupMapping"]["example"] + update: + app_resource_id: 6f99639b-7928-4043-8184-47cbc6766145 + - target: $["components"]["schemas"]["IdpGroupMapping"]["properties"] + update: + id: + description: The ID of the idp group mapping. + example: 7870617d-e72a-47f5-a84c-693817ab4567 + format: uuid + type: string + - target: $["components"]["schemas"]["IdpGroupMapping"]["properties"] + update: + organization_id: + description: The ID of the organization. + example: 1520617d-e72a-47f5-a84c-693817ab48ad2 + format: uuid + type: string + - target: $["components"]["schemas"]["IdpGroupMapping"]["properties"] + update: + app_resource_id: + description: The ID of the idp app resource. + example: 6f99639b-7928-4043-8184-47cbc6766145 + format: uuid + type: string + - target: $["components"]["schemas"]["IdpGroupMapping"]["required"][*] + remove: true + - target: $["components"]["schemas"]["IdpGroupMapping"]["required"] + update: + - id + - organization_id + - app_resource_id + - group_id + - hidden_from_end_user + - target: $["components"]["schemas"]["IdpGroupMappingList"]["example"] + update: + idp_group_mappings: + - id: 7870617d-e72a-47f5-a84c-693817ab4567 + organization_id: 1520617d-e72a-47f5-a84c-693817ab48ad2 + app_resource_id: 6f99639b-7928-4043-8184-47cbc6766145 + group_id: 6f99639b-7928-4043-8184-47cbc6766145 + alias: "finance-team" + hidden_from_end_user: False + - id: 1520617d-e72a-47f5-a84c-693817ab48ad2 + organization_id: 6f99639b-7928-4043-8184-47cbc6766145 + app_resource_id: 7870617d-e72a-47f5-a84c-693817ab4567 + group_id: 7870617d-e72a-47f5-a84c-693817ab4567 + alias: "engineering-team" + hidden_from_end_user: False + - target: $["components"]["schemas"]["IdpGroupMappingList"]["example"]["mappings"] + remove: true + - target: $["components"]["schemas"]["IdpGroupMappingList"]["properties"] + update: + idp_group_mappings: + items: + $ref: "#/components/schemas/IdpGroupMapping" + type: array + - target: $["components"]["schemas"]["IdpGroupMappingList"]["properties"]["mappings"] + remove: true + - target: $["components"]["schemas"]["IdpGroupMappingList"]["required"][0] + update: idp_group_mappings - target: $["components"]["schemas"]["GroupResourceList"]["properties"]["group_resources"] update: x-speakeasy-param-suppress-computed-diff: true