Skip to content

Commit deedac7

Browse files
committed
updated samples
1 parent 6bd589e commit deedac7

88 files changed

Lines changed: 5320 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* MailBaby Email Delivery and Management Service API
3+
* **Send emails fast and with confidence through our easy to use [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API interface.**\n# Overview\nThis is the API interface to the [Mail Baby](https//mail.baby/) Mail services provided by [InterServer](https://www.interserver.net). To use this service you must have an account with us at [my.interserver.net](https://my.interserver.net).\n# Authentication\nIn order to use most of the API calls you must pass credentials from the [my.interserver.net](https://my.interserver.net/) site.\nWe support several different authentication methods but the preferred method is to use the **API Key** which you can get from the [Account Security](https://my.interserver.net/account_security) page.\n
4+
*
5+
* The version of the OpenAPI document: 1.1.0
6+
* Contact: support@interserver.net
7+
*
8+
* NOTE: This class is auto generated by the OAS code generator program.
9+
* https://github.com/OpenAPITools/openapi-generator
10+
* Do not edit the class manually.
11+
*/
12+
13+
/**
14+
* OASDenyRuleRecordAllOf
15+
*/
16+
public class OASDenyRuleRecordAllOf {
17+
/**
18+
* The deny rule Id number.
19+
* @return id
20+
*/
21+
public Integer id { get; set; }
22+
23+
/**
24+
* the date the rule was created.
25+
* @return created
26+
*/
27+
public Datetime created { get; set; }
28+
29+
public static OASDenyRuleRecordAllOf getExample() {
30+
OASDenyRuleRecordAllOf denyRuleRecordAllOf = new OASDenyRuleRecordAllOf();
31+
denyRuleRecordAllOf.id = 41124;
32+
denyRuleRecordAllOf.created = Datetime.newInstanceGmt(2000, 1, 23, 4, 56, 7);
33+
return denyRuleRecordAllOf;
34+
}
35+
36+
public Boolean equals(Object obj) {
37+
if (obj instanceof OASDenyRuleRecordAllOf) {
38+
OASDenyRuleRecordAllOf denyRuleRecordAllOf = (OASDenyRuleRecordAllOf) obj;
39+
return this.id == denyRuleRecordAllOf.id
40+
&& this.created == denyRuleRecordAllOf.created;
41+
}
42+
return false;
43+
}
44+
45+
public Integer hashCode() {
46+
Integer hashCode = 43;
47+
hashCode = (17 * hashCode) + (id == null ? 0 : System.hashCode(id));
48+
hashCode = (17 * hashCode) + (created == null ? 0 : System.hashCode(created));
49+
return hashCode;
50+
}
51+
}
52+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>42.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
@isTest
2+
private class OASDenyRuleRecordAllOfTest {
3+
@isTest
4+
private static void equalsSameInstance() {
5+
OASDenyRuleRecordAllOf denyRuleRecordAllOf1 = OASDenyRuleRecordAllOf.getExample();
6+
OASDenyRuleRecordAllOf denyRuleRecordAllOf2 = denyRuleRecordAllOf1;
7+
OASDenyRuleRecordAllOf denyRuleRecordAllOf3 = new OASDenyRuleRecordAllOf();
8+
OASDenyRuleRecordAllOf denyRuleRecordAllOf4 = denyRuleRecordAllOf3;
9+
10+
System.assert(denyRuleRecordAllOf1.equals(denyRuleRecordAllOf2));
11+
System.assert(denyRuleRecordAllOf2.equals(denyRuleRecordAllOf1));
12+
System.assert(denyRuleRecordAllOf1.equals(denyRuleRecordAllOf1));
13+
System.assert(denyRuleRecordAllOf3.equals(denyRuleRecordAllOf4));
14+
System.assert(denyRuleRecordAllOf4.equals(denyRuleRecordAllOf3));
15+
System.assert(denyRuleRecordAllOf3.equals(denyRuleRecordAllOf3));
16+
}
17+
18+
@isTest
19+
private static void equalsIdenticalInstance() {
20+
OASDenyRuleRecordAllOf denyRuleRecordAllOf1 = OASDenyRuleRecordAllOf.getExample();
21+
OASDenyRuleRecordAllOf denyRuleRecordAllOf2 = OASDenyRuleRecordAllOf.getExample();
22+
OASDenyRuleRecordAllOf denyRuleRecordAllOf3 = new OASDenyRuleRecordAllOf();
23+
OASDenyRuleRecordAllOf denyRuleRecordAllOf4 = new OASDenyRuleRecordAllOf();
24+
25+
System.assert(denyRuleRecordAllOf1.equals(denyRuleRecordAllOf2));
26+
System.assert(denyRuleRecordAllOf2.equals(denyRuleRecordAllOf1));
27+
System.assert(denyRuleRecordAllOf3.equals(denyRuleRecordAllOf4));
28+
System.assert(denyRuleRecordAllOf4.equals(denyRuleRecordAllOf3));
29+
}
30+
31+
@isTest
32+
private static void notEqualsDifferentType() {
33+
OASDenyRuleRecordAllOf denyRuleRecordAllOf1 = OASDenyRuleRecordAllOf.getExample();
34+
OASDenyRuleRecordAllOf denyRuleRecordAllOf2 = new OASDenyRuleRecordAllOf();
35+
36+
System.assertEquals(false, denyRuleRecordAllOf1.equals('foo'));
37+
System.assertEquals(false, denyRuleRecordAllOf2.equals('foo'));
38+
}
39+
40+
@isTest
41+
private static void notEqualsNull() {
42+
OASDenyRuleRecordAllOf denyRuleRecordAllOf1 = OASDenyRuleRecordAllOf.getExample();
43+
OASDenyRuleRecordAllOf denyRuleRecordAllOf2 = new OASDenyRuleRecordAllOf();
44+
OASDenyRuleRecordAllOf denyRuleRecordAllOf3;
45+
46+
System.assertEquals(false, denyRuleRecordAllOf1.equals(denyRuleRecordAllOf3));
47+
System.assertEquals(false, denyRuleRecordAllOf2.equals(denyRuleRecordAllOf3));
48+
}
49+
50+
@isTest
51+
private static void consistentHashCodeValue() {
52+
OASDenyRuleRecordAllOf denyRuleRecordAllOf1 = OASDenyRuleRecordAllOf.getExample();
53+
OASDenyRuleRecordAllOf denyRuleRecordAllOf2 = new OASDenyRuleRecordAllOf();
54+
55+
System.assertEquals(denyRuleRecordAllOf1.hashCode(), denyRuleRecordAllOf1.hashCode());
56+
System.assertEquals(denyRuleRecordAllOf2.hashCode(), denyRuleRecordAllOf2.hashCode());
57+
}
58+
59+
@isTest
60+
private static void equalInstancesHaveSameHashCode() {
61+
OASDenyRuleRecordAllOf denyRuleRecordAllOf1 = OASDenyRuleRecordAllOf.getExample();
62+
OASDenyRuleRecordAllOf denyRuleRecordAllOf2 = OASDenyRuleRecordAllOf.getExample();
63+
OASDenyRuleRecordAllOf denyRuleRecordAllOf3 = new OASDenyRuleRecordAllOf();
64+
OASDenyRuleRecordAllOf denyRuleRecordAllOf4 = new OASDenyRuleRecordAllOf();
65+
66+
System.assert(denyRuleRecordAllOf1.equals(denyRuleRecordAllOf2));
67+
System.assert(denyRuleRecordAllOf3.equals(denyRuleRecordAllOf4));
68+
System.assertEquals(denyRuleRecordAllOf1.hashCode(), denyRuleRecordAllOf2.hashCode());
69+
System.assertEquals(denyRuleRecordAllOf3.hashCode(), denyRuleRecordAllOf4.hashCode());
70+
}
71+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>42.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# DenyRuleRecord_allOf
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **integer** | | [default to null]
7+
**created** | **string** | | [default to null]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# deny_rule_record_all_of_t
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **int** | The deny rule Id number. |
7+
**created** | **char \*** | the date the rule was created. |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#include <stdlib.h>
2+
#include <string.h>
3+
#include <stdio.h>
4+
#include "deny_rule_record_all_of.h"
5+
6+
7+
8+
deny_rule_record_all_of_t *deny_rule_record_all_of_create(
9+
int id,
10+
char *created
11+
) {
12+
deny_rule_record_all_of_t *deny_rule_record_all_of_local_var = malloc(sizeof(deny_rule_record_all_of_t));
13+
if (!deny_rule_record_all_of_local_var) {
14+
return NULL;
15+
}
16+
deny_rule_record_all_of_local_var->id = id;
17+
deny_rule_record_all_of_local_var->created = created;
18+
19+
return deny_rule_record_all_of_local_var;
20+
}
21+
22+
23+
void deny_rule_record_all_of_free(deny_rule_record_all_of_t *deny_rule_record_all_of) {
24+
if(NULL == deny_rule_record_all_of){
25+
return ;
26+
}
27+
listEntry_t *listEntry;
28+
if (deny_rule_record_all_of->created) {
29+
free(deny_rule_record_all_of->created);
30+
deny_rule_record_all_of->created = NULL;
31+
}
32+
free(deny_rule_record_all_of);
33+
}
34+
35+
cJSON *deny_rule_record_all_of_convertToJSON(deny_rule_record_all_of_t *deny_rule_record_all_of) {
36+
cJSON *item = cJSON_CreateObject();
37+
38+
// deny_rule_record_all_of->id
39+
if (!deny_rule_record_all_of->id) {
40+
goto fail;
41+
}
42+
if(cJSON_AddNumberToObject(item, "id", deny_rule_record_all_of->id) == NULL) {
43+
goto fail; //Numeric
44+
}
45+
46+
47+
// deny_rule_record_all_of->created
48+
if (!deny_rule_record_all_of->created) {
49+
goto fail;
50+
}
51+
if(cJSON_AddStringToObject(item, "created", deny_rule_record_all_of->created) == NULL) {
52+
goto fail; //Date-Time
53+
}
54+
55+
return item;
56+
fail:
57+
if (item) {
58+
cJSON_Delete(item);
59+
}
60+
return NULL;
61+
}
62+
63+
deny_rule_record_all_of_t *deny_rule_record_all_of_parseFromJSON(cJSON *deny_rule_record_all_ofJSON){
64+
65+
deny_rule_record_all_of_t *deny_rule_record_all_of_local_var = NULL;
66+
67+
// deny_rule_record_all_of->id
68+
cJSON *id = cJSON_GetObjectItemCaseSensitive(deny_rule_record_all_ofJSON, "id");
69+
if (!id) {
70+
goto end;
71+
}
72+
73+
74+
if(!cJSON_IsNumber(id))
75+
{
76+
goto end; //Numeric
77+
}
78+
79+
// deny_rule_record_all_of->created
80+
cJSON *created = cJSON_GetObjectItemCaseSensitive(deny_rule_record_all_ofJSON, "created");
81+
if (!created) {
82+
goto end;
83+
}
84+
85+
86+
if(!cJSON_IsString(created) && !cJSON_IsNull(created))
87+
{
88+
goto end; //DateTime
89+
}
90+
91+
92+
deny_rule_record_all_of_local_var = deny_rule_record_all_of_create (
93+
id->valuedouble,
94+
strdup(created->valuestring)
95+
);
96+
97+
return deny_rule_record_all_of_local_var;
98+
end:
99+
return NULL;
100+
101+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* deny_rule_record_all_of.h
3+
*
4+
*
5+
*/
6+
7+
#ifndef _deny_rule_record_all_of_H_
8+
#define _deny_rule_record_all_of_H_
9+
10+
#include <string.h>
11+
#include "../external/cJSON.h"
12+
#include "../include/list.h"
13+
#include "../include/keyValuePair.h"
14+
#include "../include/binary.h"
15+
16+
typedef struct deny_rule_record_all_of_t deny_rule_record_all_of_t;
17+
18+
19+
20+
21+
typedef struct deny_rule_record_all_of_t {
22+
int id; //numeric
23+
char *created; //date time
24+
25+
} deny_rule_record_all_of_t;
26+
27+
deny_rule_record_all_of_t *deny_rule_record_all_of_create(
28+
int id,
29+
char *created
30+
);
31+
32+
void deny_rule_record_all_of_free(deny_rule_record_all_of_t *deny_rule_record_all_of);
33+
34+
deny_rule_record_all_of_t *deny_rule_record_all_of_parseFromJSON(cJSON *deny_rule_record_all_ofJSON);
35+
36+
cJSON *deny_rule_record_all_of_convertToJSON(deny_rule_record_all_of_t *deny_rule_record_all_of);
37+
38+
#endif /* _deny_rule_record_all_of_H_ */
39+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#ifndef deny_rule_record_all_of_TEST
2+
#define deny_rule_record_all_of_TEST
3+
4+
// the following is to include only the main from the first c file
5+
#ifndef TEST_MAIN
6+
#define TEST_MAIN
7+
#define deny_rule_record_all_of_MAIN
8+
#endif // TEST_MAIN
9+
10+
#include <stdlib.h>
11+
#include <string.h>
12+
#include <stdio.h>
13+
#include <stdbool.h>
14+
#include "../external/cJSON.h"
15+
16+
#include "../model/deny_rule_record_all_of.h"
17+
deny_rule_record_all_of_t* instantiate_deny_rule_record_all_of(int include_optional);
18+
19+
20+
21+
deny_rule_record_all_of_t* instantiate_deny_rule_record_all_of(int include_optional) {
22+
deny_rule_record_all_of_t* deny_rule_record_all_of = NULL;
23+
if (include_optional) {
24+
deny_rule_record_all_of = deny_rule_record_all_of_create(
25+
41124,
26+
"2013-10-20T19:20:30+01:00"
27+
);
28+
} else {
29+
deny_rule_record_all_of = deny_rule_record_all_of_create(
30+
41124,
31+
"2013-10-20T19:20:30+01:00"
32+
);
33+
}
34+
35+
return deny_rule_record_all_of;
36+
}
37+
38+
39+
#ifdef deny_rule_record_all_of_MAIN
40+
41+
void test_deny_rule_record_all_of(int include_optional) {
42+
deny_rule_record_all_of_t* deny_rule_record_all_of_1 = instantiate_deny_rule_record_all_of(include_optional);
43+
44+
cJSON* jsondeny_rule_record_all_of_1 = deny_rule_record_all_of_convertToJSON(deny_rule_record_all_of_1);
45+
printf("deny_rule_record_all_of :\n%s\n", cJSON_Print(jsondeny_rule_record_all_of_1));
46+
deny_rule_record_all_of_t* deny_rule_record_all_of_2 = deny_rule_record_all_of_parseFromJSON(jsondeny_rule_record_all_of_1);
47+
cJSON* jsondeny_rule_record_all_of_2 = deny_rule_record_all_of_convertToJSON(deny_rule_record_all_of_2);
48+
printf("repeating deny_rule_record_all_of:\n%s\n", cJSON_Print(jsondeny_rule_record_all_of_2));
49+
}
50+
51+
int main() {
52+
test_deny_rule_record_all_of(1);
53+
test_deny_rule_record_all_of(0);
54+
55+
printf("Hello world \n");
56+
return 0;
57+
}
58+
59+
#endif // deny_rule_record_all_of_MAIN
60+
#endif // deny_rule_record_all_of_TEST
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(ns mail-baby-email-delivery-and-management-service-api.specs.deny-rule-record-all-of
2+
(:require [clojure.spec.alpha :as s]
3+
[spec-tools.data-spec :as ds]
4+
)
5+
(:import (java.io File)))
6+
7+
8+
(def deny-rule-record-all-of-data
9+
{
10+
(ds/req :id) int?
11+
(ds/req :created) inst?
12+
})
13+
14+
(def deny-rule-record-all-of-spec
15+
(ds/spec
16+
{:name ::deny-rule-record-all-of
17+
:spec deny-rule-record-all-of-data}))

0 commit comments

Comments
 (0)