Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listServiceAuthorization is not returning service ids #29

Open
lancehudson opened this issue Dec 27, 2024 · 0 comments
Open

listServiceAuthorization is not returning service ids #29

lancehudson opened this issue Dec 27, 2024 · 0 comments

Comments

@lancehudson
Copy link

With the code:

import * as Fastly from "fastly";
Fastly.ApiClient.instance.authenticate("XXXX");

Fastly.ApiClient.instance.plugins = [
  function logRequest(req) {
    req.on('response', (res) => {
      console.log(JSON.stringify(res.body, null, 2));
    });
    return req;
  }
];

async function test() {
  const apiInstance = new Fastly.ServiceAuthorizationsApi();
  const options = {
    service_authorization_id: 'YYY',
  };
  try {
    const response = await apiInstance.showServiceAuthorization(options);
    console.log(JSON.stringify(response, null, 2));
  } catch(error) {
    console.error("Error calling ServiceAuthorizationsApi.showServiceAuthorization", error);
  }
}

test()

I am getting back:

{
  "data": {
    "type": "service_authorization",
    "attributes": {
      "created_at": "2024-11-12T17:16:09.000Z",
      "deleted_at": null,
      "updated_at": "2024-11-12T17:16:09.000Z"
    },
    "relationships": {
      "service": {},
      "user": {
        "data": {
          "type": "user",
          "id": "ZZZ"
        }
      }
    },
    "id": "YYY"
  }
}

While if I sniff the response I see:

{
  "data": {
    "id": "YYY",
    "type": "service_authorization",
    "attributes": {
      "created_at": "2024-11-12T17:16:09Z",
      "updated_at": "2024-11-12T17:16:09Z",
      "deleted_at": null,
      "permission": "read_only"
    },
    "relationships": {
      "service": {
        "data": {
          "id": "AAA",
          "type": "service"
        }
      },
      "user": {
        "data": {
          "id": "ZZZ",
          "type": "user"
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant