Trendsic Platform Service

<back to all web services

CoveragePolicySaveRequest

Requires Authentication
The following routes are available for this service:
POST/v1/coverage/policies/{CoveragePolicyId}
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    public static class CoveragePolicySaveRequest
    {
        public Integer CoveragePolicyId = null;
        public CoveragePolicyDoc Doc = null;
        public String ChangeNote = null;
        
        public Integer getCoveragePolicyId() { return CoveragePolicyId; }
        public CoveragePolicySaveRequest setCoveragePolicyId(Integer value) { this.CoveragePolicyId = value; return this; }
        public CoveragePolicyDoc getDoc() { return Doc; }
        public CoveragePolicySaveRequest setDoc(CoveragePolicyDoc value) { this.Doc = value; return this; }
        public String getChangeNote() { return ChangeNote; }
        public CoveragePolicySaveRequest setChangeNote(String value) { this.ChangeNote = value; return this; }
    }

    public static class CoveragePolicyDoc
    {
        public String Intro = null;
        public String LockLine = null;
        public String TemplateName = null;
        public CoveragePolicyPrefs Prefs = null;
        public ArrayList<CoverageRuleDef> Rules = new ArrayList<CoverageRuleDef>();
        
        public String getIntro() { return Intro; }
        public CoveragePolicyDoc setIntro(String value) { this.Intro = value; return this; }
        public String getLockLine() { return LockLine; }
        public CoveragePolicyDoc setLockLine(String value) { this.LockLine = value; return this; }
        public String getTemplateName() { return TemplateName; }
        public CoveragePolicyDoc setTemplateName(String value) { this.TemplateName = value; return this; }
        public CoveragePolicyPrefs getPrefs() { return Prefs; }
        public CoveragePolicyDoc setPrefs(CoveragePolicyPrefs value) { this.Prefs = value; return this; }
        public ArrayList<CoverageRuleDef> getRules() { return Rules; }
        public CoveragePolicyDoc setRules(ArrayList<CoverageRuleDef> value) { this.Rules = value; return this; }
    }

    public static class CoveragePolicyPrefs
    {
        public String AssignmentMode = null;
        public Integer RestHours = null;
        public Integer OtThresholdHours = null;
        public Integer RingWaitMinutes = null;
        public String QuietStart = null;
        public String QuietEnd = null;
        public Boolean RescheduleAllowed = null;
        public String QuietMode = null;
        public ArrayList<CoverageRingDef> Rings = new ArrayList<CoverageRingDef>();
        
        public String getAssignmentMode() { return AssignmentMode; }
        public CoveragePolicyPrefs setAssignmentMode(String value) { this.AssignmentMode = value; return this; }
        public Integer getRestHours() { return RestHours; }
        public CoveragePolicyPrefs setRestHours(Integer value) { this.RestHours = value; return this; }
        public Integer getOtThresholdHours() { return OtThresholdHours; }
        public CoveragePolicyPrefs setOtThresholdHours(Integer value) { this.OtThresholdHours = value; return this; }
        public Integer getRingWaitMinutes() { return RingWaitMinutes; }
        public CoveragePolicyPrefs setRingWaitMinutes(Integer value) { this.RingWaitMinutes = value; return this; }
        public String getQuietStart() { return QuietStart; }
        public CoveragePolicyPrefs setQuietStart(String value) { this.QuietStart = value; return this; }
        public String getQuietEnd() { return QuietEnd; }
        public CoveragePolicyPrefs setQuietEnd(String value) { this.QuietEnd = value; return this; }
        public Boolean isRescheduleAllowed() { return RescheduleAllowed; }
        public CoveragePolicyPrefs setRescheduleAllowed(Boolean value) { this.RescheduleAllowed = value; return this; }
        public String getQuietMode() { return QuietMode; }
        public CoveragePolicyPrefs setQuietMode(String value) { this.QuietMode = value; return this; }
        public ArrayList<CoverageRingDef> getRings() { return Rings; }
        public CoveragePolicyPrefs setRings(ArrayList<CoverageRingDef> value) { this.Rings = value; return this; }
    }

    public static class CoverageRingDef
    {
        public String Key = null;
        public String Label = null;
        public String Sub = null;
        public Integer WaitMinutes = null;
        public Boolean Enabled = null;
        
        public String getKey() { return Key; }
        public CoverageRingDef setKey(String value) { this.Key = value; return this; }
        public String getLabel() { return Label; }
        public CoverageRingDef setLabel(String value) { this.Label = value; return this; }
        public String getSub() { return Sub; }
        public CoverageRingDef setSub(String value) { this.Sub = value; return this; }
        public Integer getWaitMinutes() { return WaitMinutes; }
        public CoverageRingDef setWaitMinutes(Integer value) { this.WaitMinutes = value; return this; }
        public Boolean isEnabled() { return Enabled; }
        public CoverageRingDef setEnabled(Boolean value) { this.Enabled = value; return this; }
    }

    public static class CoverageRuleDef
    {
        public String RuleId = null;
        public String Name = null;
        public String Kind = null;
        public String Demand = null;
        public String SourcePolicyName = null;
        public String CascadeLevel = null;
        public String Why = null;
        public String Change = null;
        public String OverrideWho = null;
        public String OverrideConsequence = null;
        public String NoNote = null;
        public HashMap<String,String> Params = new HashMap<String,String>();
        public ArrayList<CoverageRuleDocSection> Doc = new ArrayList<CoverageRuleDocSection>();
        public CoverageRuleTune Tune = null;
        
        public String getRuleId() { return RuleId; }
        public CoverageRuleDef setRuleId(String value) { this.RuleId = value; return this; }
        public String getName() { return Name; }
        public CoverageRuleDef setName(String value) { this.Name = value; return this; }
        public String getKind() { return Kind; }
        public CoverageRuleDef setKind(String value) { this.Kind = value; return this; }
        public String getDemand() { return Demand; }
        public CoverageRuleDef setDemand(String value) { this.Demand = value; return this; }
        public String getSourcePolicyName() { return SourcePolicyName; }
        public CoverageRuleDef setSourcePolicyName(String value) { this.SourcePolicyName = value; return this; }
        public String getCascadeLevel() { return CascadeLevel; }
        public CoverageRuleDef setCascadeLevel(String value) { this.CascadeLevel = value; return this; }
        public String getWhy() { return Why; }
        public CoverageRuleDef setWhy(String value) { this.Why = value; return this; }
        public String getChange() { return Change; }
        public CoverageRuleDef setChange(String value) { this.Change = value; return this; }
        public String getOverrideWho() { return OverrideWho; }
        public CoverageRuleDef setOverrideWho(String value) { this.OverrideWho = value; return this; }
        public String getOverrideConsequence() { return OverrideConsequence; }
        public CoverageRuleDef setOverrideConsequence(String value) { this.OverrideConsequence = value; return this; }
        public String getNoNote() { return NoNote; }
        public CoverageRuleDef setNoNote(String value) { this.NoNote = value; return this; }
        public HashMap<String,String> getParams() { return Params; }
        public CoverageRuleDef setParams(HashMap<String,String> value) { this.Params = value; return this; }
        public ArrayList<CoverageRuleDocSection> getDoc() { return Doc; }
        public CoverageRuleDef setDoc(ArrayList<CoverageRuleDocSection> value) { this.Doc = value; return this; }
        public CoverageRuleTune getTune() { return Tune; }
        public CoverageRuleDef setTune(CoverageRuleTune value) { this.Tune = value; return this; }
    }

    public static class CoverageRuleDocSection
    {
        public String H = null;
        public String T = null;
        
        public String getH() { return H; }
        public CoverageRuleDocSection setH(String value) { this.H = value; return this; }
        public String getT() { return T; }
        public CoverageRuleDocSection setT(String value) { this.T = value; return this; }
    }

    public static class CoverageRuleTune
    {
        public String Intro = null;
        public ArrayList<CoverageRuleTuneOption> Options = new ArrayList<CoverageRuleTuneOption>();
        
        public String getIntro() { return Intro; }
        public CoverageRuleTune setIntro(String value) { this.Intro = value; return this; }
        public ArrayList<CoverageRuleTuneOption> getOptions() { return Options; }
        public CoverageRuleTune setOptions(ArrayList<CoverageRuleTuneOption> value) { this.Options = value; return this; }
    }

    public static class CoverageRuleTuneOption
    {
        public String Label = null;
        public String Sub = null;
        
        public String getLabel() { return Label; }
        public CoverageRuleTuneOption setLabel(String value) { this.Label = value; return this; }
        public String getSub() { return Sub; }
        public CoverageRuleTuneOption setSub(String value) { this.Sub = value; return this; }
    }

    public static class CoverageCascadeResponse
    {
        public CoveragePolicy Policy = null;
        public CoveragePolicyDoc Doc = null;
        public Integer VersionNumber = null;
        public ArrayList<CoveragePolicyVersionInfo> Versions = new ArrayList<CoveragePolicyVersionInfo>();
        public ResponseStatus ResponseStatus = null;
        
        public CoveragePolicy getPolicy() { return Policy; }
        public CoverageCascadeResponse setPolicy(CoveragePolicy value) { this.Policy = value; return this; }
        public CoveragePolicyDoc getDoc() { return Doc; }
        public CoverageCascadeResponse setDoc(CoveragePolicyDoc value) { this.Doc = value; return this; }
        public Integer getVersionNumber() { return VersionNumber; }
        public CoverageCascadeResponse setVersionNumber(Integer value) { this.VersionNumber = value; return this; }
        public ArrayList<CoveragePolicyVersionInfo> getVersions() { return Versions; }
        public CoverageCascadeResponse setVersions(ArrayList<CoveragePolicyVersionInfo> value) { this.Versions = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public CoverageCascadeResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
    }

    public static class CoveragePolicy
    {
        public Integer CoveragePolicyId = null;
        public UUID CoveragePolicyUID = null;
        public String Name = null;
        public String ScopeLevel = null;
        public UUID BranchId = null;
        public String BranchName = null;
        public String WorkTypeKey = null;
        public Integer JobID = null;
        public String JobName = null;
        public Integer CurrentVersion = null;
        public Boolean IsActive = null;
        public Date CreatedAt = null;
        public Date UpdatedAt = null;
        
        public Integer getCoveragePolicyId() { return CoveragePolicyId; }
        public CoveragePolicy setCoveragePolicyId(Integer value) { this.CoveragePolicyId = value; return this; }
        public UUID getCoveragePolicyUID() { return CoveragePolicyUID; }
        public CoveragePolicy setCoveragePolicyUID(UUID value) { this.CoveragePolicyUID = value; return this; }
        public String getName() { return Name; }
        public CoveragePolicy setName(String value) { this.Name = value; return this; }
        public String getScopeLevel() { return ScopeLevel; }
        public CoveragePolicy setScopeLevel(String value) { this.ScopeLevel = value; return this; }
        public UUID getBranchId() { return BranchId; }
        public CoveragePolicy setBranchId(UUID value) { this.BranchId = value; return this; }
        public String getBranchName() { return BranchName; }
        public CoveragePolicy setBranchName(String value) { this.BranchName = value; return this; }
        public String getWorkTypeKey() { return WorkTypeKey; }
        public CoveragePolicy setWorkTypeKey(String value) { this.WorkTypeKey = value; return this; }
        public Integer getJobID() { return JobID; }
        public CoveragePolicy setJobID(Integer value) { this.JobID = value; return this; }
        public String getJobName() { return JobName; }
        public CoveragePolicy setJobName(String value) { this.JobName = value; return this; }
        public Integer getCurrentVersion() { return CurrentVersion; }
        public CoveragePolicy setCurrentVersion(Integer value) { this.CurrentVersion = value; return this; }
        public Boolean getIsActive() { return IsActive; }
        public CoveragePolicy setIsActive(Boolean value) { this.IsActive = value; return this; }
        public Date getCreatedAt() { return CreatedAt; }
        public CoveragePolicy setCreatedAt(Date value) { this.CreatedAt = value; return this; }
        public Date getUpdatedAt() { return UpdatedAt; }
        public CoveragePolicy setUpdatedAt(Date value) { this.UpdatedAt = value; return this; }
    }

    public static class CoveragePolicyVersionInfo
    {
        public Integer CoveragePolicyVersionId = null;
        public Integer CoveragePolicyId = null;
        public Integer VersionNumber = null;
        public String ChangeNote = null;
        public String ChangedByName = null;
        public Date CreatedAtUtc = null;
        public CoveragePolicyDoc Doc = null;
        
        public Integer getCoveragePolicyVersionId() { return CoveragePolicyVersionId; }
        public CoveragePolicyVersionInfo setCoveragePolicyVersionId(Integer value) { this.CoveragePolicyVersionId = value; return this; }
        public Integer getCoveragePolicyId() { return CoveragePolicyId; }
        public CoveragePolicyVersionInfo setCoveragePolicyId(Integer value) { this.CoveragePolicyId = value; return this; }
        public Integer getVersionNumber() { return VersionNumber; }
        public CoveragePolicyVersionInfo setVersionNumber(Integer value) { this.VersionNumber = value; return this; }
        public String getChangeNote() { return ChangeNote; }
        public CoveragePolicyVersionInfo setChangeNote(String value) { this.ChangeNote = value; return this; }
        public String getChangedByName() { return ChangedByName; }
        public CoveragePolicyVersionInfo setChangedByName(String value) { this.ChangedByName = value; return this; }
        public Date getCreatedAtUtc() { return CreatedAtUtc; }
        public CoveragePolicyVersionInfo setCreatedAtUtc(Date value) { this.CreatedAtUtc = value; return this; }
        public CoveragePolicyDoc getDoc() { return Doc; }
        public CoveragePolicyVersionInfo setDoc(CoveragePolicyDoc value) { this.Doc = value; return this; }
    }

}

Java CoveragePolicySaveRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/coverage/policies/{CoveragePolicyId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CoveragePolicySaveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ChangeNote>String</ChangeNote>
  <CoveragePolicyId>0</CoveragePolicyId>
  <Doc>
    <Intro>String</Intro>
    <LockLine>String</LockLine>
    <Prefs>
      <AssignmentMode>String</AssignmentMode>
      <OtThresholdHours>0</OtThresholdHours>
      <QuietEnd>String</QuietEnd>
      <QuietMode>String</QuietMode>
      <QuietStart>String</QuietStart>
      <RescheduleAllowed>false</RescheduleAllowed>
      <RestHours>0</RestHours>
      <RingWaitMinutes>0</RingWaitMinutes>
      <Rings>
        <CoverageRingDef>
          <Enabled>false</Enabled>
          <Key>String</Key>
          <Label>String</Label>
          <Sub>String</Sub>
          <WaitMinutes>0</WaitMinutes>
        </CoverageRingDef>
      </Rings>
    </Prefs>
    <Rules>
      <CoverageRuleDef>
        <CascadeLevel>String</CascadeLevel>
        <Change>String</Change>
        <Demand>String</Demand>
        <Doc>
          <CoverageRuleDocSection>
            <H>String</H>
            <T>String</T>
          </CoverageRuleDocSection>
        </Doc>
        <Kind>String</Kind>
        <Name>String</Name>
        <NoNote>String</NoNote>
        <OverrideConsequence>String</OverrideConsequence>
        <OverrideWho>String</OverrideWho>
        <Params xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </Params>
        <RuleId>String</RuleId>
        <SourcePolicyName>String</SourcePolicyName>
        <Tune>
          <Intro>String</Intro>
          <Options>
            <CoverageRuleTuneOption>
              <Label>String</Label>
              <Sub>String</Sub>
            </CoverageRuleTuneOption>
          </Options>
        </Tune>
        <Why>String</Why>
      </CoverageRuleDef>
    </Rules>
    <TemplateName>String</TemplateName>
  </Doc>
</CoveragePolicySaveRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CoverageCascadeResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Doc>
    <Intro>String</Intro>
    <LockLine>String</LockLine>
    <Prefs>
      <AssignmentMode>String</AssignmentMode>
      <OtThresholdHours>0</OtThresholdHours>
      <QuietEnd>String</QuietEnd>
      <QuietMode>String</QuietMode>
      <QuietStart>String</QuietStart>
      <RescheduleAllowed>false</RescheduleAllowed>
      <RestHours>0</RestHours>
      <RingWaitMinutes>0</RingWaitMinutes>
      <Rings>
        <CoverageRingDef>
          <Enabled>false</Enabled>
          <Key>String</Key>
          <Label>String</Label>
          <Sub>String</Sub>
          <WaitMinutes>0</WaitMinutes>
        </CoverageRingDef>
      </Rings>
    </Prefs>
    <Rules>
      <CoverageRuleDef>
        <CascadeLevel>String</CascadeLevel>
        <Change>String</Change>
        <Demand>String</Demand>
        <Doc>
          <CoverageRuleDocSection>
            <H>String</H>
            <T>String</T>
          </CoverageRuleDocSection>
        </Doc>
        <Kind>String</Kind>
        <Name>String</Name>
        <NoNote>String</NoNote>
        <OverrideConsequence>String</OverrideConsequence>
        <OverrideWho>String</OverrideWho>
        <Params xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </Params>
        <RuleId>String</RuleId>
        <SourcePolicyName>String</SourcePolicyName>
        <Tune>
          <Intro>String</Intro>
          <Options>
            <CoverageRuleTuneOption>
              <Label>String</Label>
              <Sub>String</Sub>
            </CoverageRuleTuneOption>
          </Options>
        </Tune>
        <Why>String</Why>
      </CoverageRuleDef>
    </Rules>
    <TemplateName>String</TemplateName>
  </Doc>
  <Policy>
    <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
    <BranchName>String</BranchName>
    <CoveragePolicyId>0</CoveragePolicyId>
    <CoveragePolicyUID>00000000-0000-0000-0000-000000000000</CoveragePolicyUID>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <CurrentVersion>0</CurrentVersion>
    <IsActive>false</IsActive>
    <JobID>0</JobID>
    <JobName>String</JobName>
    <Name>String</Name>
    <ScopeLevel>String</ScopeLevel>
    <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
    <WorkTypeKey>String</WorkTypeKey>
  </Policy>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <VersionNumber>0</VersionNumber>
  <Versions>
    <CoveragePolicyVersionInfo>
      <ChangeNote>String</ChangeNote>
      <ChangedByName>String</ChangedByName>
      <CoveragePolicyId>0</CoveragePolicyId>
      <CoveragePolicyVersionId>0</CoveragePolicyVersionId>
      <CreatedAtUtc>0001-01-01T00:00:00</CreatedAtUtc>
      <Doc>
        <Intro>String</Intro>
        <LockLine>String</LockLine>
        <Prefs>
          <AssignmentMode>String</AssignmentMode>
          <OtThresholdHours>0</OtThresholdHours>
          <QuietEnd>String</QuietEnd>
          <QuietMode>String</QuietMode>
          <QuietStart>String</QuietStart>
          <RescheduleAllowed>false</RescheduleAllowed>
          <RestHours>0</RestHours>
          <RingWaitMinutes>0</RingWaitMinutes>
          <Rings>
            <CoverageRingDef>
              <Enabled>false</Enabled>
              <Key>String</Key>
              <Label>String</Label>
              <Sub>String</Sub>
              <WaitMinutes>0</WaitMinutes>
            </CoverageRingDef>
          </Rings>
        </Prefs>
        <Rules>
          <CoverageRuleDef>
            <CascadeLevel>String</CascadeLevel>
            <Change>String</Change>
            <Demand>String</Demand>
            <Doc>
              <CoverageRuleDocSection>
                <H>String</H>
                <T>String</T>
              </CoverageRuleDocSection>
            </Doc>
            <Kind>String</Kind>
            <Name>String</Name>
            <NoNote>String</NoNote>
            <OverrideConsequence>String</OverrideConsequence>
            <OverrideWho>String</OverrideWho>
            <Params xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <d7p1:KeyValueOfstringstring>
                <d7p1:Key>String</d7p1:Key>
                <d7p1:Value>String</d7p1:Value>
              </d7p1:KeyValueOfstringstring>
            </Params>
            <RuleId>String</RuleId>
            <SourcePolicyName>String</SourcePolicyName>
            <Tune>
              <Intro>String</Intro>
              <Options>
                <CoverageRuleTuneOption>
                  <Label>String</Label>
                  <Sub>String</Sub>
                </CoverageRuleTuneOption>
              </Options>
            </Tune>
            <Why>String</Why>
          </CoverageRuleDef>
        </Rules>
        <TemplateName>String</TemplateName>
      </Doc>
      <VersionNumber>0</VersionNumber>
    </CoveragePolicyVersionInfo>
  </Versions>
</CoverageCascadeResponse>