HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //var/www/javago_test/node_modules/aws-sdk/scripts/lib/set-s3-expires-string.js
/**
 * Sets model overrides for S3 ExpiresString.
 */
module.exports = function setS3ExpiresString(model) {
  if (model.metadata.serviceId === 'S3') {
    var newShapes = {};
    for (var shapeId in model.shapes) {
      newShapes[shapeId] = model.shapes[shapeId];
      if (shapeId === 'Expires') {
        // preserve timestamp type for Expires.
        newShapes[shapeId] = {};
        newShapes[shapeId].type = 'timestamp';

        // add ExpiresString
        newShapes['ExpiresString'] = {
          type: 'string'
        };
      }
    }
    model.shapes = newShapes;

    for (var operationKey in model.operations) {
      var op = model.operations[operationKey];
      if (!op.output || !op.output.shape) {
        continue;
      }
      var output = model.shapes[op.output.shape];
      if (!output || !output.members) {
        continue;
      }
      if ('Expires' in output.members) {
        var newMembers = {};
        for (var memberKey in output.members) {
          newMembers[memberKey] = output.members[memberKey];
          if (memberKey === 'Expires') {
            newMembers['ExpiresString'] = Object.assign({}, newMembers[memberKey], {
              'shape': 'ExpiresString',
              'location': 'header',
              'locationName': 'ExpiresString'
            });

            newMembers[memberKey].deprecated = true;
            newMembers[memberKey].documentation = 'Deprecated in favor of ExpiresString.';
          }
        }
        output.members = newMembers;
      }
    }

    return true;
  }
  return false;
};