/** * <p> * One or more user-defined key-value pairs to be added to the stack attributes. * </p> * <p> * To create a cluster layer, set the <code>EcsClusterArn</code> attribute to the cluster's ARN. * </p> * * @param attributes * One or more user-defined key-value pairs to be added to the stack attributes.</p> * <p> * To create a cluster layer, set the <code>EcsClusterArn</code> attribute to the cluster's ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; }
/** * <p> * A <code>LayerCustomRecipes</code> object that specifies the layer custom recipes. * </p> * * @param customRecipes * A <code>LayerCustomRecipes</code> object that specifies the layer custom recipes. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withCustomRecipes(Recipes customRecipes) { setCustomRecipes(customRecipes); return this; }
/** * <p> * An array containing the layer custom security group IDs. * </p> * * @param customSecurityGroupIds * An array containing the layer custom security group IDs. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withCustomSecurityGroupIds(java.util.Collection<String> customSecurityGroupIds) { setCustomSecurityGroupIds(customSecurityGroupIds); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getShortname() == null) ? 0 : getShortname().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getCloudWatchLogsConfiguration() == null) ? 0 : getCloudWatchLogsConfiguration().hashCode()); hashCode = prime * hashCode + ((getCustomInstanceProfileArn() == null) ? 0 : getCustomInstanceProfileArn().hashCode()); hashCode = prime * hashCode + ((getCustomJson() == null) ? 0 : getCustomJson().hashCode()); hashCode = prime * hashCode + ((getCustomSecurityGroupIds() == null) ? 0 : getCustomSecurityGroupIds().hashCode()); hashCode = prime * hashCode + ((getPackages() == null) ? 0 : getPackages().hashCode()); hashCode = prime * hashCode + ((getVolumeConfigurations() == null) ? 0 : getVolumeConfigurations().hashCode()); hashCode = prime * hashCode + ((getEnableAutoHealing() == null) ? 0 : getEnableAutoHealing().hashCode()); hashCode = prime * hashCode + ((getAutoAssignElasticIps() == null) ? 0 : getAutoAssignElasticIps().hashCode()); hashCode = prime * hashCode + ((getAutoAssignPublicIps() == null) ? 0 : getAutoAssignPublicIps().hashCode()); hashCode = prime * hashCode + ((getCustomRecipes() == null) ? 0 : getCustomRecipes().hashCode()); hashCode = prime * hashCode + ((getInstallUpdatesOnBoot() == null) ? 0 : getInstallUpdatesOnBoot().hashCode()); hashCode = prime * hashCode + ((getUseEbsOptimizedInstances() == null) ? 0 : getUseEbsOptimizedInstances().hashCode()); hashCode = prime * hashCode + ((getLifecycleEventConfiguration() == null) ? 0 : getLifecycleEventConfiguration().hashCode()); return hashCode; }
checkParams(); AWSOpsWorksClient client = getOrCreateClient(AWSOpsWorksClient.class); CreateLayerRequest createLayerRequest = new CreateLayerRequest() .withStackId(stackId).withType(type).withName(name) .withShortname(shortname) .withEnableAutoHealing(enableAutoHealing) .withAutoAssignElasticIps(autoAssignElasticIps) .withAutoAssignPublicIps(autoAssignPublicIps) .withInstallUpdatesOnBoot(installUpdatesOnBoot) .withUseEbsOptimizedInstances(useEbsOptimizedInstances) .withCustomInstanceProfileArn(customInstanceProfileArn); createLayerRequest.setAttributes(attributes); createLayerRequest.setPackages(packages); createLayerRequest.setVolumeConfigurations(volumeConfigurations); .setCustomSecurityGroupIds(customSecurityGroupIds); .withSetup(setupRecipes).withShutdown(shutdownRecipes) .withUndeploy(undeployRecipes); createLayerRequest.setCustomRecipes(customRecipes);
/** * <p> * An array of <code>Package</code> objects that describes the layer packages. * </p> * * @param packages * An array of <code>Package</code> objects that describes the layer packages. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withPackages(java.util.Collection<String> packages) { setPackages(packages); return this; }
/** * <p> * A <code>VolumeConfigurations</code> object that describes the layer's Amazon EBS volumes. * </p> * * @param volumeConfigurations * A <code>VolumeConfigurations</code> object that describes the layer's Amazon EBS volumes. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withVolumeConfigurations(java.util.Collection<VolumeConfiguration> volumeConfigurations) { setVolumeConfigurations(volumeConfigurations); return this; }
/** * <p> * The layer type. A stack cannot have more than one built-in layer of the same type. It can have any number of * custom layers. Built-in layers are not available in Chef 12 stacks. * </p> * * @param type * The layer type. A stack cannot have more than one built-in layer of the same type. It can have any number * of custom layers. Built-in layers are not available in Chef 12 stacks. * @see LayerType */ public void setType(LayerType type) { withType(type); }
return false; CreateLayerRequest other = (CreateLayerRequest) obj; if (other.getStackId() == null ^ this.getStackId() == null) return false; if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getShortname() == null ^ this.getShortname() == null) return false; if (other.getShortname() != null && other.getShortname().equals(this.getShortname()) == false) return false; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; if (other.getCloudWatchLogsConfiguration() == null ^ this.getCloudWatchLogsConfiguration() == null) return false; if (other.getCloudWatchLogsConfiguration() != null && other.getCloudWatchLogsConfiguration().equals(this.getCloudWatchLogsConfiguration()) == false) return false; if (other.getCustomInstanceProfileArn() == null ^ this.getCustomInstanceProfileArn() == null) return false; if (other.getCustomInstanceProfileArn() != null && other.getCustomInstanceProfileArn().equals(this.getCustomInstanceProfileArn()) == false)
/** * <p> * An array of <code>Package</code> objects that describes the layer packages. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setPackages(java.util.Collection)} or {@link #withPackages(java.util.Collection)} if you want to override * the existing values. * </p> * * @param packages * An array of <code>Package</code> objects that describes the layer packages. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withPackages(String... packages) { if (this.packages == null) { setPackages(new com.amazonaws.internal.SdkInternalList<String>(packages.length)); } for (String ele : packages) { this.packages.add(ele); } return this; }
/** * <p> * A <code>VolumeConfigurations</code> object that describes the layer's Amazon EBS volumes. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setVolumeConfigurations(java.util.Collection)} or {@link #withVolumeConfigurations(java.util.Collection)} * if you want to override the existing values. * </p> * * @param volumeConfigurations * A <code>VolumeConfigurations</code> object that describes the layer's Amazon EBS volumes. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withVolumeConfigurations(VolumeConfiguration... volumeConfigurations) { if (this.volumeConfigurations == null) { setVolumeConfigurations(new com.amazonaws.internal.SdkInternalList<VolumeConfiguration>(volumeConfigurations.length)); } for (VolumeConfiguration ele : volumeConfigurations) { this.volumeConfigurations.add(ele); } return this; }
/** * <p> * The layer type. A stack cannot have more than one built-in layer of the same type. It can have any number of * custom layers. Built-in layers are not available in Chef 12 stacks. * </p> * * @param type * The layer type. A stack cannot have more than one built-in layer of the same type. It can have any number * of custom layers. Built-in layers are not available in Chef 12 stacks. * @see LayerType */ public void setType(LayerType type) { withType(type); }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStackId() != null) sb.append("StackId: ").append(getStackId()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getShortname() != null) sb.append("Shortname: ").append(getShortname()).append(","); if (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()).append(","); if (getCloudWatchLogsConfiguration() != null) sb.append("CloudWatchLogsConfiguration: ").append(getCloudWatchLogsConfiguration()).append(","); if (getCustomInstanceProfileArn() != null) sb.append("CustomInstanceProfileArn: ").append(getCustomInstanceProfileArn()).append(","); if (getCustomJson() != null) sb.append("CustomJson: ").append(getCustomJson()).append(","); if (getCustomSecurityGroupIds() != null) sb.append("CustomSecurityGroupIds: ").append(getCustomSecurityGroupIds()).append(","); if (getPackages() != null) sb.append("Packages: ").append(getPackages()).append(","); if (getVolumeConfigurations() != null) sb.append("VolumeConfigurations: ").append(getVolumeConfigurations()).append(","); if (getEnableAutoHealing() != null) sb.append("EnableAutoHealing: ").append(getEnableAutoHealing()).append(","); if (getAutoAssignElasticIps() != null) sb.append("AutoAssignElasticIps: ").append(getAutoAssignElasticIps()).append(","); if (getAutoAssignPublicIps() != null)
/** * <p> * An array of <code>Package</code> objects that describes the layer packages. * </p> * * @param packages * An array of <code>Package</code> objects that describes the layer packages. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withPackages(java.util.Collection<String> packages) { setPackages(packages); return this; }
/** * <p> * A <code>VolumeConfigurations</code> object that describes the layer's Amazon EBS volumes. * </p> * * @param volumeConfigurations * A <code>VolumeConfigurations</code> object that describes the layer's Amazon EBS volumes. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withVolumeConfigurations(java.util.Collection<VolumeConfiguration> volumeConfigurations) { setVolumeConfigurations(volumeConfigurations); return this; }
/** * <p> * An array containing the layer custom security group IDs. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setCustomSecurityGroupIds(java.util.Collection)} or * {@link #withCustomSecurityGroupIds(java.util.Collection)} if you want to override the existing values. * </p> * * @param customSecurityGroupIds * An array containing the layer custom security group IDs. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withCustomSecurityGroupIds(String... customSecurityGroupIds) { if (this.customSecurityGroupIds == null) { setCustomSecurityGroupIds(new com.amazonaws.internal.SdkInternalList<String>(customSecurityGroupIds.length)); } for (String ele : customSecurityGroupIds) { this.customSecurityGroupIds.add(ele); } return this; }
/** * <p> * A <code>LayerCustomRecipes</code> object that specifies the layer custom recipes. * </p> * * @param customRecipes * A <code>LayerCustomRecipes</code> object that specifies the layer custom recipes. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withCustomRecipes(Recipes customRecipes) { setCustomRecipes(customRecipes); return this; }
/** * <p> * One or more user-defined key-value pairs to be added to the stack attributes. * </p> * <p> * To create a cluster layer, set the <code>EcsClusterArn</code> attribute to the cluster's ARN. * </p> * * @param attributes * One or more user-defined key-value pairs to be added to the stack attributes.</p> * <p> * To create a cluster layer, set the <code>EcsClusterArn</code> attribute to the cluster's ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; }
/** * Marshall the given parameter object. */ public void marshall(CreateLayerRequest createLayerRequest, ProtocolMarshaller protocolMarshaller) { if (createLayerRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createLayerRequest.getStackId(), STACKID_BINDING); protocolMarshaller.marshall(createLayerRequest.getType(), TYPE_BINDING); protocolMarshaller.marshall(createLayerRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createLayerRequest.getShortname(), SHORTNAME_BINDING); protocolMarshaller.marshall(createLayerRequest.getAttributes(), ATTRIBUTES_BINDING); protocolMarshaller.marshall(createLayerRequest.getCloudWatchLogsConfiguration(), CLOUDWATCHLOGSCONFIGURATION_BINDING); protocolMarshaller.marshall(createLayerRequest.getCustomInstanceProfileArn(), CUSTOMINSTANCEPROFILEARN_BINDING); protocolMarshaller.marshall(createLayerRequest.getCustomJson(), CUSTOMJSON_BINDING); protocolMarshaller.marshall(createLayerRequest.getCustomSecurityGroupIds(), CUSTOMSECURITYGROUPIDS_BINDING); protocolMarshaller.marshall(createLayerRequest.getPackages(), PACKAGES_BINDING); protocolMarshaller.marshall(createLayerRequest.getVolumeConfigurations(), VOLUMECONFIGURATIONS_BINDING); protocolMarshaller.marshall(createLayerRequest.getEnableAutoHealing(), ENABLEAUTOHEALING_BINDING); protocolMarshaller.marshall(createLayerRequest.getAutoAssignElasticIps(), AUTOASSIGNELASTICIPS_BINDING); protocolMarshaller.marshall(createLayerRequest.getAutoAssignPublicIps(), AUTOASSIGNPUBLICIPS_BINDING); protocolMarshaller.marshall(createLayerRequest.getCustomRecipes(), CUSTOMRECIPES_BINDING); protocolMarshaller.marshall(createLayerRequest.getInstallUpdatesOnBoot(), INSTALLUPDATESONBOOT_BINDING); protocolMarshaller.marshall(createLayerRequest.getUseEbsOptimizedInstances(), USEEBSOPTIMIZEDINSTANCES_BINDING); protocolMarshaller.marshall(createLayerRequest.getLifecycleEventConfiguration(), LIFECYCLEEVENTCONFIGURATION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * <p> * An array of <code>Package</code> objects that describes the layer packages. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setPackages(java.util.Collection)} or {@link #withPackages(java.util.Collection)} if you want to override * the existing values. * </p> * * @param packages * An array of <code>Package</code> objects that describes the layer packages. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLayerRequest withPackages(String... packages) { if (this.packages == null) { setPackages(new com.amazonaws.internal.SdkInternalList<String>(packages.length)); } for (String ele : packages) { this.packages.add(ele); } return this; }