---
version: 1
interactions:
- request:
    body: '{"users":[{"id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55", "email":"esoulard@scaleway.com",
      "username":"test-cli-iam-membership", "first_name":"", "last_name":"", "phone_number":"",
      "locale":"en_US", "created_at":"2025-10-23T13:09:53.767326Z", "updated_at":"2025-10-23T13:12:36.011260Z",
      "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e", "deletable":true,
      "last_login_at":"2025-10-23T13:12:36.016942Z", "type":"member", "two_factor_enabled":false,
      "status":"activated", "mfa":false, "account_root_user_id":"", "tags":[], "locked":false}],
      "total_count":1}'
    form: {}
    headers:
      User-Agent:
      - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; linux; amd64) cli-e2e-test
    url: https://api.scaleway.com/iam/v1alpha1/users?order_by=created_at_asc&organization_id=11111111-1111-1111-1111-111111111111&page=1&type=member
    method: GET
  response:
    body: '{"users":[{"id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55", "email":"esoulard@scaleway.com",
      "username":"test-cli-iam-membership", "first_name":"", "last_name":"", "phone_number":"",
      "locale":"en_US", "created_at":"2025-10-23T13:09:53.767326Z", "updated_at":"2025-10-23T13:12:36.011260Z",
      "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e", "deletable":true,
      "last_login_at":"2025-10-23T13:12:36.016942Z", "type":"member", "two_factor_enabled":false,
      "status":"activated", "mfa":false, "account_root_user_id":"", "tags":[], "locked":false}],
      "total_count":1}'
    headers:
      Content-Length:
      - "560"
      Content-Security-Policy:
      - default-src 'none'; frame-ancestors 'none'
      Content-Type:
      - application/json
      Date:
      - Thu, 23 Oct 2025 13:27:06 GMT
      Server:
      - Scaleway API Gateway (fr-par-1;edge02)
      Strict-Transport-Security:
      - max-age=63072000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - DENY
      X-Request-Id:
      - 8e52123b-4ae5-4152-9794-f554a71e7bf9
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: '{"api_keys":[{"access_key":"SCWPZ1WTFFCYAB554FW9", "secret_key":null, "description":"test-cli-iam-membership-api-key",
      "created_at":"2025-10-23T13:13:03.216453Z", "updated_at":"2025-10-23T13:13:03.216453Z",
      "expires_at":"2026-10-23T13:13:03.029Z", "default_project_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "editable":true, "deletable":true, "managed":false, "creation_ip":"51.159.73.145",
      "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"}], "total_count":1}'
    form: {}
    headers:
      User-Agent:
      - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; linux; amd64) cli-e2e-test
    url: https://api.scaleway.com/iam/v1alpha1/api-keys?bearer_id=bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55&bearer_type=unknown_bearer_type&order_by=created_at_asc&organization_id=11111111-1111-1111-1111-111111111111&page=1
    method: GET
  response:
    body: '{"api_keys":[{"access_key":"SCWPZ1WTFFCYAB554FW9", "secret_key":null, "description":"test-cli-iam-membership-api-key",
      "created_at":"2025-10-23T13:13:03.216453Z", "updated_at":"2025-10-23T13:13:03.216453Z",
      "expires_at":"2026-10-23T13:13:03.029Z", "default_project_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "editable":true, "deletable":true, "managed":false, "creation_ip":"51.159.73.145",
      "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"}], "total_count":1}'
    headers:
      Content-Length:
      - "460"
      Content-Security-Policy:
      - default-src 'none'; frame-ancestors 'none'
      Content-Type:
      - application/json
      Date:
      - Thu, 23 Oct 2025 13:27:06 GMT
      Server:
      - Scaleway API Gateway (fr-par-1;edge02)
      Strict-Transport-Security:
      - max-age=63072000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - DENY
      X-Request-Id:
      - 8ddfa95b-7af5-4005-83ac-70348df95c9c
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: '{"access_key":"SCWPZ1WTFFCYAB554FW9", "secret_key":null, "description":"test-cli-iam-membership-api-key",
      "created_at":"2025-10-23T13:13:03.216453Z", "updated_at":"2025-10-23T13:13:03.216453Z",
      "expires_at":"2026-10-23T13:13:03.029Z", "default_project_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "editable":true, "deletable":true, "managed":false, "creation_ip":"51.159.73.145",
      "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"}'
    form: {}
    headers:
      User-Agent:
      - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; linux; amd64) cli-e2e-test
    url: https://api.scaleway.com/iam/v1alpha1/api-keys/SCWPZ1WTFFCYAB554FW9
    method: GET
  response:
    body: '{"access_key":"SCWPZ1WTFFCYAB554FW9", "secret_key":null, "description":"test-cli-iam-membership-api-key",
      "created_at":"2025-10-23T13:13:03.216453Z", "updated_at":"2025-10-23T13:13:03.216453Z",
      "expires_at":"2026-10-23T13:13:03.029Z", "default_project_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "editable":true, "deletable":true, "managed":false, "creation_ip":"51.159.73.145",
      "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"}'
    headers:
      Content-Length:
      - "428"
      Content-Security-Policy:
      - default-src 'none'; frame-ancestors 'none'
      Content-Type:
      - application/json
      Date:
      - Thu, 23 Oct 2025 13:27:06 GMT
      Server:
      - Scaleway API Gateway (fr-par-1;edge02)
      Strict-Transport-Security:
      - max-age=63072000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - DENY
      X-Request-Id:
      - 1612f3d2-f879-43b6-a285-9f9aaf2afb33
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: '{"id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55", "email":"esoulard@scaleway.com",
      "username":"test-cli-iam-membership", "first_name":"", "last_name":"", "phone_number":"",
      "locale":"en_US", "created_at":"2025-10-23T13:09:53.767326Z", "updated_at":"2025-10-23T13:12:36.011260Z",
      "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e", "deletable":true,
      "last_login_at":"2025-10-23T13:12:36.016942Z", "type":"member", "two_factor_enabled":false,
      "status":"activated", "mfa":false, "account_root_user_id":"", "tags":[], "locked":false}'
    form: {}
    headers:
      User-Agent:
      - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; linux; amd64) cli-e2e-test
    url: https://api.scaleway.com/iam/v1alpha1/users/bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55
    method: GET
  response:
    body: '{"id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55", "email":"esoulard@scaleway.com",
      "username":"test-cli-iam-membership", "first_name":"", "last_name":"", "phone_number":"",
      "locale":"en_US", "created_at":"2025-10-23T13:09:53.767326Z", "updated_at":"2025-10-23T13:12:36.011260Z",
      "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e", "deletable":true,
      "last_login_at":"2025-10-23T13:12:36.016942Z", "type":"member", "two_factor_enabled":false,
      "status":"activated", "mfa":false, "account_root_user_id":"", "tags":[], "locked":false}'
    headers:
      Content-Length:
      - "531"
      Content-Security-Policy:
      - default-src 'none'; frame-ancestors 'none'
      Content-Type:
      - application/json
      Date:
      - Thu, 23 Oct 2025 13:27:06 GMT
      Server:
      - Scaleway API Gateway (fr-par-1;edge02)
      Strict-Transport-Security:
      - max-age=63072000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - DENY
      X-Request-Id:
      - 300a594d-35f7-4be7-943b-16c443d85912
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: '{"policies":[{"id":"354d757c-d0ef-4e80-9c66-0a2dc3aae560", "name":"Copy
      of Group - Editors", "description":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "created_at":"2025-10-23T13:22:51.771875Z", "updated_at":"2025-10-23T13:22:51.771875Z",
      "editable":true, "deletable":true, "managed":false, "nb_rules":2, "nb_scopes":2,
      "nb_permission_sets":4, "tags":[], "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"},
      {"id":"9b9cb03b-ef4e-4378-96b5-bb61893de47c", "name":"test-cli-iam-api-key-get-policies",
      "description":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "created_at":"2025-10-23T13:25:05.108357Z", "updated_at":"2025-10-23T13:25:05.108357Z",
      "editable":true, "deletable":true, "managed":false, "nb_rules":1, "nb_scopes":1,
      "nb_permission_sets":1, "tags":[], "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"}],
      "total_count":2}'
    form: {}
    headers:
      User-Agent:
      - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; linux; amd64) cli-e2e-test
    url: https://api.scaleway.com/iam/v1alpha1/policies?order_by=policy_name_asc&organization_id=11111111-1111-1111-1111-111111111111&page=1&user_ids=bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55
    method: GET
  response:
    body: '{"policies":[{"id":"354d757c-d0ef-4e80-9c66-0a2dc3aae560", "name":"Copy
      of Group - Editors", "description":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "created_at":"2025-10-23T13:22:51.771875Z", "updated_at":"2025-10-23T13:22:51.771875Z",
      "editable":true, "deletable":true, "managed":false, "nb_rules":2, "nb_scopes":2,
      "nb_permission_sets":4, "tags":[], "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"},
      {"id":"9b9cb03b-ef4e-4378-96b5-bb61893de47c", "name":"test-cli-iam-api-key-get-policies",
      "description":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e",
      "created_at":"2025-10-23T13:25:05.108357Z", "updated_at":"2025-10-23T13:25:05.108357Z",
      "editable":true, "deletable":true, "managed":false, "nb_rules":1, "nb_scopes":1,
      "nb_permission_sets":1, "tags":[], "user_id":"bcc3ea6a-f5ca-43b0-8bc2-5a6a5b1bdc55"}],
      "total_count":2}'
    headers:
      Content-Length:
      - "862"
      Content-Security-Policy:
      - default-src 'none'; frame-ancestors 'none'
      Content-Type:
      - application/json
      Date:
      - Thu, 23 Oct 2025 13:27:06 GMT
      Server:
      - Scaleway API Gateway (fr-par-1;edge02)
      Strict-Transport-Security:
      - max-age=63072000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - DENY
      X-Request-Id:
      - ef5aa212-2452-44c6-b275-a3fa3f5301ed
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: '{"rules":[{"id":"cb0a8c9e-7023-4308-8e54-15cf9c2d7cfe", "permission_set_names":["OrganizationReadOnly",
      "ProjectManager", "SupportTicketReadOnly"], "permission_sets_scope_type":"organization",
      "condition":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e"}, {"id":"bf97c92c-e276-4b26-a6ff-b82b6f151a37",
      "permission_set_names":["AllProductsFullAccess"], "permission_sets_scope_type":"projects",
      "condition":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e"}],
      "total_count":2}'
    form: {}
    headers:
      User-Agent:
      - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; linux; amd64) cli-e2e-test
    url: https://api.scaleway.com/iam/v1alpha1/rules?policy_id=354d757c-d0ef-4e80-9c66-0a2dc3aae560
    method: GET
  response:
    body: '{"rules":[{"id":"cb0a8c9e-7023-4308-8e54-15cf9c2d7cfe", "permission_set_names":["OrganizationReadOnly",
      "ProjectManager", "SupportTicketReadOnly"], "permission_sets_scope_type":"organization",
      "condition":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e"}, {"id":"bf97c92c-e276-4b26-a6ff-b82b6f151a37",
      "permission_set_names":["AllProductsFullAccess"], "permission_sets_scope_type":"projects",
      "condition":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e"}],
      "total_count":2}'
    headers:
      Content-Length:
      - "497"
      Content-Security-Policy:
      - default-src 'none'; frame-ancestors 'none'
      Content-Type:
      - application/json
      Date:
      - Thu, 23 Oct 2025 13:27:06 GMT
      Server:
      - Scaleway API Gateway (fr-par-1;edge02)
      Strict-Transport-Security:
      - max-age=63072000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - DENY
      X-Request-Id:
      - d9c5f773-9749-437a-9bed-845277dce6a2
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: '{"rules":[{"id":"8c9436c5-72e6-4699-85fb-1f029963dbf5", "permission_set_names":["IAMGroupReadOnly"],
      "permission_sets_scope_type":"organization", "condition":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e"}],
      "total_count":1}'
    form: {}
    headers:
      User-Agent:
      - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; linux; amd64) cli-e2e-test
    url: https://api.scaleway.com/iam/v1alpha1/rules?policy_id=9b9cb03b-ef4e-4378-96b5-bb61893de47c
    method: GET
  response:
    body: '{"rules":[{"id":"8c9436c5-72e6-4699-85fb-1f029963dbf5", "permission_set_names":["IAMGroupReadOnly"],
      "permission_sets_scope_type":"organization", "condition":"", "organization_id":"57a1e028-d7d3-4a4e-80cf-52cef8fd0d3e"}],
      "total_count":1}'
    headers:
      Content-Length:
      - "238"
      Content-Security-Policy:
      - default-src 'none'; frame-ancestors 'none'
      Content-Type:
      - application/json
      Date:
      - Thu, 23 Oct 2025 13:27:06 GMT
      Server:
      - Scaleway API Gateway (fr-par-1;edge02)
      Strict-Transport-Security:
      - max-age=63072000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - DENY
      X-Request-Id:
      - 80c90f6a-189e-4b32-b4e0-5e62c541d442
    status: 200 OK
    code: 200
    duration: ""
