-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathIContentstackService.cs
More file actions
105 lines (92 loc) · 3.39 KB
/
IContentstackService.cs
File metadata and controls
105 lines (92 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using Contentstack.Management.Core.Http;
using Contentstack.Management.Core.Queryable;
using Newtonsoft.Json;
namespace Contentstack.Management.Core.Services
{
/// <summary>
/// Interface for a Contentstack service.
/// </summary>
public interface IContentstackService : IDisposable
{
/// <summary>
/// Gets and sets a flag that indicates whether the request is sent as a query string instead of the request body.
/// </summary>
bool UseQueryString { get; set; }
/// <summary>
/// Management Tokens are tokens that provide you with read-write access to the content of your stack.
/// </summary>
string ManagementToken { get; set; }
/// <summary>
/// Returns a dictionary of the parameters included in this request.
/// </summary>
ParameterCollection Parameters { get; }
/// <summary>
/// Returns a dictionary of the headers included in this request.
/// </summary>
IDictionary<string, string> Headers { get;}
/// <summary>
/// Gets and Sets the resource path added on to the endpoint.
/// </summary>
string ResourcePath
{
get;
set;
}
/// <summary>
/// Returns the QueryResource that should be appended to the resource path.
/// </summary>
IDictionary<string, string> QueryResources
{
get;
}
/// <summary>
/// Gets and sets the type of http request to make, whether it should be POST,GET or DELETE
/// </summary>
string HttpMethod
{
get;
set;
}
/// <summary>
/// Returns the path resources that should be used within the resource path.
/// This is used for services where path keys can contain '/'
/// characters, making string-splitting of a resource path potentially
/// hazardous.
/// </summary>
IDictionary<string, string> PathResources
{
get;
}
/// <summary>
/// Adds a new entry to the QueryResources collection for the request
/// </summary>
/// <param name="queryResources">The name of the QueryResource</param>
/// <param name="value">Value of the entry</param>
void AddQueryResource(string queryResource, string value);
/// <summary>
/// Adds a new entry to the PathResources collection for the request
/// </summary>
/// <param name="key">The name of the pathresource with potential greedy syntax: {key+}</param>
/// <param name="value">Value of the entry</param>
void AddPathResource(string key, string value);
/// <summary>
/// Gets and Sets the content for this request.
/// </summary>
HttpContent Content
{
get;
set;
}
/// <summary>
/// Gets the header value from the request.
/// </summary>
string GetHeaderValue(string headerName);
IHttpRequest CreateHttpRequest(HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false, string apiVersion = null);
void OnResponse(IResponse httpResponse, ContentstackClientOptions config);
bool HasRequestBody();
}
}