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

AppStream describe_sessions does not accept NextToken=None #4434

Open
1 task
andreas-lundgren-qlucore opened this issue Feb 10, 2025 · 1 comment
Open
1 task
Assignees
Labels
appstream bug This issue is a confirmed bug. p2 This is a standard priority issue response-requested Waiting on additional information or feedback.

Comments

@andreas-lundgren-qlucore

Describe the bug

Although reference states that NextToken (string) ... If this value is null, it retrieves the first page. the value of None is not accepted.

This makes looping over sessions cumbersome, since different function invocation statements needs to be user for the fist call (where NextToken must be omitted) and successive invocations where NextToken needs to be present.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

NextToken=None should be equivalent with not specifying NextToken at all.

Current Behavior

NextToken=None raises an exception.

Reproduction Steps

import boto3
as_client = boto3.client('appstream', "eu-west-1")
as_client.describe_sessions(StackName="my-stack", FleetName="my-fleet", UserId="user-id", AuthenticationType="API", NextToken=None)
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/botocore/client.py", line 530, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/botocore/client.py", line 919, in _make_api_call
request_dict = self._convert_to_request_dict(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/botocore/client.py", line 990, in _convert_to_request_dict
request_dict = self._serializer.serialize_to_request(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/botocore/validate.py", line 381, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter NextToken, value: None, type: <class 'NoneType'>, valid types: <class 'str'>

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.34.105

Environment details (OS name and version, etc.)

python3, testen on MacOS and Ubuntu

@andreas-lundgren-qlucore andreas-lundgren-qlucore added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@khushail khushail added needs-reproduction p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@khushail khushail self-assigned this Feb 10, 2025
@khushail khushail added appstream investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-reproduction labels Feb 10, 2025
@khushail
Copy link

Hi @andreas-lundgren-qlucore , thanks for reaching out. AFAIU, the AWS Docs describe giving either the string type value or leaving it null-

https://docs.aws.amazon.com/appstream2/latest/APIReference/API_DescribeSessions.html#API_DescribeSessions_RequestSyntax

NextToken

    The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

    Type: String

    Length Constraints: Minimum length of 1.

    Required: No

Mentioning the value as next_token=None means None should be treated as a value which might not be the case. If you want to retrieve the first page, you should not mention any value at all and skip this parameter. This is the expected behavior.
Let me know if there is any confusion or you have different ask.

@khushail khushail added response-requested Waiting on additional information or feedback. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appstream bug This issue is a confirmed bug. p2 This is a standard priority issue response-requested Waiting on additional information or feedback.
Projects
None yet
Development

No branches or pull requests

2 participants