Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 9513031

Browse files
Yung-Shin LinYung-Shin Lin
authored andcommitted
Project Oxford SDK Release - December 2015 Update 1
1 parent 43d2642 commit 9513031

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1866
-2682
lines changed
9.41 KB
Loading

Face/README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ For questions, feedback, or suggestions about Project Oxford services, feel free
4848

4949
- [Blog](<https://blogs.technet.com/b/machinelearning/archive/tags/project+oxford/default.aspx>)
5050

51-
Changes
52-
============
53-
This document is targeting Project Oxford Face V1.0 service. For user who has experiences on using Project Oxford Face V0, there are some major changes we would like you to know before switching from Project Oxford Face V0 to Project Oxford Face V1.0 service.
54-
55-
- **API Signature**
56-
57-
In Project Oxford Face V1.0, Service root endpoint changes from [https://api.projectoxford.ai/face/v0/]() to [https://api.projectoxford.ai/face/v1.0/]()
58-
There are several signature changes for API, such as [Face - Detect](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), [Face - Identify](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), [Face - Find Similar](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237), [Face - Group](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395238).
59-
60-
- **Persisted Data**
61-
62-
Existing Person Group and Person data which has been setup with Project Oxford Face V0 cannot be accessed with Project Oxford Face V1.0 service. This incompatible issue will occur for only this one time, following API updates will not affect persisted data any more.
63-
6451
License
6552
=======
6653

Face/Windows/ClientLibrary/Contract/FaceListMetadata.cs renamed to Face/Windows/ClientLibrary/ClientError.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,48 +31,49 @@
3131
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3232
//
3333

34-
namespace Microsoft.ProjectOxford.Face.Contract
34+
using System;
35+
36+
namespace Microsoft.ProjectOxford.Face
3537
{
3638
/// <summary>
37-
/// The face list metadata class.
39+
/// Container of ClientError and Error Entity.
3840
/// </summary>
39-
public class FaceListMetadata
41+
public class ClientError
4042
{
41-
#region Properties
42-
4343
/// <summary>
44-
/// Gets or sets the face list identifier.
44+
/// Gets or sets error code in error entity.
4545
/// </summary>
4646
/// <value>
47-
/// The face list identifier.
47+
/// The code of client error.
4848
/// </value>
49-
public string FaceListId
49+
public string Code
5050
{
51-
get; set;
51+
get;
52+
set;
5253
}
5354

5455
/// <summary>
55-
/// Gets or sets the name.
56+
/// Gets or sets the message.
5657
/// </summary>
5758
/// <value>
58-
/// The name.
59+
/// The message.
5960
/// </value>
60-
public string Name
61+
public string Message
6162
{
62-
get; set;
63+
get;
64+
set;
6365
}
6466

6567
/// <summary>
66-
/// Gets or sets the user data.
68+
/// Gets or sets the request identifier.
6769
/// </summary>
6870
/// <value>
69-
/// The user data.
71+
/// The request identifier.
7072
/// </value>
71-
public string UserData
73+
public Guid RequestId
7274
{
73-
get; set;
75+
get;
76+
set;
7477
}
75-
76-
#endregion Properties
7778
}
7879
}
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license.
4+
//
5+
// Project Oxford: http://ProjectOxford.ai
6+
//
7+
// ProjectOxford SDK Github:
8+
// https://github.com/Microsoft/ProjectOxfordSDK-Windows
9+
//
10+
// Copyright (c) Microsoft Corporation
11+
// All rights reserved.
12+
//
13+
// MIT License:
14+
// Permission is hereby granted, free of charge, to any person obtaining
15+
// a copy of this software and associated documentation files (the
16+
// "Software"), to deal in the Software without restriction, including
17+
// without limitation the rights to use, copy, modify, merge, publish,
18+
// distribute, sublicense, and/or sell copies of the Software, and to
19+
// permit persons to whom the Software is furnished to do so, subject to
20+
// the following conditions:
21+
//
22+
// The above copyright notice and this permission notice shall be
23+
// included in all copies or substantial portions of the Software.
24+
//
25+
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
26+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29+
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31+
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32+
//
33+
34+
using System;
35+
using System.Net;
36+
37+
namespace Microsoft.ProjectOxford.Face
38+
{
39+
/// <summary>
40+
/// The Exception will be shown to client.
41+
/// </summary>
42+
public class ClientException : Exception
43+
{
44+
/// <summary>
45+
/// Initializes a new instance of the <see cref="ClientException"/> class.
46+
/// </summary>
47+
public ClientException()
48+
: base()
49+
{
50+
}
51+
52+
/// <summary>
53+
/// Initializes a new instance of the <see cref="ClientException"/> class.
54+
/// </summary>
55+
/// <param name="message">The corresponding error message.</param>
56+
public ClientException(string message)
57+
: base(message)
58+
{
59+
this.Error = new ClientError()
60+
{
61+
Code = HttpStatusCode.InternalServerError.ToString(),
62+
Message = message
63+
};
64+
}
65+
66+
/// <summary>
67+
/// Initializes a new instance of the <see cref="ClientException"/> class.
68+
/// </summary>
69+
/// <param name="message">The corresponding error message.</param>
70+
/// <param name="httpStatus">The Http Status code.</param>
71+
public ClientException(string message, HttpStatusCode httpStatus)
72+
: base(message)
73+
{
74+
this.HttpStatus = httpStatus;
75+
76+
this.Error = new ClientError()
77+
{
78+
Code = this.HttpStatus.ToString(),
79+
Message = message
80+
};
81+
}
82+
83+
/// <summary>
84+
/// Initializes a new instance of the <see cref="ClientException"/> class.
85+
/// </summary>
86+
/// <param name="message">The corresponding error message.</param>
87+
/// <param name="innerException">The inner exception.</param>
88+
public ClientException(string message, Exception innerException)
89+
: base(message, innerException)
90+
{
91+
this.Error = new ClientError()
92+
{
93+
Code = HttpStatusCode.InternalServerError.ToString(),
94+
Message = message
95+
};
96+
}
97+
98+
/// <summary>
99+
/// Initializes a new instance of the <see cref="ClientException"/> class.
100+
/// </summary>
101+
/// <param name="message">The corresponding error message.</param>
102+
/// <param name="errorCode">The error code.</param>
103+
/// <param name="httpStatus">The http status.</param>
104+
/// <param name="innerException">The inner exception.</param>
105+
public ClientException(string message, string errorCode, HttpStatusCode httpStatus, Exception innerException)
106+
: base(message, innerException)
107+
{
108+
this.HttpStatus = httpStatus;
109+
110+
this.Error = new ClientError()
111+
{
112+
Code = errorCode,
113+
Message = message
114+
};
115+
}
116+
117+
/// <summary>
118+
/// Initializes a new instance of the <see cref="ClientException"/> class.
119+
/// </summary>
120+
/// <param name="error">The error entity.</param>
121+
/// <param name="httpStatus">The http status.</param>
122+
public ClientException(ClientError error, HttpStatusCode httpStatus)
123+
{
124+
this.Error = error;
125+
this.HttpStatus = httpStatus;
126+
}
127+
128+
/// <summary>
129+
/// Gets http status of http response.
130+
/// </summary>
131+
/// <value>
132+
/// The HTTP status.
133+
/// </value>
134+
public HttpStatusCode HttpStatus { get; private set; }
135+
136+
/// <summary>
137+
/// Gets or sets the httpError message.
138+
/// </summary>
139+
/// <value>
140+
/// The error.
141+
/// </value>
142+
public ClientError Error { get; set; }
143+
144+
/// <summary>
145+
/// Create Client Exception of Bad Request.
146+
/// </summary>
147+
/// <param name="message">The corresponding error message.</param>
148+
/// <returns>Client Exception Instance.</returns>
149+
public static ClientException BadRequest(string message)
150+
{
151+
return new ClientException(
152+
new ClientError()
153+
{
154+
Code = ((int)HttpStatusCode.BadRequest).ToString(),
155+
Message = message
156+
},
157+
HttpStatusCode.BadRequest);
158+
}
159+
}
160+
}

Face/Windows/ClientLibrary/Contract/Candidate.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,32 +40,20 @@ namespace Microsoft.ProjectOxford.Face.Contract
4040
/// </summary>
4141
public class Candidate
4242
{
43-
#region Properties
44-
4543
/// <summary>
4644
/// Gets or sets the person identifier.
4745
/// </summary>
4846
/// <value>
4947
/// The person identifier.
5048
/// </value>
51-
public Guid PersonId
52-
{
53-
get;
54-
set;
55-
}
49+
public Guid PersonId { get; set; }
5650

5751
/// <summary>
5852
/// Gets or sets the confidence.
5953
/// </summary>
6054
/// <value>
6155
/// The confidence.
6256
/// </value>
63-
public double Confidence
64-
{
65-
get;
66-
set;
67-
}
68-
69-
#endregion Properties
57+
public double Confidence { get; set; }
7058
}
71-
}
59+
}

0 commit comments

Comments
 (0)