//    Copyright 2019 Google Inc.
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        https://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

syntax = "proto3";

package google.fhir.r4.core;

import "google/protobuf/any.proto";
import "google/fhir/core/proto/annotations.proto";
import "google/fhir/r4/proto/core/datatypes.proto";

option java_multiple_files = true;
option java_package = "com.google.fhir.r4.core";
option (.google.fhir.proto.fhir_version) = R4;
option go_package = "github.com/google/fhir/go/google/fhir/r4/proto/core/resources/parameters_go_proto";

// Auto-generated from StructureDefinition for Parameters.
// Operation Request or Response.
// See http://hl7.org/fhir/StructureDefinition/Parameters
message Parameters {
  option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE;
  option (.google.fhir.proto.fhir_structure_definition_url) =
      "http://hl7.org/fhir/StructureDefinition/Parameters";

  // Logical id of this artifact
  Id id = 1;

  // Metadata about the resource
  Meta meta = 2;

  // A set of rules under which this content was created
  Uri implicit_rules = 3;

  // Language of the resource content
  Code language = 4;

  // Operation Parameter
  message Parameter {
    option (.google.fhir.proto.fhir_path_message_constraint) =
        "(part.exists() and value.empty() and resource.empty()) or (part.empty() and (value.exists() xor resource.exists()))";

    // Unique id for inter-element referencing
    String id = 1;

    // Additional content defined by implementations
    repeated Extension extension = 2;

    // Extensions that cannot be ignored even if unrecognized
    repeated Extension modifier_extension = 3;

    // Name from the definition
    String name = 4
        [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR];

    // If parameter is a data type
    message ValueX {
      option (.google.fhir.proto.is_choice_type) = true;

      oneof choice {
        Base64Binary base64_binary = 1;
        Boolean boolean = 2;
        Canonical canonical = 3;
        Code code = 4;
        Date date = 5;
        DateTime date_time = 6;
        Decimal decimal = 7;
        Id id = 8;
        Instant instant = 9;
        Integer integer = 10;
        Markdown markdown = 11;
        Oid oid = 12;
        PositiveInt positive_int = 13;
        String string_value = 14 [json_name = "string"];
        Time time = 15;
        UnsignedInt unsigned_int = 16;
        Uri uri = 17;
        Url url = 18;
        Uuid uuid = 19;
        Address address = 20;
        Age age = 21;
        Annotation annotation = 22;
        Attachment attachment = 23;
        CodeableConcept codeable_concept = 24;
        Coding coding = 25;
        ContactPoint contact_point = 26;
        Count count = 27;
        Distance distance = 28;
        Duration duration = 29;
        HumanName human_name = 30;
        Identifier identifier = 31;
        Money money = 32;
        Period period = 33;
        Quantity quantity = 34;
        Range range = 35;
        Ratio ratio = 36;
        Reference reference = 37;
        SampledData sampled_data = 38;
        Signature signature = 39;
        Timing timing = 40;
        ContactDetail contact_detail = 41;
        Contributor contributor = 42;
        DataRequirement data_requirement = 43;
        Expression expression = 44;
        ParameterDefinition parameter_definition = 45;
        RelatedArtifact related_artifact = 46;
        TriggerDefinition trigger_definition = 47;
        UsageContext usage_context = 48;
        Dosage dosage = 49;
        Meta meta = 50;
      }
    }
    ValueX value = 5;

    // If parameter is a whole resource
    protobuf.Any resource = 6;

    // Named part of a multi-part parameter
    repeated Parameter part = 7;
  }
  repeated Parameter parameter = 5;
}
