public static API.ReferencedFieldConditions ToAPI(ReferencedFieldConditions sdkReferencedFieldConditions)
        {
            if (sdkReferencedFieldConditions == null)
            {
                return(null);
            }

            List <API.FieldCondition> apiFieldConditionsInCondition = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInCondition)
            {
                FieldConditionConverter fieldConditionConverter = new FieldConditionConverter(sdkFieldCondition);
                apiFieldConditionsInCondition.Add(fieldConditionConverter.ToAPIFieldCondition());
            }

            List <API.FieldCondition> apiFieldConditionsInAction = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInAction)
            {
                FieldConditionConverter fieldConditionConverter = new FieldConditionConverter(sdkFieldCondition);
                apiFieldConditionsInAction.Add(fieldConditionConverter.ToAPIFieldCondition());
            }

            API.ReferencedFieldConditions apiReferencedFieldConditions = new API.ReferencedFieldConditions();
            apiReferencedFieldConditions.ReferencedInCondition = apiFieldConditionsInCondition;
            apiReferencedFieldConditions.ReferencedInAction    = apiFieldConditionsInAction;
            return(apiReferencedFieldConditions);
        }
        public static API.ReferencedField ToAPI(ReferencedField sdkReferencedField)
        {
            if (sdkReferencedField == null)
            {
                return(null);
            }

            ReferencedFieldConditions sdkReferencedFieldConditions = sdkReferencedField.Conditions;
            List <API.FieldCondition> apiReferencedInCondition     = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInCondition)
            {
                FieldConditionConverter converter = new FieldConditionConverter(sdkFieldCondition);
                apiReferencedInCondition.Add(converter.ToAPIFieldCondition());
            }

            List <API.FieldCondition> apiReferencedInAction = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInAction)
            {
                FieldConditionConverter converter = new FieldConditionConverter(sdkFieldCondition);
                apiReferencedInAction.Add(converter.ToAPIFieldCondition());
            }

            API.ReferencedFieldConditions apiReferencedFieldConditions = new API.ReferencedFieldConditions();
            apiReferencedFieldConditions.ReferencedInCondition = apiReferencedInCondition;
            apiReferencedFieldConditions.ReferencedInAction    = apiReferencedInAction;

            API.ReferencedField apiReferencedField = new API.ReferencedField();
            apiReferencedField.FieldId    = sdkReferencedField.FieldId;
            apiReferencedField.Conditions = apiReferencedFieldConditions;
            return(apiReferencedField);
        }