@Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof EnableRadiusRequest == false) return false;
    EnableRadiusRequest other = (EnableRadiusRequest) obj;

    if (other.getDirectoryId() == null ^ this.getDirectoryId() == null) return false;
    if (other.getDirectoryId() != null
        && other.getDirectoryId().equals(this.getDirectoryId()) == false) return false;
    if (other.getRadiusSettings() == null ^ this.getRadiusSettings() == null) return false;
    if (other.getRadiusSettings() != null
        && other.getRadiusSettings().equals(this.getRadiusSettings()) == false) return false;
    return true;
  }
  public Request<EnableRadiusRequest> marshall(EnableRadiusRequest enableRadiusRequest) {

    if (enableRadiusRequest == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    Request<EnableRadiusRequest> request =
        new DefaultRequest<EnableRadiusRequest>(enableRadiusRequest, "AWSDirectoryService");
    request.addHeader("X-Amz-Target", "DirectoryService_20150416.EnableRadius");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

    try {
      final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator();

      jsonGenerator.writeStartObject();

      if (enableRadiusRequest.getDirectoryId() != null) {
        jsonGenerator
            .writeFieldName("DirectoryId")
            .writeValue(enableRadiusRequest.getDirectoryId());
      }
      if (enableRadiusRequest.getRadiusSettings() != null) {
        jsonGenerator.writeFieldName("RadiusSettings");
        RadiusSettingsJsonMarshaller.getInstance()
            .marshall(enableRadiusRequest.getRadiusSettings(), jsonGenerator);
      }

      jsonGenerator.writeEndObject();

      byte[] content = jsonGenerator.getBytes();
      request.setContent(new ByteArrayInputStream(content));
      request.addHeader("Content-Length", Integer.toString(content.length));
      request.addHeader("Content-Type", protocolFactory.getContentType());
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }