text: ﻿'use strict';
  /** @namespace DevKit */
  var DevKit;
  (function (DevKit) {
  	'use strict';
  	DevKit.IncidentResolutionApi = function (e) {
  		var EMPTY_STRING = '';
  		var f = '@OData.Community.Display.V1.FormattedValue';
          function webApiField(entity, logicalName, schemaName, entityLogicalCollectionName, entityLogicalName, readOnly, upsertEntity, isMultiOptionSet) {
              var l = '@Microsoft.Dynamics.CRM.lookuplogicalname';
              var property = {};
              var getFormattedValue = function () {
                  if (entity[logicalName + f] === undefined || entity[logicalName + f] === null) {
                      return EMPTY_STRING;
                  }
                  if (entityLogicalCollectionName !== undefined && entityLogicalCollectionName.length > 0) {
                      if (entity[logicalName + l] === entityLogicalName) {
                          return entity[logicalName + f];
                      }
                      return EMPTY_STRING;
                  }
                  if (isMultiOptionSet) {
                      return entity[logicalName + f].toString().split(';').map(function (item) { return item.trim(); });
                  }
                  return entity[logicalName + f];
              };
              var getValue = function () {
                  if (entity[logicalName] === undefined || entity[logicalName] === null) {
                      return null;
                  }
                  if (entityLogicalCollectionName !== undefined && entityLogicalCollectionName.length > 0) {
                      if (entity[logicalName + l] === undefined || entity[logicalName + l] === entityLogicalName) {
                          return entity[logicalName];
                      }
                      return null;
                  }
                  if (isMultiOptionSet) {
                      return entity[logicalName].toString().split(',').map(function (item) { return parseInt(item, 10); });
                  }
                  return entity[logicalName];
              };
              var setValue = function (value) {
                  if (isMultiOptionSet) value = value.join(',');
                  if (entityLogicalCollectionName !== undefined && entityLogicalCollectionName.length > 0) {
                      value = value.replace('{', EMPTY_STRING).replace('}', EMPTY_STRING);
                      upsertEntity[schemaName + '@odata.bind'] = '/' + entityLogicalCollectionName + '(' + value + ')';
                  } else {
                      upsertEntity[logicalName] = value;
                  }
                  entity[logicalName] = value;
              };
              Object.defineProperty(property, 'FormattedValue', {
                  get: getFormattedValue
              });
              if (readOnly) {
                  Object.defineProperty(property, 'Value', {
                      get: getValue
                  });
              }
              else {
                  Object.defineProperty(property, 'Value', {
                      get: getValue,
                      set: setValue
                  });
              }
              return property;
          }
  		var incidentresolution = {
  			ActivityAdditionalParams: { a: 'activityadditionalparams' },
  			ActivityId: { a: 'activityid' },
  			ActualDurationMinutes: { a: 'actualdurationminutes' },
  			ActualEnd_UtcDateOnly: { a: 'actualend' },
  			ActualStart_UtcDateOnly: { a: 'actualstart' },
  			Category: { a: 'category' },
  			Community: { a: 'community' },
  			CreatedBy: { b: 'createdby', a: '_createdby_value', c: 'systemusers', d: 'systemuser', r: true },
  			CreatedByExternalParty: { b: 'createdbyexternalparty', a: '_createdbyexternalparty_value', c: 'externalparties', d: 'externalparty', r: true },
  			CreatedOn_UtcDateAndTime: { a: 'createdon', r: true },
  			CreatedOnBehalfBy: { b: 'createdonbehalfby', a: '_createdonbehalfby_value', c: 'systemusers', d: 'systemuser', r: true },
  			DeliveryLastAttemptedOn_UtcDateAndTime: { a: 'deliverylastattemptedon', r: true },
  			DeliveryPriorityCode: { a: 'deliveryprioritycode' },
  			Description: { a: 'description' },
  			ExchangeItemId: { a: 'exchangeitemid' },
  			ExchangeRate: { a: 'exchangerate', r: true },
  			ExchangeWebLink: { a: 'exchangeweblink' },
  			ImportSequenceNumber: { a: 'importsequencenumber' },
  			IncidentId: { b: 'incidentid', a: '_incidentid_value', c: 'incidents', d: 'incident' },
  			InstanceTypeCode: { a: 'instancetypecode', r: true },
  			IsBilled: { a: 'isbilled' },
  			IsMapiPrivate: { a: 'ismapiprivate' },
  			IsRegularActivity: { a: 'isregularactivity', r: true },
  			IsWorkflowCreated: { a: 'isworkflowcreated' },
  			LastOnHoldTime_UtcDateAndTime: { a: 'lastonholdtime' },
  			LeftVoiceMail: { a: 'leftvoicemail' },
  			ModifiedBy: { b: 'modifiedby', a: '_modifiedby_value', c: 'systemusers', d: 'systemuser', r: true },
  			ModifiedByExternalParty: { b: 'modifiedbyexternalparty', a: '_modifiedbyexternalparty_value', c: 'externalparties', d: 'externalparty', r: true },
  			ModifiedOn_UtcDateAndTime: { a: 'modifiedon', r: true },
  			ModifiedOnBehalfBy: { b: 'modifiedonbehalfby', a: '_modifiedonbehalfby_value', c: 'systemusers', d: 'systemuser', r: true },
  			OnHoldTime: { a: 'onholdtime', r: true },
  			OverriddenCreatedOn_UtcDateOnly: { a: 'overriddencreatedon' },
  			OwnerId_systemuser: { b: 'ownerid', a: '_ownerid_value', c: 'systemusers', d: 'systemuser' },
  			OwnerId_team: { b: 'ownerid', a: '_ownerid_value', c: 'teams', d: 'team' },
  			OwningBusinessUnit: { b: 'owningbusinessunit', a: '_owningbusinessunit_value', c: 'businessunits', d: 'businessunit', r: true },
  			OwningTeam: { b: 'owningteam', a: '_owningteam_value', c: 'teams', d: 'team', r: true },
  			OwningUser: { b: 'owninguser', a: '_owninguser_value', c: 'systemusers', d: 'systemuser', r: true },
  			PostponeActivityProcessingUntil_UtcDateAndTime: { a: 'postponeactivityprocessinguntil', r: true },
  			PriorityCode: { a: 'prioritycode' },
  			ProcessId: { a: 'processid' },
  			regardingobjectid_account_incidentresolution: { b: 'regardingobjectid_account_incidentresolution', a: '_regardingobjectid_value', c: 'accounts', d: 'account' },
  			regardingobjectid_bookableresourcebooking_incidentresolution: { b: 'regardingobjectid_bookableresourcebooking_incidentresolution', a: '_regardingobjectid_value', c: 'bookableresourcebookings', d: 'bookableresourcebooking' },
  			regardingobjectid_bookableresourcebookingheader_incidentresolution: { b: 'regardingobjectid_bookableresourcebookingheader_incidentresolution', a: '_regardingobjectid_value', c: 'bookableresourcebookingheaders', d: 'bookableresourcebookingheader' },
  			regardingobjectid_bulkoperation_incidentresolution: { b: 'regardingobjectid_bulkoperation_incidentresolution', a: '_regardingobjectid_value', c: 'bulkoperations', d: 'bulkoperation' },
  			regardingobjectid_campaign_incidentresolution: { b: 'regardingobjectid_campaign_incidentresolution', a: '_regardingobjectid_value', c: 'campaigns', d: 'campaign' },
  			regardingobjectid_campaignactivity_incidentresolution: { b: 'regardingobjectid_campaignactivity_incidentresolution', a: '_regardingobjectid_value', c: 'campaignactivities', d: 'campaignactivity' },
  			regardingobjectid_entitlement_incidentresolution: { b: 'regardingobjectid_entitlement_incidentresolution', a: '_regardingobjectid_value', c: 'entitlements', d: 'entitlement' },
  			regardingobjectid_entitlementtemplate_incidentresolution: { b: 'regardingobjectid_entitlementtemplate_incidentresolution', a: '_regardingobjectid_value', c: 'entitlementtemplates', d: 'entitlementtemplate' },
  			regardingobjectid_new_interactionforemail_incidentresolution: { b: 'regardingobjectid_new_interactionforemail_incidentresolution', a: '_regardingobjectid_value', c: 'interactionforemails', d: 'interactionforemail' },
  			regardingobjectid_knowledgearticle_incidentresolution: { b: 'regardingobjectid_knowledgearticle_incidentresolution', a: '_regardingobjectid_value', c: 'knowledgearticles', d: 'knowledgearticle' },
  			regardingobjectid_knowledgebaserecord_incidentresolution: { b: 'regardingobjectid_knowledgebaserecord_incidentresolution', a: '_regardingobjectid_value', c: 'knowledgebaserecords', d: 'knowledgebaserecord' },
  			regardingobjectid_lead_incidentresolution: { b: 'regardingobjectid_lead_incidentresolution', a: '_regardingobjectid_value', c: 'leads', d: 'lead' },
  			RegardingObjectIdYomiName: { a: 'regardingobjectidyominame' },
  			ResolutionTypeCode: { a: 'resolutiontypecode' },
  			ScheduledDurationMinutes: { a: 'scheduleddurationminutes', r: true },
  			ScheduledEnd_UtcDateOnly: { a: 'scheduledend' },
  			ScheduledStart_UtcDateOnly: { a: 'scheduledstart' },
  			SenderMailboxId: { b: 'sendermailboxid', a: '_sendermailboxid_value', c: 'mailboxes', d: 'mailbox', r: true },
  			SentOn_UtcDateAndTime: { a: 'senton', r: true },
  			SeriesId: { a: 'seriesid', r: true },
  			ServiceId: { b: 'serviceid', a: '_serviceid_value', c: 'services', d: 'service' },
  			SLAId: { b: 'slaid', a: '_slaid_value', c: 'slas', d: 'sla' },
  			SLAInvokedId: { b: 'slainvokedid', a: '_slainvokedid_value', c: 'slas', d: 'sla', r: true },
  			SLAName: { a: 'slaname', r: true },
  			SortDate_UtcDateAndTime: { a: 'sortdate' },
  			StageId: { a: 'stageid' },
  			StateCode: { a: 'statecode' },
  			StatusCode: { a: 'statuscode' },
  			Subcategory: { a: 'subcategory' },
  			Subject: { a: 'subject' },
  			TimeSpent: { a: 'timespent' },
  			TimeZoneRuleVersionNumber: { a: 'timezoneruleversionnumber' },
  			TotalTimeSpent: { a: 'totaltimespent' },
  			TransactionCurrencyId: { b: 'transactioncurrencyid', a: '_transactioncurrencyid_value', c: 'transactioncurrencies', d: 'transactioncurrency' },
  			TraversedPath: { a: 'traversedpath' },
  			UTCConversionTimeZoneCode: { a: 'utcconversiontimezonecode' },
  			VersionNumber: { a: 'versionnumber', r: true }
  		};
  		if (e === undefined) e = {};
  		var u = {};
  		for (var field in incidentresolution) {
  			var a = incidentresolution[field].a;
  			var b = incidentresolution[field].b;
  			var c = incidentresolution[field].c;
  			var d = incidentresolution[field].d;
  			var g = incidentresolution[field].g;
  			var r = incidentresolution[field].r;
  			incidentresolution[field] = webApiField(e, a, b, c, d, r, u, g);
  		}
  		Object.defineProperty(incidentresolution, 'ActivityParties', {
  			get: function () { return e['incidentresolution_activity_parties']; },
  			set: function (value) {
  				e['incidentresolution_activity_parties'] = value;
  				u['incidentresolution_activity_parties'] = value;
  			}
  		});
  		incidentresolution.Entity = u;
  		incidentresolution.EntityName = 'incidentresolution';
  		incidentresolution.EntityCollectionName = 'incidentresolutions';
  		incidentresolution['@odata.etag'] = e['@odata.etag'];
  		incidentresolution.getAliasedValue = function (alias, isMultiOptionSet) {
  			if (e[alias] === undefined || e[alias] === null) {
  				return null;
  			}
  			if (isMultiOptionSet) {
  				return e[alias].toString().split(',').map(function (item) { return parseInt(item, 10); });
  			}
  			return e[alias];
  		}
  		incidentresolution.getAliasedFormattedValue = function (alias, isMultiOptionSet) {
  			if (e[alias + f] === undefined || e[alias + f] === null) {
  				return EMPTY_STRING;
  			}
  			if (isMultiOptionSet) {
  				return e[alias + f].toString().split(';').map(function (item) { return item.trim(); });
  			}
  			return e[alias + f];
  		}
  		return incidentresolution;
  	};
  })(DevKit || (DevKit = {}));
  /** @namespace OptionSet */
  var OptionSet;
  (function (OptionSet) {
  	OptionSet.IncidentResolution = {
  		Community : {
  			Cortana: 5,
  			Direct_Line: 6,
  			Direct_Line_Speech: 8,
  			Email: 9,
  			Facebook: 1,
  			GroupMe: 10,
  			Kik: 11,
  			Line: 3,
  			Microsoft_Teams: 7,
  			Other: 0,
  			Skype: 13,
  			Slack: 14,
  			Telegram: 12,
  			Twitter: 2,
  			Wechat: 4,
  			WhatsApp: 15
  		},
  		DeliveryPriorityCode : {
  			High: 2,
  			Low: 0,
  			Normal: 1
  		},
  		InstanceTypeCode : {
  			Not_Recurring: 0,
  			Recurring_Exception: 3,
  			Recurring_Future_Exception: 4,
  			Recurring_Instance: 2,
  			Recurring_Master: 1
  		},
  		PriorityCode : {
  			High: 2,
  			Low: 0,
  			Normal: 1
  		},
  		ResolutionTypeCode : {
  			Information_Provided: 1000,
  			Problem_Solved: 5
  		},
  		StateCode : {
  			Canceled: 2,
  			Completed: 1,
  			Open: 0
  		},
  		StatusCode : {
  			Canceled: 3,
  			Closed: 2,
  			Open: 1
  		},
          RollupState : {
              NotCalculated: 0,
              Calculated: 1,
              OverflowError: 2,
              OtherError: 3,
              RetryLimitExceeded: 4,
              HierarchicalRecursionLimitReached: 5,
              LoopDetected: 6
          }
  
  	};
  })(OptionSet || (OptionSet = {}));