Skip to content

chore: remove bodyParams from json serializeStructure #1176

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

Merged
merged 2 commits into from
May 13, 2020

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented May 13, 2020

Issue #, if available:
Similar to #1153

Description of changes:
removes bodyParams from json serializeStructure

  • Simple
    • Before
    const serializeAws_restJson1_1InlineArchiveRule = (
      input: InlineArchiveRule,
      context: __SerdeContext
    ): any => {
      const bodyParams: any = {};
      if (input.filter !== undefined) {
        bodyParams["filter"] = serializeAws_restJson1_1FilterCriteriaMap(
          input.filter,
          context
        );
      }
      if (input.ruleName !== undefined) {
        bodyParams["ruleName"] = input.ruleName;
      }
      return bodyParams;
    };
    • After
    const serializeAws_restJson1_1InlineArchiveRule = (
      input: InlineArchiveRule,
      context: __SerdeContext
    ): any => {
      return {
        ...(input.filter !== undefined && {
          filter: serializeAws_restJson1_1FilterCriteriaMap(input.filter, context)
        }),
        ...(input.ruleName !== undefined && { ruleName: input.ruleName })
      };
    };
  • with IdempotencyTokenTrait
    • Before
    const serializeAws_json1_1CreateAddressBookRequest = (
      input: CreateAddressBookRequest,
      context: __SerdeContext
    ): any => {
      const bodyParams: any = {};
      if (input.ClientRequestToken === undefined) {
        input.ClientRequestToken = generateIdempotencyToken();
      }
      if (input.ClientRequestToken !== undefined) {
        bodyParams["ClientRequestToken"] = input.ClientRequestToken;
      }
      if (input.Description !== undefined) {
        bodyParams["Description"] = input.Description;
      }
      if (input.Name !== undefined) {
        bodyParams["Name"] = input.Name;
      }
      return bodyParams;
    };
    • After
    const serializeAws_json1_1CreateAddressBookRequest = (
      input: CreateAddressBookRequest,
      context: __SerdeContext
    ): any => {
      return {
        ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
        ...(input.Description !== undefined && { Description: input.Description }),
        ...(input.Name !== undefined && { Name: input.Name })
      };
    };

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: a67a6c9
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@trivikr trivikr merged commit 50c8411 into aws:master May 13, 2020
@trivikr trivikr deleted the remove-entries-query-serializeStructure branch May 13, 2020 16:53
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants