/// <summary> /// Initializes a new survey under a specific organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="organizationId">The root organization's unique identifier.</param> /// <param name="surveyOrg">The organization requesting feedback.</param> /// <param name="customer">The customer who should respond to the feedback request.</param> /// <param name="job">The job about which we are asking for feedback.</param> /// <remarks>The API will take care of creating or updating customer and job requests. It will also take feedback frequency caps into consideration before creating a survey.</remarks> public Survey(IListen360 listen360, long organizationId, IOrganization surveyOrg, ICustomer customer, IJob job) : base(listen360) { _organizationId = organizationId; WriteAttribute("organization", surveyOrg); WriteAttribute("customer", customer); WriteAttribute("job", job); }
public TestContext() { this.Url = "https://foo.bar"; this.Token = "abc123"; this.Authentication = "YWJjMTIzOlg="; this.WebRequest = new FakeWebRequest(); this.WebRequestFactory = new FakeWebRequestFactory(); this.WebRequestFactory.CreateWebRequestFakeResult = this.WebRequest; this.Listen360 = Listen360API.Listen360.GetInstance(Url, Token, WebRequestFactory); }
/// <summary> /// Deserializes an "array" element obtained from the remote service into a collection of model objects. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="node">An XML fragment obtained from the remote service.</param> /// <param name="container">The collection that will contain the model objects/</param> /// <returns>An list of model objects.</returns> public static object Deserialize(IListen360 listen360, XmlNode node, ArrayList container) { foreach (XmlNode childNode in node.ChildNodes) { if (childNode.NodeType != XmlNodeType.Element) { continue; } container.Add(Deserialize(listen360, childNode)); } return(container); }
/// <summary> /// Initializes a new division under a specific parent organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="parentId">The unique identifier of the parent organization.</param> public Division(IListen360 listen360, long parentId) : base(listen360) { ParentId = parentId; }
public BookClub(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <exclude/> public Technician(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <exclude/> public Customer(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <summary> /// Initializes a new franchise under a specific parent organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="parentId">The unique identifier of the parent organization.</param> public Franchise(IListen360 listen360, long parentId) : base(listen360) { ParentId = parentId; }
/// <summary> /// Initializes a new technician. /// </summary> /// <param name="listen360">The remote service.</param> public Technician(IListen360 listen360) : base(listen360) { }
/// <summary> /// Deserializes an XML graph obtained from the remote service into the corresponding model classes. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="node">An XML fragment obtained from the remote service.</param> /// <returns>An object graph represenation.</returns> public static object Deserialize(IListen360 listen360, XmlNode node) { object instance = null; string typeName = null; if (node.Attributes["type"] != null) { typeName = node.Attributes["type"].Value; } else { XmlNode typeNode = node.SelectSingleNode("type"); typeName = (typeNode == null) ? node.Name : typeNode.InnerText; } switch (typeName.ToLower()) { case "array": ArrayList container = new ArrayList(node.ChildNodes.Count); Deserialize(listen360, node, container); instance = container; break; case "custom-attribute-definition": instance = new CustomAttributeDefinition(listen360, node); break; case "customer": instance = new Customer(listen360, node); break; case "division": instance = new Division(listen360, node); break; case "franchise": instance = new Franchise(listen360, node); break; case "franchisor": instance = new Franchisor(listen360, node); break; case "job": instance = new Job(listen360, node); break; case "membership": instance = new Membership(listen360, node); break; case "technician": instance = new Technician(listen360, node); break; default: //throw new NotSupportedException($"The type {typeName} is not supported"); break; } return(instance); }
public Post(IListen360 listen360, XmlNode node) : base(listen360, node) { }
public BookClub(IListen360 listen360) : base(listen360) { }
/// <summary> /// Initializes a new model instance. /// </summary> /// <param name="listen360">The remote service.</param> public ModelBase(IListen360 listen360) { Listen360 = listen360; }
/// <exclude/> public OrganizationBase(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <exclude/> public OrganizationBase(IListen360 listen360) : base(listen360) { }
/// <exclude/> public Survey(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <inheritdoc/> public CustomAttributeDefinition(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <summary> /// Initializes a new survey under a specific organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="organizationId">The root organization's unique identifier.</param> /// <param name="surveyOrg">The organization requesting feedback.</param> /// <param name="customer">The customer who should respond to the feedback request.</param> /// <remarks>The API will take care of creating or updating customer and job requests. It will also take feedback frequency caps into consideration before creating a survey.</remarks> public Survey(IListen360 listen360, long organizationId, IOrganization surveyOrg, ICustomer customer) : this(listen360, organizationId, surveyOrg, customer, null) { }
/// <summary> /// Initializes an existing model instance and loads data from the specified XML fragment. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="node">An XML fragment obtained from the remote service.</param> public ModelBase(IListen360 listen360, XmlNode node) { Listen360 = listen360; LoadXml(node); }
/// <summary> /// Initializes a new membership under a specific organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="organizationId">The organization's unique identifier.</param> /// <remarks>Once the membership is saved an invite will be sent to the appropriate email address. It then be accepted by the recipient.</remarks> public Membership(IListen360 listen360, long organizationId) : base(listen360) { _organizationId = organizationId; }
public Post(IListen360 listen360) : base(listen360) { }
/// <exclude/> public Membership(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <summary> /// Initializes a new franchise. /// </summary> /// <param name="listen360">The remote service.</param> public Franchise(IListen360 listen360) : base(listen360) { }
/// <summary> /// Initializes a new job. /// </summary> /// <param name="listen360">The remote service.</param> public Job(IListen360 listen360) : base(listen360) { }
/// <summary> /// Initializes a new job for a specific customer under a specific organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="organizationId">The organization's unique identifier.</param> /// <param name="customerId">The customer's unique identifier.</param> public Job(IListen360 listen360, long organizationId, long customerId) : base(listen360) { _organizationId = organizationId; _customerId = customerId; WriteAttribute("customer-id", customerId); }
/// <exlude/> public Job(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <summary> /// Initializes a new technician under a specific organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="organizationId">The organization's unique identifier.</param> public Technician(IListen360 listen360, long organizationId) : base(listen360) { _organizationId = organizationId; }
/// <exclude/> public Division(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <exclude/> public Franchisor(IListen360 listen360, XmlNode node) : base(listen360, node) { }
/// <summary> /// Initializes a new customer under a specific organization. /// </summary> /// <param name="listen360">The remote service.</param> /// <param name="organizationId">The organization's unique identifier.</param> public Customer(IListen360 listen360, long organizationId) : base(listen360) { _organizationId = organizationId; }