text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/monitoring/v3/notification_service.proto

package com.google.monitoring.v3;

/**
 *

 * The `UpdateNotificationChannel` request.
 *

 *
 * Protobuf type {@code google.monitoring.v3.UpdateNotificationChannelRequest}
 */
public  final class UpdateNotificationChannelRequest extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.monitoring.v3.UpdateNotificationChannelRequest)
    UpdateNotificationChannelRequestOrBuilder {
private static final long serialVersionUID = 0L;
  // Use UpdateNotificationChannelRequest.newBuilder() to construct.
  private UpdateNotificationChannelRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private UpdateNotificationChannelRequest() {
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private UpdateNotificationChannelRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 18: {
            com.google.protobuf.FieldMask.Builder subBuilder = null;
            if (updateMask_ != null) {
              subBuilder = updateMask_.toBuilder();
            }
            updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(updateMask_);
              updateMask_ = subBuilder.buildPartial();
            }

            break;
          }
          case 26: {
            com.google.monitoring.v3.NotificationChannel.Builder subBuilder = null;
            if (notificationChannel_ != null) {
              subBuilder = notificationChannel_.toBuilder();
            }
            notificationChannel_ = input.readMessage(com.google.monitoring.v3.NotificationChannel.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(notificationChannel_);
              notificationChannel_ = subBuilder.buildPartial();
            }

            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.monitoring.v3.NotificationServiceProto.internal_static_google_monitoring_v3_UpdateNotificationChannelRequest_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.monitoring.v3.NotificationServiceProto.internal_static_google_monitoring_v3_UpdateNotificationChannelRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.monitoring.v3.UpdateNotificationChannelRequest.class, com.google.monitoring.v3.UpdateNotificationChannelRequest.Builder.class);
  }

  public static final int UPDATE_MASK_FIELD_NUMBER = 2;
  private com.google.protobuf.FieldMask updateMask_;
  /**
   *

   * The fields to update.
   *

   *
   * .google.protobuf.FieldMask update_mask = 2;
   */
  public boolean hasUpdateMask() {
    return updateMask_ != null;
  }
  /**
   *

   * The fields to update.
   *

   *
   * .google.protobuf.FieldMask update_mask = 2;
   */
  public com.google.protobuf.FieldMask getUpdateMask() {
    return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
  }
  /**
   *

   * The fields to update.
   *

   *
   * .google.protobuf.FieldMask update_mask = 2;
   */
  public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
    return getUpdateMask();
  }

  public static final int NOTIFICATION_CHANNEL_FIELD_NUMBER = 3;
  private com.google.monitoring.v3.NotificationChannel notificationChannel_;
  /**
   *

   * A description of the changes to be applied to the specified
   * notification channel. The description must provide a definition for
   * fields to be updated; the names of these fields should also be
   * included in the `update_mask`.
   *

   *
   * .google.monitoring.v3.NotificationChannel notification_channel = 3;
   */
  public boolean hasNotificationChannel() {
    return notificationChannel_ != null;
  }
  /**
   *

   * A description of the changes to be applied to the specified
   * notification channel. The description must provide a definition for
   * fields to be updated; the names of these fields should also be
   * included in the `update_mask`.
   *

   *
   * .google.monitoring.v3.NotificationChannel notification_channel = 3;
   */
  public com.google.monitoring.v3.NotificationChannel getNotificationChannel() {
    return notificationChannel_ == null ? com.google.monitoring.v3.NotificationChannel.getDefaultInstance() : notificationChannel_;
  }
  /**
   *

   * A description of the changes to be applied to the specified
   * notification channel. The description must provide a definition for
   * fields to be updated; the names of these fields should also be
   * included in the `update_mask`.
   *

   *
   * .google.monitoring.v3.NotificationChannel notification_channel = 3;
   */
  public com.google.monitoring.v3.NotificationChannelOrBuilder getNotificationChannelOrBuilder() {
    return getNotificationChannel();
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (updateMask_ != null) {
      output.writeMessage(2, getUpdateMask());
    }
    if (notificationChannel_ != null) {
      output.writeMessage(3, getNotificationChannel());
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (updateMask_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, getUpdateMask());
    }
    if (notificationChannel_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getNotificationChannel());
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.monitoring.v3.UpdateNotificationChannelRequest)) {
      return super.equals(obj);
    }
    com.google.monitoring.v3.UpdateNotificationChannelRequest other = (com.google.monitoring.v3.UpdateNotificationChannelRequest) obj;

    boolean result = true;
    result = result && (hasUpdateMask() == other.hasUpdateMask());
    if (hasUpdateMask()) {
      result = result && getUpdateMask()
          .equals(other.getUpdateMask());
    }
    result = result && (hasNotificationChannel() == other.hasNotificationChannel());
    if (hasNotificationChannel()) {
      result = result && getNotificationChannel()
          .equals(other.getNotificationChannel());
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasUpdateMask()) {
      hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateMask().hashCode();
    }
    if (hasNotificationChannel()) {
      hash = (37 * hash) + NOTIFICATION_CHANNEL_FIELD_NUMBER;
      hash = (53 * hash) + getNotificationChannel().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.monitoring.v3.UpdateNotificationChannelRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.monitoring.v3.UpdateNotificationChannelRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *

   * The `UpdateNotificationChannel` request.
   *

   *
   * Protobuf type {@code google.monitoring.v3.UpdateNotificationChannelRequest}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.monitoring.v3.UpdateNotificationChannelRequest)
      com.google.monitoring.v3.UpdateNotificationChannelRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.monitoring.v3.NotificationServiceProto.internal_static_google_monitoring_v3_UpdateNotificationChannelRequest_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.monitoring.v3.NotificationServiceProto.internal_static_google_monitoring_v3_UpdateNotificationChannelRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.monitoring.v3.UpdateNotificationChannelRequest.class, com.google.monitoring.v3.UpdateNotificationChannelRequest.Builder.class);
    }

    // Construct using com.google.monitoring.v3.UpdateNotificationChannelRequest.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }
      if (notificationChannelBuilder_ == null) {
        notificationChannel_ = null;
      } else {
        notificationChannel_ = null;
        notificationChannelBuilder_ = null;
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.monitoring.v3.NotificationServiceProto.internal_static_google_monitoring_v3_UpdateNotificationChannelRequest_descriptor;
    }

    public com.google.monitoring.v3.UpdateNotificationChannelRequest getDefaultInstanceForType() {
      return com.google.monitoring.v3.UpdateNotificationChannelRequest.getDefaultInstance();
    }

    public com.google.monitoring.v3.UpdateNotificationChannelRequest build() {
      com.google.monitoring.v3.UpdateNotificationChannelRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.monitoring.v3.UpdateNotificationChannelRequest buildPartial() {
      com.google.monitoring.v3.UpdateNotificationChannelRequest result = new com.google.monitoring.v3.UpdateNotificationChannelRequest(this);
      if (updateMaskBuilder_ == null) {
        result.updateMask_ = updateMask_;
      } else {
        result.updateMask_ = updateMaskBuilder_.build();
      }
      if (notificationChannelBuilder_ == null) {
        result.notificationChannel_ = notificationChannel_;
      } else {
        result.notificationChannel_ = notificationChannelBuilder_.build();
      }
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.monitoring.v3.UpdateNotificationChannelRequest) {
        return mergeFrom((com.google.monitoring.v3.UpdateNotificationChannelRequest)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.monitoring.v3.UpdateNotificationChannelRequest other) {
      if (other == com.google.monitoring.v3.UpdateNotificationChannelRequest.getDefaultInstance()) return this;
      if (other.hasUpdateMask()) {
        mergeUpdateMask(other.getUpdateMask());
      }
      if (other.hasNotificationChannel()) {
        mergeNotificationChannel(other.getNotificationChannel());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.monitoring.v3.UpdateNotificationChannelRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.monitoring.v3.UpdateNotificationChannelRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private com.google.protobuf.FieldMask updateMask_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_;
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public boolean hasUpdateMask() {
      return updateMaskBuilder_ != null || updateMask_ != null;
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public com.google.protobuf.FieldMask getUpdateMask() {
      if (updateMaskBuilder_ == null) {
        return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
      } else {
        return updateMaskBuilder_.getMessage();
      }
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public Builder setUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateMask_ = value;
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public Builder setUpdateMask(
        com.google.protobuf.FieldMask.Builder builderForValue) {
      if (updateMaskBuilder_ == null) {
        updateMask_ = builderForValue.build();
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (updateMask_ != null) {
          updateMask_ =
            com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial();
        } else {
          updateMask_ = value;
        }
        onChanged();
      } else {
        updateMaskBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public Builder clearUpdateMask() {
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
        onChanged();
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() {

      onChanged();
      return getUpdateMaskFieldBuilder().getBuilder();
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
      if (updateMaskBuilder_ != null) {
        return updateMaskBuilder_.getMessageOrBuilder();
      } else {
        return updateMask_ == null ?
            com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
      }
    }
    /**
     *

     * The fields to update.
     *

     *
     * .google.protobuf.FieldMask update_mask = 2;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>
        getUpdateMaskFieldBuilder() {
      if (updateMaskBuilder_ == null) {
        updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>(
                getUpdateMask(),
                getParentForChildren(),
                isClean());
        updateMask_ = null;
      }
      return updateMaskBuilder_;
    }

    private com.google.monitoring.v3.NotificationChannel notificationChannel_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.monitoring.v3.NotificationChannel, com.google.monitoring.v3.NotificationChannel.Builder, com.google.monitoring.v3.NotificationChannelOrBuilder> notificationChannelBuilder_;
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public boolean hasNotificationChannel() {
      return notificationChannelBuilder_ != null || notificationChannel_ != null;
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public com.google.monitoring.v3.NotificationChannel getNotificationChannel() {
      if (notificationChannelBuilder_ == null) {
        return notificationChannel_ == null ? com.google.monitoring.v3.NotificationChannel.getDefaultInstance() : notificationChannel_;
      } else {
        return notificationChannelBuilder_.getMessage();
      }
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public Builder setNotificationChannel(com.google.monitoring.v3.NotificationChannel value) {
      if (notificationChannelBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        notificationChannel_ = value;
        onChanged();
      } else {
        notificationChannelBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public Builder setNotificationChannel(
        com.google.monitoring.v3.NotificationChannel.Builder builderForValue) {
      if (notificationChannelBuilder_ == null) {
        notificationChannel_ = builderForValue.build();
        onChanged();
      } else {
        notificationChannelBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public Builder mergeNotificationChannel(com.google.monitoring.v3.NotificationChannel value) {
      if (notificationChannelBuilder_ == null) {
        if (notificationChannel_ != null) {
          notificationChannel_ =
            com.google.monitoring.v3.NotificationChannel.newBuilder(notificationChannel_).mergeFrom(value).buildPartial();
        } else {
          notificationChannel_ = value;
        }
        onChanged();
      } else {
        notificationChannelBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public Builder clearNotificationChannel() {
      if (notificationChannelBuilder_ == null) {
        notificationChannel_ = null;
        onChanged();
      } else {
        notificationChannel_ = null;
        notificationChannelBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public com.google.monitoring.v3.NotificationChannel.Builder getNotificationChannelBuilder() {

      onChanged();
      return getNotificationChannelFieldBuilder().getBuilder();
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    public com.google.monitoring.v3.NotificationChannelOrBuilder getNotificationChannelOrBuilder() {
      if (notificationChannelBuilder_ != null) {
        return notificationChannelBuilder_.getMessageOrBuilder();
      } else {
        return notificationChannel_ == null ?
            com.google.monitoring.v3.NotificationChannel.getDefaultInstance() : notificationChannel_;
      }
    }
    /**
     *

     * A description of the changes to be applied to the specified
     * notification channel. The description must provide a definition for
     * fields to be updated; the names of these fields should also be
     * included in the `update_mask`.
     *

     *
     * .google.monitoring.v3.NotificationChannel notification_channel = 3;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.monitoring.v3.NotificationChannel, com.google.monitoring.v3.NotificationChannel.Builder, com.google.monitoring.v3.NotificationChannelOrBuilder>
        getNotificationChannelFieldBuilder() {
      if (notificationChannelBuilder_ == null) {
        notificationChannelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.monitoring.v3.NotificationChannel, com.google.monitoring.v3.NotificationChannel.Builder, com.google.monitoring.v3.NotificationChannelOrBuilder>(
                getNotificationChannel(),
                getParentForChildren(),
                isClean());
        notificationChannel_ = null;
      }
      return notificationChannelBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.monitoring.v3.UpdateNotificationChannelRequest)
  }

  // @@protoc_insertion_point(class_scope:google.monitoring.v3.UpdateNotificationChannelRequest)
  private static final com.google.monitoring.v3.UpdateNotificationChannelRequest DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.monitoring.v3.UpdateNotificationChannelRequest();
  }

  public static com.google.monitoring.v3.UpdateNotificationChannelRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<UpdateNotificationChannelRequest>
      PARSER = new com.google.protobuf.AbstractParser<UpdateNotificationChannelRequest>() {
    public UpdateNotificationChannelRequest parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new UpdateNotificationChannelRequest(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<UpdateNotificationChannelRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<UpdateNotificationChannelRequest> getParserForType() {
    return PARSER;
  }

  public com.google.monitoring.v3.UpdateNotificationChannelRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.09.05 at 06:20:26 PM IST
//

package com.mozu.qbintegration.model.qbmodel.salesorderadd;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for SalesOrderAddType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="SalesOrderAddType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="CustomerRef" type="{}CustomerRefType"/>
 *         <element name="ClassRef" type="{}ClassRefType"/>
 *         <element name="TemplateRef" type="{}TemplateRefType"/>
 *         <element name="TxnDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="RefNumber" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="BillAddress" type="{}BillAddressType"/>
 *         <element name="ShipAddress" type="{}ShipAddressType"/>
 *         <element name="PONumber" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="TermsRef" type="{}TermsRefType"/>
 *         <element name="DueDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="SalesRepRef" type="{}SalesRepRefType"/>
 *         <element name="FOB" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="ShipDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="ShipMethodRef" type="{}ShipMethodRefType"/>
 *         <element name="ItemSalesTaxRef" type="{}ItemSalesTaxRefType"/>
 *         <element name="IsManuallyClosed" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="Memo" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="CustomerMsgRef" type="{}CustomerMsgRefType"/>
 *         <element name="IsToBePrinted" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="IsToBeEmailed" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="CustomerSalesTaxCodeRef" type="{}CustomerSalesTaxCodeRefType"/>
 *         <element name="Other" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="ExchangeRate" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="ExternalGUID" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="SalesOrderLineAdd" type="{}SalesOrderLineAddType" maxOccurs="unbounded" minOccurs="0"/>
 *         <element name="SalesOrderLineGroupAdd" type="{}SalesOrderLineGroupAddType"/>
 *       </sequence>
 *       <attribute name="defMacro" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SalesOrderAddType", propOrder = {
    "customerRef",
    "classRef",
    "templateRef",
    "txnDate",
    "refNumber",
    "billAddress",
    "shipAddress",
    "poNumber",
    "termsRef",
    "dueDate",
    "salesRepRef",
    "fob",
    "shipDate",
    "shipMethodRef",
    "itemSalesTaxRef",
    "isManuallyClosed",
    "memo",
    "customerMsgRef",
    "isToBePrinted",
    "isToBeEmailed",
    "customerSalesTaxCodeRef",
    "other",
    "exchangeRate",
    "externalGUID",
    "salesOrderLineAdd",
    "salesOrderLineGroupAdd"
})
public class SalesOrderAddType {

    @XmlElement(name = "CustomerRef", required = true)
    protected CustomerRefType customerRef;
    @XmlElement(name = "ClassRef", required = true)
    protected ClassRefType classRef;
    @XmlElement(name = "TemplateRef", required = true)
    protected TemplateRefType templateRef;
    @XmlElement(name = "TxnDate", required = true)
    protected String txnDate;
    @XmlElement(name = "RefNumber", required = true)
    protected String refNumber;
    @XmlElement(name = "BillAddress", required = true)
    protected BillAddressType billAddress;
    @XmlElement(name = "ShipAddress", required = true)
    protected ShipAddressType shipAddress;
    @XmlElement(name = "PONumber", required = true)
    protected String poNumber;
    @XmlElement(name = "TermsRef", required = true)
    protected TermsRefType termsRef;
    @XmlElement(name = "DueDate", required = true)
    protected String dueDate;
    @XmlElement(name = "SalesRepRef", required = true)
    protected SalesRepRefType salesRepRef;
    @XmlElement(name = "FOB", required = true)
    protected String fob;
    @XmlElement(name = "ShipDate", required = true)
    protected String shipDate;
    @XmlElement(name = "ShipMethodRef", required = true)
    protected ShipMethodRefType shipMethodRef;
    @XmlElement(name = "ItemSalesTaxRef", required = true)
    protected ItemSalesTaxRefType itemSalesTaxRef;
    @XmlElement(name = "IsManuallyClosed", required = true)
    protected String isManuallyClosed;
    @XmlElement(name = "Memo", required = true)
    protected String memo;
    @XmlElement(name = "CustomerMsgRef", required = true)
    protected CustomerMsgRefType customerMsgRef;
    @XmlElement(name = "IsToBePrinted", required = true)
    protected String isToBePrinted;
    @XmlElement(name = "IsToBeEmailed", required = true)
    protected String isToBeEmailed;
    @XmlElement(name = "CustomerSalesTaxCodeRef", required = true)
    protected CustomerSalesTaxCodeRefType customerSalesTaxCodeRef;
    @XmlElement(name = "Other", required = true)
    protected String other;
    @XmlElement(name = "ExchangeRate", required = true)
    protected String exchangeRate;
    @XmlElement(name = "ExternalGUID", required = true)
    protected String externalGUID;
    @XmlElement(name = "SalesOrderLineAdd")
    protected List<SalesOrderLineAddType> salesOrderLineAdd;
    @XmlElement(name = "SalesOrderLineGroupAdd", required = true)
    protected SalesOrderLineGroupAddType salesOrderLineGroupAdd;
    @XmlAttribute(name = "defMacro")
    protected String defMacro;

    /**
     * Gets the value of the customerRef property.
     *
     * @return
     *     possible object is
     *     {@link CustomerRefType }
     *
     */
    public CustomerRefType getCustomerRef() {
        return customerRef;
    }

    /**
     * Sets the value of the customerRef property.
     *
     * @param value
     *     allowed object is
     *     {@link CustomerRefType }
     *
     */
    public void setCustomerRef(CustomerRefType value) {
        this.customerRef = value;
    }

    /**
     * Gets the value of the classRef property.
     *
     * @return
     *     possible object is
     *     {@link ClassRefType }
     *
     */
    public ClassRefType getClassRef() {
        return classRef;
    }

    /**
     * Sets the value of the classRef property.
     *
     * @param value
     *     allowed object is
     *     {@link ClassRefType }
     *
     */
    public void setClassRef(ClassRefType value) {
        this.classRef = value;
    }

    /**
     * Gets the value of the templateRef property.
     *
     * @return
     *     possible object is
     *     {@link TemplateRefType }
     *
     */
    public TemplateRefType getTemplateRef() {
        return templateRef;
    }

    /**
     * Sets the value of the templateRef property.
     *
     * @param value
     *     allowed object is
     *     {@link TemplateRefType }
     *
     */
    public void setTemplateRef(TemplateRefType value) {
        this.templateRef = value;
    }

    /**
     * Gets the value of the txnDate property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getTxnDate() {
        return txnDate;
    }

    /**
     * Sets the value of the txnDate property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setTxnDate(String value) {
        this.txnDate = value;
    }

    /**
     * Gets the value of the refNumber property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRefNumber() {
        return refNumber;
    }

    /**
     * Sets the value of the refNumber property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRefNumber(String value) {
        this.refNumber = value;
    }

    /**
     * Gets the value of the billAddress property.
     *
     * @return
     *     possible object is
     *     {@link BillAddressType }
     *
     */
    public BillAddressType getBillAddress() {
        return billAddress;
    }

    /**
     * Sets the value of the billAddress property.
     *
     * @param value
     *     allowed object is
     *     {@link BillAddressType }
     *
     */
    public void setBillAddress(BillAddressType value) {
        this.billAddress = value;
    }

    /**
     * Gets the value of the shipAddress property.
     *
     * @return
     *     possible object is
     *     {@link ShipAddressType }
     *
     */
    public ShipAddressType getShipAddress() {
        return shipAddress;
    }

    /**
     * Sets the value of the shipAddress property.
     *
     * @param value
     *     allowed object is
     *     {@link ShipAddressType }
     *
     */
    public void setShipAddress(ShipAddressType value) {
        this.shipAddress = value;
    }

    /**
     * Gets the value of the poNumber property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPONumber() {
        return poNumber;
    }

    /**
     * Sets the value of the poNumber property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPONumber(String value) {
        this.poNumber = value;
    }

    /**
     * Gets the value of the termsRef property.
     *
     * @return
     *     possible object is
     *     {@link TermsRefType }
     *
     */
    public TermsRefType getTermsRef() {
        return termsRef;
    }

    /**
     * Sets the value of the termsRef property.
     *
     * @param value
     *     allowed object is
     *     {@link TermsRefType }
     *
     */
    public void setTermsRef(TermsRefType value) {
        this.termsRef = value;
    }

    /**
     * Gets the value of the dueDate property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDueDate() {
        return dueDate;
    }

    /**
     * Sets the value of the dueDate property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDueDate(String value) {
        this.dueDate = value;
    }

    /**
     * Gets the value of the salesRepRef property.
     *
     * @return
     *     possible object is
     *     {@link SalesRepRefType }
     *
     */
    public SalesRepRefType getSalesRepRef() {
        return salesRepRef;
    }

    /**
     * Sets the value of the salesRepRef property.
     *
     * @param value
     *     allowed object is
     *     {@link SalesRepRefType }
     *
     */
    public void setSalesRepRef(SalesRepRefType value) {
        this.salesRepRef = value;
    }

    /**
     * Gets the value of the fob property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getFOB() {
        return fob;
    }

    /**
     * Sets the value of the fob property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setFOB(String value) {
        this.fob = value;
    }

    /**
     * Gets the value of the shipDate property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getShipDate() {
        return shipDate;
    }

    /**
     * Sets the value of the shipDate property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setShipDate(String value) {
        this.shipDate = value;
    }

    /**
     * Gets the value of the shipMethodRef property.
     *
     * @return
     *     possible object is
     *     {@link ShipMethodRefType }
     *
     */
    public ShipMethodRefType getShipMethodRef() {
        return shipMethodRef;
    }

    /**
     * Sets the value of the shipMethodRef property.
     *
     * @param value
     *     allowed object is
     *     {@link ShipMethodRefType }
     *
     */
    public void setShipMethodRef(ShipMethodRefType value) {
        this.shipMethodRef = value;
    }

    /**
     * Gets the value of the itemSalesTaxRef property.
     *
     * @return
     *     possible object is
     *     {@link ItemSalesTaxRefType }
     *
     */
    public ItemSalesTaxRefType getItemSalesTaxRef() {
        return itemSalesTaxRef;
    }

    /**
     * Sets the value of the itemSalesTaxRef property.
     *
     * @param value
     *     allowed object is
     *     {@link ItemSalesTaxRefType }
     *
     */
    public void setItemSalesTaxRef(ItemSalesTaxRefType value) {
        this.itemSalesTaxRef = value;
    }

    /**
     * Gets the value of the isManuallyClosed property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIsManuallyClosed() {
        return isManuallyClosed;
    }

    /**
     * Sets the value of the isManuallyClosed property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIsManuallyClosed(String value) {
        this.isManuallyClosed = value;
    }

    /**
     * Gets the value of the memo property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getMemo() {
        return memo;
    }

    /**
     * Sets the value of the memo property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setMemo(String value) {
        this.memo = value;
    }

    /**
     * Gets the value of the customerMsgRef property.
     *
     * @return
     *     possible object is
     *     {@link CustomerMsgRefType }
     *
     */
    public CustomerMsgRefType getCustomerMsgRef() {
        return customerMsgRef;
    }

    /**
     * Sets the value of the customerMsgRef property.
     *
     * @param value
     *     allowed object is
     *     {@link CustomerMsgRefType }
     *
     */
    public void setCustomerMsgRef(CustomerMsgRefType value) {
        this.customerMsgRef = value;
    }

    /**
     * Gets the value of the isToBePrinted property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIsToBePrinted() {
        return isToBePrinted;
    }

    /**
     * Sets the value of the isToBePrinted property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIsToBePrinted(String value) {
        this.isToBePrinted = value;
    }

    /**
     * Gets the value of the isToBeEmailed property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIsToBeEmailed() {
        return isToBeEmailed;
    }

    /**
     * Sets the value of the isToBeEmailed property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIsToBeEmailed(String value) {
        this.isToBeEmailed = value;
    }

    /**
     * Gets the value of the customerSalesTaxCodeRef property.
     *
     * @return
     *     possible object is
     *     {@link CustomerSalesTaxCodeRefType }
     *
     */
    public CustomerSalesTaxCodeRefType getCustomerSalesTaxCodeRef() {
        return customerSalesTaxCodeRef;
    }

    /**
     * Sets the value of the customerSalesTaxCodeRef property.
     *
     * @param value
     *     allowed object is
     *     {@link CustomerSalesTaxCodeRefType }
     *
     */
    public void setCustomerSalesTaxCodeRef(CustomerSalesTaxCodeRefType value) {
        this.customerSalesTaxCodeRef = value;
    }

    /**
     * Gets the value of the other property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOther() {
        return other;
    }

    /**
     * Sets the value of the other property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOther(String value) {
        this.other = value;
    }

    /**
     * Gets the value of the exchangeRate property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getExchangeRate() {
        return exchangeRate;
    }

    /**
     * Sets the value of the exchangeRate property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setExchangeRate(String value) {
        this.exchangeRate = value;
    }

    /**
     * Gets the value of the externalGUID property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getExternalGUID() {
        return externalGUID;
    }

    /**
     * Sets the value of the externalGUID property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setExternalGUID(String value) {
        this.externalGUID = value;
    }

    /**
     * Gets the value of the salesOrderLineAdd property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the salesOrderLineAdd property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getSalesOrderLineAdd().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link SalesOrderLineAddType }
     *
     *
     */
    public List<SalesOrderLineAddType> getSalesOrderLineAdd() {
        if (salesOrderLineAdd == null) {
            salesOrderLineAdd = new ArrayList<SalesOrderLineAddType>();
        }
        return this.salesOrderLineAdd;
    }

    /**
     * Gets the value of the salesOrderLineGroupAdd property.
     *
     * @return
     *     possible object is
     *     {@link SalesOrderLineGroupAddType }
     *
     */
    public SalesOrderLineGroupAddType getSalesOrderLineGroupAdd() {
        return salesOrderLineGroupAdd;
    }

    /**
     * Sets the value of the salesOrderLineGroupAdd property.
     *
     * @param value
     *     allowed object is
     *     {@link SalesOrderLineGroupAddType }
     *
     */
    public void setSalesOrderLineGroupAdd(SalesOrderLineGroupAddType value) {
        this.salesOrderLineGroupAdd = value;
    }

    /**
     * Gets the value of the defMacro property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDefMacro() {
        return defMacro;
    }

    /**
     * Sets the value of the defMacro property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDefMacro(String value) {
        this.defMacro = value;
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html  PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>

<title>Twisted Documentation: The Evolution of Finger: cleaning up the finger code</title>
<link href="../stylesheet.css" rel="stylesheet" type="text/css"/>

The Evolution of Finger: cleaning up the finger code

Introduction

Write Readable Code

Introduction

 This is the third part of the Twisted tutorial Twisted from Scratch, or The Evolution of Finger.

In this section of the tutorial, we'll clean up our code so that it is
closer to a readable and extendable style.

Write Readable Code

The last version of the application had a lot of hacks. We avoided
sub-classing, didn't support things like user listings over the web,
and removed all blank lines -- all in the interest of code
which is shorter. Here we take a step back, subclass what is more
naturally a subclass, make things which should take multiple lines
take them, etc. This shows a much better style of developing Twisted
applications, though the hacks in the previous stages are sometimes
used in throw-away prototypes.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

# Do everything properly
from twisted.application import internet, service
from twisted.internet import protocol, reactor, defer
from twisted.words.protocols import irc
from twisted.protocols import basic
from twisted.web import resource, server, static, xmlrpc
import cgi

def catchError(err):
    return "Internal error in server"

class FingerProtocol(basic.LineReceiver):

    def lineReceived(self, user):
        d = self.factory.getUser(user)
        d.addErrback(catchError)
        def writeValue(value):
            self.transport.write(value+'\r\n')
            self.transport.loseConnection()
        d.addCallback(writeValue)

class IRCReplyBot(irc.IRCClient):

    def connectionMade(self):
        self.nickname = self.factory.nickname
        irc.IRCClient.connectionMade(self)

    def privmsg(self, user, channel, msg):
        user = user.split('!')[0]
        if self.nickname.lower() == channel.lower():
            d = self.factory.getUser(msg)
            d.addErrback(catchError)
            d.addCallback(lambda m: "Status of %s: %s" % (msg, m))
            d.addCallback(lambda m: self.msg(user, m))

class UserStatusTree(resource.Resource):
    def __init__(self, service):
        resource.Resource.__init__(self)
        self.service = service

    def render_GET(self, request):
        d = self.service.getUsers()
        def formatUsers(users):
            l = ['<li><a href="%s">%s</a></li>' % (user, user)
                 for user in users]
            return '<ul>'+''.join(l)+'</ul>'
        d.addCallback(formatUsers)
        d.addCallback(request.write)
        d.addCallback(lambda _: request.finish())
        return server.NOT_DONE_YET

    def getChild(self, path, request):
        if path=="":
            return UserStatusTree(self.service)
        else:
            return UserStatus(path, self.service)

class UserStatus(resource.Resource):

    def __init__(self, user, service):
        resource.Resource.__init__(self)
        self.user = user
        self.service = service

    def render_GET(self, request):
        d = self.service.getUser(self.user)
        d.addCallback(cgi.escape)
        d.addCallback(lambda m:
                      '<h1>%s</h1>'%self.user+'<p>%s</p>'%m)
        d.addCallback(request.write)
        d.addCallback(lambda _: request.finish())
        return server.NOT_DONE_YET

class UserStatusXR(xmlrpc.XMLRPC):

    def __init__(self, service):
        xmlrpc.XMLRPC.__init__(self)
        self.service = service

    def xmlrpc_getUser(self, user):
        return self.service.getUser(user)

class FingerService(service.Service):

    def __init__(self, filename):
        self.filename = filename
        self.users = {}
        self._read()

    def _read(self):
        self.users.clear()
        for line in file(self.filename):
            user, status = line.split(':', 1)
            user = user.strip()
            status = status.strip()
            self.users[user] = status
        self.call = reactor.callLater(30, self._read)

    def getUser(self, user):
        return defer.succeed(self.users.get(user, "No such user"))

    def getUsers(self):
        return defer.succeed(self.users.keys())

    def getFingerFactory(self):
        f = protocol.ServerFactory()
        f.protocol = FingerProtocol
        f.getUser = self.getUser
        return f

    def getResource(self):
        r = UserStatusTree(self)
        x = UserStatusXR(self)
        r.putChild('RPC2', x)
        return r

    def getIRCBot(self, nickname):
        f = protocol.ReconnectingClientFactory()
        f.protocol = IRCReplyBot
        f.nickname = nickname
        f.getUser = self.getUser
        return f

application = service.Application('finger', uid=1, gid=1)
f = FingerService('/etc/users')
serviceCollection = service.IServiceCollection(application)
internet.TCPServer(79, f.getFingerFactory()
                   ).setServiceParent(serviceCollection)
internet.TCPServer(8000, server.Site(f.getResource())
                   ).setServiceParent(serviceCollection)
internet.TCPClient('irc.freenode.org', 6667, f.getIRCBot('fingerbot')
                   ).setServiceParent(serviceCollection)

Source listing - listings/finger/finger18.tac

Index

    Version: 10.0.0


text:
ng-chance
=========

This project aims to provide an easy way to integrate Chance.js with Angular.

### Installation

#### Download via Bower
```
bower install ng-chance
```

#### Add script tags
```
<script src="bower_components/chance/chance.js"></script>
<script src="bower_components/ng-chance/ng-chance.js"></script>
```

### Usage
```
<h1 ng-chance="name"></h1>
```
```
<p ng-chance="phone"></p>
```


text:
describe('Unit : youtubePlugin design.home.controller.js', function () {
  var $scope, DesignHome, $rootScope, q, $controller, DataStore, ImageLibrary, TAG_NAMES, STATUS_CODE, STATUS_MESSAGES, CONTENT_TYPE;
  beforeEach(module('youtubePluginDesign'));

  beforeEach(inject(function (_$rootScope_, _$q_, _$controller_, _DataStore_, _ImageLibrary_, _TAG_NAMES_, _CONTENT_TYPE_, _STATUS_CODE_, _STATUS_MESSAGES_) {
    $rootScope = _$rootScope_;
    q = _$q_;
    $scope = $rootScope.$new();
    $controller = _$controller_;
    DataStore = _DataStore_;
    TAG_NAMES = _TAG_NAMES_;
    CONTENT_TYPE = _CONTENT_TYPE_;
    STATUS_CODE = _STATUS_CODE_;
    STATUS_MESSAGES = _STATUS_MESSAGES_;
    ImageLibrary = jasmine.createSpyObj('ImageLibrary', ['showDialog']);

  }));

  beforeEach(function () {
    DesignHome = $controller('DesignHomeCtrl', {
      $scope: $scope,
      $q: q,
      DataStore: DataStore,
      ImageLibrary: ImageLibrary,
      TAG_NAMES: TAG_NAMES,
      CONTENT_TYPE: CONTENT_TYPE
    });
  });

  describe('Units: units should be Defined', function () {
    it('it should pass if DataStore is defined', function () {
      expect(DataStore).not.toBeUndefined();
    });
    it('it should pass if ImageLibrary is defined', function () {
      expect(ImageLibrary).not.toBeUndefined();
    });
    it('it should pass if TAG_NAMES is defined', function () {
      expect(TAG_NAMES).not.toBeUndefined();
    });
    it('it should pass if CONTENT_TYPE is defined', function () {
      expect(CONTENT_TYPE).not.toBeUndefined();
    });
  });

  describe('DesignHome.masterData', function () {
    it('it should pass if DesignHome.masterData match the result', function () {
      expect(DesignHome.masterData).toEqual({
        "content": {
          "carouselImages": [],
          "description": '

',
          "rssUrl": "",
          "type": "",
          "playListID": null,
          "videoID": null
        },
        "design": {
          "itemListLayout": DesignHome.layouts.listLayouts[0].name,
          "itemListBgImage": "",
          "itemDetailsBgImage": ""
        }
      });
    });
  });
  describe('Variable Unit: DesignHome.data', function () {
    it('it should pass if DesignHome.data match the result', function () {
      expect(DesignHome.data).toEqual({
        "content": {
          "carouselImages": [],
          "description": '

',
          "rssUrl": "",
          "type": "",
          "playListID": null,
          "videoID": null
        },
        "design": {
          "itemListLayout": DesignHome.layouts.listLayouts[0].name,
          "itemListBgImage": "",
          "itemDetailsBgImage": ""
        }
      });
    });
  });
  describe('Variable Unit: DesignHome.layouts', function () {
    it('it should pass if DesignHome.layouts match the result', function () {
      expect(DesignHome.layouts).toEqual({
        listLayouts: [
          {name: "List_Layout_1"},
          {name: "List_Layout_2"},
          {name: "List_Layout_3"},
          {name: "List_Layout_4"}
        ]
      });
    });
  });

  describe('Function :DesignHome.changeListLayout', function () {
    it('DesignHome.changeListLayout should exist and be a function', function () {
      expect(typeof DesignHome.changeListLayout).toEqual('function');
    });
    it('it should pass if DesignHome.data.design.itemListLayout is equals to "List_Layout_4" after passing parameter "List_Layout_4" to DesignHome.changeListLayout', function () {
      DesignHome.changeListLayout('List_Layout_4');
      $rootScope.$digest();
      expect(DesignHome.data.design.itemListLayout).toEqual('List_Layout_4');
    });
  });

  describe('Function :DesignHome.addItemDetailsBackgroundImage', function () {
    it('DesignHome.addItemDetailsBackgroundImage should exist and be a function', function () {
      expect(typeof DesignHome.addItemDetailsBackgroundImage).toEqual('function');
    });
    it('it should Fail after DesignHome.addItemDetailsBackgroundImage function call', function () {
      ImageLibrary.showDialog.and.callFake(function () {
        var deferred = q.defer();
        deferred.reject({
          code: STATUS_CODE.UNDEFINED_OPTIONS,
          message: STATUS_MESSAGES.UNDEFINED_OPTIONS
        });
        return deferred.promise;
      });
      DesignHome.addItemDetailsBackgroundImage();
      $rootScope.$digest();
      expect(DesignHome.data.design.itemDetailsBgImage).toEqual('');
    });
    it('it should pass if DesignHome.data.design.itemDetailsBgImage is match the result after DesignHome.addItemDetailsBackgroundImage function call', function () {
      ImageLibrary.showDialog.and.callFake(function () {
        var deferred = q.defer();
        deferred.resolve({
          "selectedFiles": ["https://imagelibserver.s3.amazonaws.com/25935164-2add-11e5-9d04-02f7ca55c361/950a50c0-400a-11e5-9af5-3f5e0d725ccb.jpg"],
          "selectedIcons": []
        });
        return deferred.promise;
      });
      DesignHome.addItemDetailsBackgroundImage();
      $rootScope.$digest();
      expect(DesignHome.data.design.itemDetailsBgImage).toEqual('https://imagelibserver.s3.amazonaws.com/25935164-2add-11e5-9d04-02f7ca55c361/950a50c0-400a-11e5-9af5-3f5e0d725ccb.jpg');
    });
  });

  describe('Function :DesignHome.removeItemDetailsBackgroundImage', function () {
    it('DesignHome.removeItemDetailsBackgroundImage should exist and be a function', function () {
      expect(typeof DesignHome.removeItemDetailsBackgroundImage).toEqual('function');
    });
    it('it should pass if DesignHome.data.design.itemDetailsBgImage is equals to null after function DesignHome.removeItemDetailsBackgroundImage call', function () {
      DesignHome.removeItemDetailsBackgroundImage();
      $rootScope.$digest();
      expect(DesignHome.data.design.itemDetailsBgImage).toEqual(null);
    });
  });

  describe('Function :DesignHome.addItemListBackgroundImage', function () {
    it('DesignHome.addItemListBackgroundImage should exist and be a function', function () {
      expect(typeof DesignHome.addItemListBackgroundImage).toEqual('function');
    });
    it('it should Fail after DesignHome.addItemListBackgroundImage function call', function () {
      ImageLibrary.showDialog.and.callFake(function () {
        var deferred = q.defer();
        deferred.reject({
          code: STATUS_CODE.UNDEFINED_OPTIONS,
          message: STATUS_MESSAGES.UNDEFINED_OPTIONS
        });
        return deferred.promise;
      });
      DesignHome.addItemListBackgroundImage();
      $rootScope.$digest();
      expect(DesignHome.data.design.itemListBgImage).toEqual('');
    });
    it('it should pass if DesignHome.data.design.itemDetailsBgImage is match the result after DesignHome.addItemListBackgroundImage function call', function () {
      ImageLibrary.showDialog.and.callFake(function () {
        var deferred = q.defer();
        deferred.resolve({
          "selectedFiles": ["https://imagelibserver.s3.amazonaws.com/25935164-2add-11e5-9d04-02f7ca55c361/950a50c0-400a-11e5-9af5-3f5e0d725ccb.jpg"],
          "selectedIcons": []
        });
        return deferred.promise;
      });
      DesignHome.addItemListBackgroundImage();
      $rootScope.$digest();
      expect(DesignHome.data.design.itemListBgImage).toEqual('https://imagelibserver.s3.amazonaws.com/25935164-2add-11e5-9d04-02f7ca55c361/950a50c0-400a-11e5-9af5-3f5e0d725ccb.jpg');
    });
  });

  describe('Function :DesignHome.removeItemListBackgroundImage', function () {
    it('DesignHome.removeItemListBackgroundImage should exist and be a function', function () {
      expect(typeof DesignHome.removeItemListBackgroundImage).toEqual('function');
    });
    it('it should pass if  DesignHome.data.design.itemListBgImage is equals to null after function DesignHome.removeItemListBackgroundImage call', function () {
      DesignHome.removeItemListBackgroundImage();
      $rootScope.$digest();
      expect(DesignHome.data.design.itemListBgImage).toEqual(null);
    })
  });

})
;


text:
<Record>
<Term>Amphetamine aspartate-amphetamine-dextroamphetamine saccharate-dextroamphetamine</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<SemanticType>Organic Chemical</SemanticType>
<PrimarySemanticType>Pharmacologic Substance</PrimarySemanticType>
<Synonym>Adderall 5</Synonym>
<Synonym>Adderall 15</Synonym>
<Synonym>Adderall 10</Synonym>
<Synonym>Dextroamp saccharate, amp aspartate, dextroamp sulfate and amp sulfate</Synonym>
<Synonym>Adderall xr 30</Synonym>
<Synonym>Adderall 20</Synonym>
<Synonym>Adderall 12.5</Synonym>
<Synonym>Dextroamp saccharate, amp aspartate, dextroamp sulfate and amp</Synonym>
<Synonym>Adderall xr 20</Synonym>
<Synonym>Adderall xr 15</Synonym>
<Synonym>Adderall 30</Synonym>
<Synonym>Adderall 7.5</Synonym>
<Synonym>Adderall xr 5</Synonym>
<Synonym>Adderall xr 10</Synonym>
<Synonym>Amphetamine aspartate;amphetamine sulfate;dextroamphetamine saccharate;dextroamphetamine sulfate</Synonym>
<Synonym>Adderall xr 25</Synonym>
<Source>FDA Registry</Source>
</Record>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Biblthca Lichenol. 52: 86 (1993)

#### Original name
Porina papuensis P.M. McCarthy

### Remarks
null


text:
<?php

namespace lithium\tests\mocks\action;

class MockControllerResponse extends \lithium\action\Response {

	public $hasRendered = false;

	public function render() {
		$this->hasRendered = true;
	}
}

?>


text:
using namespace std;
using namespace various;
using namespace webss;

static const char* ERROR_EXPECTED_HEX = "expected hexadecimal digit";

//adds a unicode char to the StringBuilder
//REQUIREMENT: num must be a valid unicode character
static void putUnicode(StringBuilder& str, unsigned int num)
{
	if (num < power2<7>::value)
	{
		str += (char)num;
		return;
	}

	//utf-8 is composed of the head and the tail
	//the head starts with a number of 1s, indicating the total length of the utf-8 char, followed by a 0 and then 5 to 1 bits
	//the tail is composed of chars always starting by two bits 1 and 0 and is composed after the head

	//the head
	//the shift at the left creates the numbers of bits telling the total length of the utf-8 char
	//there is a pattern in the number of bits the unicode number can take;
	//it is explicified with power2<x>::value, where x is the max number of bits and value is the max unicode value + 1
	//for values < power2<11>::value (2048), the utf-8 char is 2 bytes long, therefore the head must have 110x xxxx as bits
	//the remaining bits (in the case above, 5 bits) in the head must then be filled by taking the upper-most bits in the value.
	//To do that, the value is shifted by the number of bytes in the tail times 6 (the number of bits available in each byte
	//since the first two bits are occupied by 1 and 0, which signifies it is a tail byte).
	//In the case of values < power2<11>::value, the tail is 1 byte long (total == 2, - 1 for the head -> tail == 1), so it is shifted by 6
	int bitShift;
	if (num < power2<11>::value)
		str += (char)(0b11000000 | (num >> (bitShift = 6)));
	else if (num < power2<16>::value)
		str += (char)(0b11100000 | (num >> (bitShift = 12)));
	else if (num < power2<21>::value)
		str += (char)(0b11110000 | (num >> (bitShift = 18)));
	else if (num < power2<26>::value)
		str += (char)(0b11111000 | (num >> (bitShift = 24)));
	else //assumed max 31 bits
		str += (char)(0b11111100 | (num >> (bitShift = 30)));

	//the tail
	//if the bit shift was greater than 6, the other bytes are filled with decreasing bit shifts
	while ((bitShift -= 6) >= 0)
		str += (char)(0x80 | ((num >> bitShift) & 0x3F));
}

//reads a hex number with numDigits digits
static unsigned int readHex(SmartIterator& it, int numDigits)
{
	if (!it || !isDigitHex(*it))
		throw runtime_error(WEBSSON_EXCEPTION(ERROR_EXPECTED_HEX));

	int hex = hexToInt(*it);
	for (int i = 1; i < numDigits; ++i)
	{
		if (!(++it) || !isDigitHex(*it))
			throw runtime_error(WEBSSON_EXCEPTION(ERROR_EXPECTED_HEX));
		hex = hex * (int)NumberBase::HEX + hexToInt(*it);
	}
	++it;
	return hex;
}

void webss::putEscapedHex(SmartIterator& it, StringBuilder& str)
{
	if (*it == 'x')
		putUnicode(str, readHex(++it, 2));
	else if (*it == 'u')
		putUnicode(str, readHex(++it, 4));
	else
	{
		if (it.peekEnd() || !isDigitHex(it.peek()))
			throw runtime_error(WEBSSON_EXCEPTION(ERROR_EXPECTED_HEX));
		else if (it.peek() > '7')
			throw overflow_error(WEBSSON_EXCEPTION("escaped char value too high"));

		putUnicode(str, readHex(++it, 8));
	}
}


text:
extern "Java"
{
  namespace java
  {
    namespace applet
    {
        class AudioClip;
    }
  }
}

class java::applet::AudioClip : public ::java::lang::Object
{

public:
  virtual void play() = 0;
  virtual void stop() = 0;
  virtual void loop() = 0;
  static ::java::lang::Class class$;
} __attribute__ ((java_interface));

#endif // __java_applet_AudioClip__


text:
package us.terracraft.sqc.objects;

import java.awt.event.KeyEvent;

import KTech.components.*;
import KTech.core.*;
import KTech.core.*;
import KTech.graphics.Image;

public class Background extends GameObject {

	Image background;

	public Background(int x, int y, String path) {
		setName("Background");
		background = new Image(path);
	}

	@Override
	public void update(KTech kt, float time) {

	}

	@Override
	public void render(KTech kt, Renderer r) {
		r.drawImage(background, 0, 0);
	}

	@Override
	public void dispose() {

	}

	@Override
	public void componentEvent(String name, GameObject object) {

	}

}


text:
import datetime

from globefish.core import *
from models import *
from globefish.utilities import init_db

connection = init_db()

@route('/')
def index():
    title = "留言板"
    message_list = Message.select().order_by(-Message.created_at)
    return render_template('index.html', message_list=message_list, title=title)

@route("add", method='POST')
def add_message():
    try:
        message = Message()
        message.username = request.POST['username']
        message.email = request.POST['email']
        message.content = request.POST['content']
        message.created_at = datetime.datetime.now()
        message.save()
        return "OK"
    except BaseException as e:
        print(e)

run(host='localhost', port=6700, DEBUG=True)


text:
/*
 *
 * AssignmentPage constants
 *
 */

export const DEFAULT_ACTION = 'app/AssignmentPage/DEFAULT_ACTION';


text:
package org.apache.causeway.viewer.wicket.ui.util;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.request.resource.ResourceReference;

import org.apache.causeway.viewer.commons.prism.Prism;
import org.apache.causeway.viewer.commons.prism.PrismLanguage;

import de.agilecoders.wicket.webjars.request.resource.WebjarsCssResourceReference;
import de.agilecoders.wicket.webjars.request.resource.WebjarsJavaScriptResourceReference;
import lombok.experimental.UtilityClass;

@UtilityClass
public final class PrismResourcesWkt{

    /**
     * Returns the main Prism CSS resource for selected theme
     */
    public CssResourceReference cssResource(final Prism theme) {
        return new WebjarsCssResourceReference(theme.cssFile());
    }

    /**
     * Returns the main Prism JS resources for selected theme + most common languages
     */
    public List<ResourceReference> jsResources(final Prism theme) {
        final List<ResourceReference> resources = PrismLanguage.mostCommon().stream()
                .map(PrismLanguage::jsFile)
                .map(WebjarsJavaScriptResourceReference::new)
                .collect(Collectors.toCollection(ArrayList::new));

        resources.add(0, new WebjarsJavaScriptResourceReference(theme.jsFile()));
        return resources;
    }

}


text:
package org.apache.whirr.service.jclouds;

import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;

import java.util.List;

import org.jclouds.scriptbuilder.ScriptBuilder;
import org.jclouds.scriptbuilder.domain.OsFamily;
import org.jclouds.scriptbuilder.domain.Statement;

public class StatementBuilder implements Statement {
  protected List<Statement> statements = Lists.newArrayList();

  public void addStatement(Statement statement) {
    if (!statements.contains(statement)) {
      statements.add(statement);
    }
  }

  public void addStatements(Statement... statements) {
    for (Statement statement : statements) {
      addStatement(statement);
    }
  }

  @Override
  public Iterable<String> functionDependecies(OsFamily family) {
     List<String> functions = Lists.newArrayList();
     for (Statement statement : statements) {
        Iterables.addAll(functions, statement.functionDependecies(family));
     }
     return functions;
  }

  @Override
  public String render(OsFamily family) {
    ScriptBuilder scriptBuilder = new ScriptBuilder();
    for (Statement statement : statements) {
      scriptBuilder.addStatement(statement);
    }
    return scriptBuilder.render(family);
  }

}


text:
class Foordinate < Formula
  desc "Utility commands to arrange files"
  homepage "https://github.com/muniere/foordinate"
  url "https://github.com/muniere/foordinate/archive/v0.3.0.tar.gz"
  sha256 "eff6135016472fdf41c1b5429bef7d3a0d3a4906d7a0126d17807e5fb6a20e64"
  head "https://github.com/muniere/foordinate.git"

  depends_on "crystal-lang"

  def apps
    ["count", "numberize", "randomize"]
  end

  def install
    apps.each do |app|
      system "crystal", "build", "--verbose", "--release", "src/app/#{app}.cr"
    end

    bin.install apps
  end

  test do
    apps.each do |app|
      system app, "--help"
    end
  end
end


text:
"""TestCases for distributed transactions.
"""

import os
import time
import unittest

from test_all import db, test_support, have_threads, verbose, \
        get_new_environment_path, get_new_database_path

#----------------------------------------------------------------------

class DBReplication(unittest.TestCase) :
    def setUp(self) :
        self.homeDirMaster = get_new_environment_path()
        self.homeDirClient = get_new_environment_path()

        self.dbenvMaster = db.DBEnv()
        self.dbenvClient = db.DBEnv()

        # Must use "DB_THREAD" because the Replication Manager will
        # be executed in other threads but will use the same environment.
        # http://forums.oracle.com/forums/thread.jspa?threadID=645788&tstart=0
        self.dbenvMaster.open(self.homeDirMaster, db.DB_CREATE | db.DB_INIT_TXN
                | db.DB_INIT_LOG | db.DB_INIT_MPOOL | db.DB_INIT_LOCK |
                db.DB_INIT_REP | db.DB_RECOVER | db.DB_THREAD, 0666)
        self.dbenvClient.open(self.homeDirClient, db.DB_CREATE | db.DB_INIT_TXN
                | db.DB_INIT_LOG | db.DB_INIT_MPOOL | db.DB_INIT_LOCK |
                db.DB_INIT_REP | db.DB_RECOVER | db.DB_THREAD, 0666)

        self.confirmed_master=self.client_startupdone=False
        def confirmed_master(a,b,c) :
            if b==db.DB_EVENT_REP_MASTER :
                self.confirmed_master=True

        def client_startupdone(a,b,c) :
            if b==db.DB_EVENT_REP_STARTUPDONE :
                self.client_startupdone=True

        self.dbenvMaster.set_event_notify(confirmed_master)
        self.dbenvClient.set_event_notify(client_startupdone)

        #self.dbenvMaster.set_verbose(db.DB_VERB_REPLICATION, True)
        #self.dbenvMaster.set_verbose(db.DB_VERB_FILEOPS_ALL, True)
        #self.dbenvClient.set_verbose(db.DB_VERB_REPLICATION, True)
        #self.dbenvClient.set_verbose(db.DB_VERB_FILEOPS_ALL, True)

        self.dbMaster = self.dbClient = None

    def tearDown(self):
        if self.dbClient :
            self.dbClient.close()
        if self.dbMaster :
            self.dbMaster.close()

        # Here we assign dummy event handlers to allow GC of the test object.
        # Since the dummy handler doesn't use any outer scope variable, it
        # doesn't keep any reference to the test object.
        def dummy(*args) :
            pass
        self.dbenvMaster.set_event_notify(dummy)
        self.dbenvClient.set_event_notify(dummy)

        self.dbenvClient.close()
        self.dbenvMaster.close()
        test_support.rmtree(self.homeDirClient)
        test_support.rmtree(self.homeDirMaster)

class DBReplicationManager(DBReplication) :
    def test01_basic_replication(self) :
        master_port = test_support.find_unused_port()
        client_port = test_support.find_unused_port()
        if db.version() >= (5, 2) :
            self.site = self.dbenvMaster.repmgr_site("127.0.0.1", master_port)
            self.site.set_config(db.DB_GROUP_CREATOR, True)
            self.site.set_config(db.DB_LOCAL_SITE, True)
            self.site2 = self.dbenvMaster.repmgr_site("127.0.0.1", client_port)

            self.site3 = self.dbenvClient.repmgr_site("127.0.0.1", master_port)
            self.site3.set_config(db.DB_BOOTSTRAP_HELPER, True)
            self.site4 = self.dbenvClient.repmgr_site("127.0.0.1", client_port)
            self.site4.set_config(db.DB_LOCAL_SITE, True)

            d = {
                    db.DB_BOOTSTRAP_HELPER: [False, False, True, False],
                    db.DB_GROUP_CREATOR: [True, False, False, False],
                    db.DB_LEGACY: [False, False, False, False],
                    db.DB_LOCAL_SITE: [True, False, False, True],
                    db.DB_REPMGR_PEER: [False, False, False, False ],
                }

            for i, j in d.items() :
                for k, v in \
                        zip([self.site, self.site2, self.site3, self.site4], j) :
                    if v :
                        self.assertTrue(k.get_config(i))
                    else :
                        self.assertFalse(k.get_config(i))

            self.assertNotEqual(self.site.get_eid(), self.site2.get_eid())
            self.assertNotEqual(self.site3.get_eid(), self.site4.get_eid())

            for i, j in zip([self.site, self.site2, self.site3, self.site4], \
                    [master_port, client_port, master_port, client_port]) :
                addr = i.get_address()
                self.assertEqual(addr, ("127.0.0.1", j))

            for i in [self.site, self.site2] :
                self.assertEqual(i.get_address(),
                        self.dbenvMaster.repmgr_site_by_eid(i.get_eid()).get_address())
            for i in [self.site3, self.site4] :
                self.assertEqual(i.get_address(),
                        self.dbenvClient.repmgr_site_by_eid(i.get_eid()).get_address())
        else :
            self.dbenvMaster.repmgr_set_local_site("127.0.0.1", master_port)
            self.dbenvClient.repmgr_set_local_site("127.0.0.1", client_port)
            self.dbenvMaster.repmgr_add_remote_site("127.0.0.1", client_port)
            self.dbenvClient.repmgr_add_remote_site("127.0.0.1", master_port)

            self.dbenvMaster.rep_set_nsites(2)
            self.dbenvClient.rep_set_nsites(2)

        self.dbenvMaster.rep_set_priority(10)
        self.dbenvClient.rep_set_priority(0)

        self.dbenvMaster.rep_set_timeout(db.DB_REP_CONNECTION_RETRY,100123)
        self.dbenvClient.rep_set_timeout(db.DB_REP_CONNECTION_RETRY,100321)
        self.assertEqual(self.dbenvMaster.rep_get_timeout(
            db.DB_REP_CONNECTION_RETRY), 100123)
        self.assertEqual(self.dbenvClient.rep_get_timeout(
            db.DB_REP_CONNECTION_RETRY), 100321)

        self.dbenvMaster.rep_set_timeout(db.DB_REP_ELECTION_TIMEOUT, 100234)
        self.dbenvClient.rep_set_timeout(db.DB_REP_ELECTION_TIMEOUT, 100432)
        self.assertEqual(self.dbenvMaster.rep_get_timeout(
            db.DB_REP_ELECTION_TIMEOUT), 100234)
        self.assertEqual(self.dbenvClient.rep_get_timeout(
            db.DB_REP_ELECTION_TIMEOUT), 100432)

        self.dbenvMaster.rep_set_timeout(db.DB_REP_ELECTION_RETRY, 100345)
        self.dbenvClient.rep_set_timeout(db.DB_REP_ELECTION_RETRY, 100543)
        self.assertEqual(self.dbenvMaster.rep_get_timeout(
            db.DB_REP_ELECTION_RETRY), 100345)
        self.assertEqual(self.dbenvClient.rep_get_timeout(
            db.DB_REP_ELECTION_RETRY), 100543)

        self.dbenvMaster.repmgr_set_ack_policy(db.DB_REPMGR_ACKS_ALL)
        self.dbenvClient.repmgr_set_ack_policy(db.DB_REPMGR_ACKS_ALL)

        self.dbenvMaster.repmgr_start(1, db.DB_REP_MASTER);
        self.dbenvClient.repmgr_start(1, db.DB_REP_CLIENT);

        self.assertEqual(self.dbenvMaster.rep_get_nsites(),2)
        self.assertEqual(self.dbenvClient.rep_get_nsites(),2)
        self.assertEqual(self.dbenvMaster.rep_get_priority(),10)
        self.assertEqual(self.dbenvClient.rep_get_priority(),0)
        self.assertEqual(self.dbenvMaster.repmgr_get_ack_policy(),
                db.DB_REPMGR_ACKS_ALL)
        self.assertEqual(self.dbenvClient.repmgr_get_ack_policy(),
                db.DB_REPMGR_ACKS_ALL)

        # The timeout is necessary in BDB 4.5, since DB_EVENT_REP_STARTUPDONE
        # is not generated if the master has no new transactions.
        # This is solved in BDB 4.6 (#15542).
        import time
        timeout = time.time()+60
        while (time.time()<timeout) and not (self.confirmed_master and self.client_startupdone) :
            time.sleep(0.02)
        # self.client_startupdone does not always get set to True within
        # the timeout.  On windows this may be a deep issue, on other
        # platforms it is likely just a timing issue, especially on slow
        # virthost buildbots (see issue 3892 for more).  Even though
        # the timeout triggers, the rest of this test method usually passes
        # (but not all of it always, see below).  So we just note the
        # timeout on stderr and keep soldering on.
        if time.time()>timeout:
            import sys
            print >> sys.stderr, ("XXX: timeout happened before"
                "startup was confirmed - see issue 3892")
            startup_timeout = True

        d = self.dbenvMaster.repmgr_site_list()
        self.assertEqual(len(d), 1)
        d = d.values()[0]  # There is only one
        self.assertEqual(d[0], "127.0.0.1")
        self.assertEqual(d[1], client_port)
        self.assertTrue((d[2]==db.DB_REPMGR_CONNECTED) or \
                (d[2]==db.DB_REPMGR_DISCONNECTED))

        d = self.dbenvClient.repmgr_site_list()
        self.assertEqual(len(d), 1)
        d = d.values()[0]  # There is only one
        self.assertEqual(d[0], "127.0.0.1")
        self.assertEqual(d[1], master_port)
        self.assertTrue((d[2]==db.DB_REPMGR_CONNECTED) or \
                (d[2]==db.DB_REPMGR_DISCONNECTED))

        if db.version() >= (4,6) :
            d = self.dbenvMaster.repmgr_stat(flags=db.DB_STAT_CLEAR);
            self.assertTrue("msgs_queued" in d)

        self.dbMaster=db.DB(self.dbenvMaster)
        txn=self.dbenvMaster.txn_begin()
        self.dbMaster.open("test", db.DB_HASH, db.DB_CREATE, 0666, txn=txn)
        txn.commit()

        import time,os.path
        timeout=time.time()+10
        while (time.time()<timeout) and \
          not (os.path.exists(os.path.join(self.homeDirClient,"test"))) :
            time.sleep(0.01)

        self.dbClient=db.DB(self.dbenvClient)
        while True :
            txn=self.dbenvClient.txn_begin()
            try :
                self.dbClient.open("test", db.DB_HASH, flags=db.DB_RDONLY,
                        mode=0666, txn=txn)
            except db.DBRepHandleDeadError :
                txn.abort()
                self.dbClient.close()
                self.dbClient=db.DB(self.dbenvClient)
                continue

            txn.commit()
            break

        txn=self.dbenvMaster.txn_begin()
        self.dbMaster.put("ABC", "123", txn=txn)
        txn.commit()
        import time
        timeout=time.time()+10
        v=None
        while (time.time()<timeout) and (v is None) :
            txn=self.dbenvClient.txn_begin()
            v=self.dbClient.get("ABC", txn=txn)
            txn.commit()
            if v is None :
                time.sleep(0.02)
        # If startup did not happen before the timeout above, then this test
        # sometimes fails.  This happens randomly, which causes buildbot
        # instability, but all the other bsddb tests pass.  Since bsddb3 in the
        # stdlib is currently not getting active maintenance, and is gone in
        # py3k, we just skip the end of the test in that case.
        if time.time()>=timeout and startup_timeout:
            self.skipTest("replication test skipped due to random failure, "
                "see issue 3892")
        self.assertTrue(time.time()<timeout)
        self.assertEqual("123", v)

        txn=self.dbenvMaster.txn_begin()
        self.dbMaster.delete("ABC", txn=txn)
        txn.commit()
        timeout=time.time()+10
        while (time.time()<timeout) and (v is not None) :
            txn=self.dbenvClient.txn_begin()
            v=self.dbClient.get("ABC", txn=txn)
            txn.commit()
            if v is None :
                time.sleep(0.02)
        self.assertTrue(time.time()<timeout)
        self.assertEqual(None, v)

class DBBaseReplication(DBReplication) :
    def setUp(self) :
        DBReplication.setUp(self)
        def confirmed_master(a,b,c) :
            if (b == db.DB_EVENT_REP_MASTER) or (b == db.DB_EVENT_REP_ELECTED) :
                self.confirmed_master = True

        def client_startupdone(a,b,c) :
            if b == db.DB_EVENT_REP_STARTUPDONE :
                self.client_startupdone = True

        self.dbenvMaster.set_event_notify(confirmed_master)
        self.dbenvClient.set_event_notify(client_startupdone)

        import Queue
        self.m2c = Queue.Queue()
        self.c2m = Queue.Queue()

        # There are only two nodes, so we don't need to
        # do any routing decision
        def m2c(dbenv, control, rec, lsnp, envid, flags) :
            self.m2c.put((control, rec))

        def c2m(dbenv, control, rec, lsnp, envid, flags) :
            self.c2m.put((control, rec))

        self.dbenvMaster.rep_set_transport(13,m2c)
        self.dbenvMaster.rep_set_priority(10)
        self.dbenvClient.rep_set_transport(3,c2m)
        self.dbenvClient.rep_set_priority(0)

        self.assertEqual(self.dbenvMaster.rep_get_priority(),10)
        self.assertEqual(self.dbenvClient.rep_get_priority(),0)

        #self.dbenvMaster.set_verbose(db.DB_VERB_REPLICATION, True)
        #self.dbenvMaster.set_verbose(db.DB_VERB_FILEOPS_ALL, True)
        #self.dbenvClient.set_verbose(db.DB_VERB_REPLICATION, True)
        #self.dbenvClient.set_verbose(db.DB_VERB_FILEOPS_ALL, True)

        def thread_master() :
            return self.thread_do(self.dbenvMaster, self.c2m, 3,
                    self.master_doing_election, True)

        def thread_client() :
            return self.thread_do(self.dbenvClient, self.m2c, 13,
                    self.client_doing_election, False)

        from threading import Thread
        t_m=Thread(target=thread_master)
        t_c=Thread(target=thread_client)
        import sys
        if sys.version_info[0] < 3 :
            t_m.setDaemon(True)
            t_c.setDaemon(True)
        else :
            t_m.daemon = True
            t_c.daemon = True

        self.t_m = t_m
        self.t_c = t_c

        self.dbMaster = self.dbClient = None

        self.master_doing_election=[False]
        self.client_doing_election=[False]

    def tearDown(self):
        if self.dbClient :
            self.dbClient.close()
        if self.dbMaster :
            self.dbMaster.close()
        self.m2c.put(None)
        self.c2m.put(None)
        self.t_m.join()
        self.t_c.join()

        # Here we assign dummy event handlers to allow GC of the test object.
        # Since the dummy handler doesn't use any outer scope variable, it
        # doesn't keep any reference to the test object.
        def dummy(*args) :
            pass
        self.dbenvMaster.set_event_notify(dummy)
        self.dbenvClient.set_event_notify(dummy)
        self.dbenvMaster.rep_set_transport(13,dummy)
        self.dbenvClient.rep_set_transport(3,dummy)

        self.dbenvClient.close()
        self.dbenvMaster.close()
        test_support.rmtree(self.homeDirClient)
        test_support.rmtree(self.homeDirMaster)

    def basic_rep_threading(self) :
        self.dbenvMaster.rep_start(flags=db.DB_REP_MASTER)
        self.dbenvClient.rep_start(flags=db.DB_REP_CLIENT)

        def thread_do(env, q, envid, election_status, must_be_master) :
            while True :
                v=q.get()
                if v is None : return
                env.rep_process_message(v[0], v[1], envid)

        self.thread_do = thread_do

        self.t_m.start()
        self.t_c.start()

    def test01_basic_replication(self) :
        self.basic_rep_threading()

        # The timeout is necessary in BDB 4.5, since DB_EVENT_REP_STARTUPDONE
        # is not generated if the master has no new transactions.
        # This is solved in BDB 4.6 (#15542).
        import time
        timeout = time.time()+60
        while (time.time()<timeout) and not (self.confirmed_master and
                self.client_startupdone) :
            time.sleep(0.02)
        self.assertTrue(time.time()<timeout)

        self.dbMaster=db.DB(self.dbenvMaster)
        txn=self.dbenvMaster.txn_begin()
        self.dbMaster.open("test", db.DB_HASH, db.DB_CREATE, 0666, txn=txn)
        txn.commit()

        import time,os.path
        timeout=time.time()+10
        while (time.time()<timeout) and \
          not (os.path.exists(os.path.join(self.homeDirClient,"test"))) :
            time.sleep(0.01)

        self.dbClient=db.DB(self.dbenvClient)
        while True :
            txn=self.dbenvClient.txn_begin()
            try :
                self.dbClient.open("test", db.DB_HASH, flags=db.DB_RDONLY,
                        mode=0666, txn=txn)
            except db.DBRepHandleDeadError :
                txn.abort()
                self.dbClient.close()
                self.dbClient=db.DB(self.dbenvClient)
                continue

            txn.commit()
            break

        d = self.dbenvMaster.rep_stat(flags=db.DB_STAT_CLEAR);
        self.assertTrue("master_changes" in d)

        txn=self.dbenvMaster.txn_begin()
        self.dbMaster.put("ABC", "123", txn=txn)
        txn.commit()
        import time
        timeout=time.time()+10
        v=None
        while (time.time()<timeout) and (v is None) :
            txn=self.dbenvClient.txn_begin()
            v=self.dbClient.get("ABC", txn=txn)
            txn.commit()
            if v is None :
                time.sleep(0.02)
        self.assertTrue(time.time()<timeout)
        self.assertEqual("123", v)

        txn=self.dbenvMaster.txn_begin()
        self.dbMaster.delete("ABC", txn=txn)
        txn.commit()
        timeout=time.time()+10
        while (time.time()<timeout) and (v is not None) :
            txn=self.dbenvClient.txn_begin()
            v=self.dbClient.get("ABC", txn=txn)
            txn.commit()
            if v is None :
                time.sleep(0.02)
        self.assertTrue(time.time()<timeout)
        self.assertEqual(None, v)

    if db.version() >= (4,7) :
        def test02_test_request(self) :
            self.basic_rep_threading()
            (minimum, maximum) = self.dbenvClient.rep_get_request()
            self.dbenvClient.rep_set_request(minimum-1, maximum+1)
            self.assertEqual(self.dbenvClient.rep_get_request(),
                    (minimum-1, maximum+1))

    if db.version() >= (4,6) :
        def test03_master_election(self) :
            # Get ready to hold an election
            #self.dbenvMaster.rep_start(flags=db.DB_REP_MASTER)
            self.dbenvMaster.rep_start(flags=db.DB_REP_CLIENT)
            self.dbenvClient.rep_start(flags=db.DB_REP_CLIENT)

            def thread_do(env, q, envid, election_status, must_be_master) :
                while True :
                    v=q.get()
                    if v is None : return
                    r = env.rep_process_message(v[0],v[1],envid)
                    if must_be_master and self.confirmed_master :
                        self.dbenvMaster.rep_start(flags = db.DB_REP_MASTER)
                        must_be_master = False

                    if r[0] == db.DB_REP_HOLDELECTION :
                        def elect() :
                            while True :
                                try :
                                    env.rep_elect(2, 1)
                                    election_status[0] = False
                                    break
                                except db.DBRepUnavailError :
                                    pass
                        if not election_status[0] and not self.confirmed_master :
                            from threading import Thread
                            election_status[0] = True
                            t=Thread(target=elect)
                            import sys
                            if sys.version_info[0] < 3 :
                                t.setDaemon(True)
                            else :
                                t.daemon = True
                            t.start()

            self.thread_do = thread_do

            self.t_m.start()
            self.t_c.start()

            self.dbenvMaster.rep_set_timeout(db.DB_REP_ELECTION_TIMEOUT, 50000)
            self.dbenvClient.rep_set_timeout(db.DB_REP_ELECTION_TIMEOUT, 50000)
            self.client_doing_election[0] = True
            while True :
                try :
                    self.dbenvClient.rep_elect(2, 1)
                    self.client_doing_election[0] = False
                    break
                except db.DBRepUnavailError :
                    pass

            self.assertTrue(self.confirmed_master)

            # Race condition showed up after upgrading to Solaris 10 Update 10
            # https://forums.oracle.com/forums/thread.jspa?messageID=9902860
            # jcea@jcea.es: See private email from Paula Bingham (Oracle),
            # in 20110929.
            while not (self.dbenvClient.rep_stat()["startup_complete"]) :
                pass

    if db.version() >= (4,7) :
        def test04_test_clockskew(self) :
            fast, slow = 1234, 1230
            self.dbenvMaster.rep_set_clockskew(fast, slow)
            self.assertEqual((fast, slow),
                    self.dbenvMaster.rep_get_clockskew())
            self.basic_rep_threading()

#----------------------------------------------------------------------

def test_suite():
    suite = unittest.TestSuite()
    if db.version() >= (4, 6) :
        dbenv = db.DBEnv()
        try :
            dbenv.repmgr_get_ack_policy()
            ReplicationManager_available=True
        except :
            ReplicationManager_available=False
        dbenv.close()
        del dbenv
        if ReplicationManager_available :
            suite.addTest(unittest.makeSuite(DBReplicationManager))

        if have_threads :
            suite.addTest(unittest.makeSuite(DBBaseReplication))

    return suite

if __name__ == '__main__':
    unittest.main(defaultTest='test_suite')


text:
<?php
namespace Quazardous\PriceministerWs\Request;

/**
 * @link https://developer.fr.shopping.rakuten.com/blog/fr/documentation/new-sales/accept-or-refuse-sales/
 *
 */
class AcceptSaleRequest extends AbstractSalesRequest {
    protected $parameters = [
        'action' => 'acceptsale',
        'version' => '2010-09-20',
    ];
}