Skip to content

Commit 5be9bfb

Browse files
authored
Merge pull request #429 from microsoftgraph/zengin/namespacesJava2
V1 release with multiple namespace support
2 parents 20a8b86 + e787d37 commit 5be9bfb

File tree

6,456 files changed

+14846
-17001
lines changed

Some content is hidden

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

6,456 files changed

+14846
-17001
lines changed

.azure-pipelines/generate-v1.0-models.yml

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,9 @@ steps:
4545
inputs:
4646
targetType: inline
4747
script: |
48-
49-
$repoModelsDir = "$env:Build_SourcesDirectory\msgraph-sdk-java\src\main\java\com\microsoft\graph\models\generated\"
50-
$repoModelsExtensionDir = "$env:Build_SourcesDirectory\msgraph-sdk-java\src\main\java\com\microsoft\graph\models\extensions\"
51-
$repoRequestExtensionDir = "$env:Build_SourcesDirectory\msgraph-sdk-java\src\main\java\com\microsoft\graph\requests\extensions\"
52-
Write-Host "Path to repo model directory: $repoModelsDir"
53-
Write-Host "Path to repo model extension directory: $repoModelsExtensionDir"
54-
Write-Host "Path to repo request directory: $repoRequestExtensionDir"
55-
Write-Host "##vso[task.setvariable variable=repoModelsDir]$repoModelsDir"
56-
Write-Host "##vso[task.setvariable variable=repoModelsExtensionDir]$repoModelsExtensionDir"
57-
Write-Host "##vso[task.setvariable variable=repoRequestExtensionDir]$repoRequestExtensionDir"
48+
$repoDir = "$env:Build_SourcesDirectory\msgraph-sdk-java\"
49+
Write-Host "Path to java repository: $repoDir"
50+
Write-Host "##vso[task.setvariable variable=repoDir]$repoDir"
5851
5952
$outputPath = Join-Path $env:Build_SourcesDirectory "output"
6053
Write-Host "Path to typewriter.exe output $outputPath"
@@ -68,21 +61,12 @@ steps:
6861
Write-Host "Branch path spec for the pull request will be $branchName"
6962
Write-Host "##vso[task.setvariable variable=branchName]$branchName"
7063
71-
- task: PowerShell@2
72-
displayName: 'Git: checkout dev'
73-
inputs:
74-
targetType: inline
75-
workingDirectory: '$(Build.SourcesDirectory)/msgraph-sdk-java'
76-
script: |
77-
git checkout dev | Write-Host
78-
7964
- task: PowerShell@2
8065
displayName: 'Git: branch from dev named with the build id: $(Build.BuildId)'
8166
inputs:
8267
targetType: inline
8368
workingDirectory: '$(Build.SourcesDirectory)/msgraph-sdk-java'
8469
script: |
85-
8670
Write-Host "The new branch name will be: $env:branchName"
8771
git checkout -B $env:branchName | Write-Host
8872
@@ -100,11 +84,17 @@ steps:
10084
inputs:
10185
targetType: inline
10286
script: |
103-
Remove-Item -Recurse $env:repoModelsDir | Write-Host
104-
Remove-Item -Recurse $env:repoModelsExtensionDir | Write-Host
105-
Remove-Item -Recurse $env:repoRequestExtensionDir | Write-Host
106-
Write-Host "Removed the existing generated files in the repo." -ForegroundColor Green
107-
enabled: false # The old GUI pipeline wasn't doing this. I recall that there was a reason
87+
$mainDir = Join-Path $env:repoDir "\src\main\"
88+
$extensionsAndGeneratedDirectories = Get-ChildItem $mainDir -Include extensions,generated -Recurse -Directory
89+
90+
# this list should be updated if a new hand-crafted extension is added to one of the extensions/ directories
91+
$filesThatShouldNotBeDeleted = "UploadSession.java","DateOnly.java","TimeOfDay.java","Multipart.java","ChunkedUploadRequest.java","ChunkedUploadResult.java","CustomRequestBuilder.java"
92+
foreach ($directory in $extensionsAndGeneratedDirectories)
93+
{
94+
Remove-Item $directory.FullName -Recurse -Force -Exclude $filesThatShouldNotBeDeleted
95+
}
96+
Write-Host "Removed the existing generated files in the repo's main directory: $mainDir" -ForegroundColor Green
97+
enabled: true # The old GUI pipeline wasn't doing this. I recall that there was a reason
10898
# for this but I can't recall the reason but I think it was related to reducing number of
10999
# generated files.
110100

@@ -123,21 +113,14 @@ steps:
123113
targetType: inline
124114
script: |
125115
# Path to typewriter output
126-
$modelsDirectory = Join-Path $env:outputPath "\com\microsoft\graph\models\generated\*"
127-
$modelsExtensionsDirectory = Join-Path $env:outputPath "\com\microsoft\graph\models\extensions\*"
128-
$requestsExtensionsDirectory = Join-Path $env:outputPath "\com\microsoft\graph\requests\extensions\*"
116+
$comDirectory = Join-Path $env:outputPath "\com\"
129117
130-
# models\generated - excluding Base* should not be necessary as those files shouldn't be generated.
131-
Copy-Item $modelsDirectory -Destination $env:repoModelsDir -Exclude Base*
132-
Write-Host "Copied the generated models\generated files into the repo. Excluded Base* files." -ForegroundColor Green
118+
# Path to the destination directory
119+
$comDestinationDirectory = Join-Path $env:repoDir "\src\main\java\"
133120
134-
# models\extensions
135-
Copy-Item $modelsExtensionsDirectory -Destination $env:repoModelsExtensionDir
136-
Write-Host "Copied the generated models\extensions files into the repo." -ForegroundColor Green
137-
138-
# requests\extensions
139-
Copy-Item $requestsExtensionsDirectory -Destination $env:repoRequestExtensionDir
140-
Write-Host "Copied the generated requests\extensions files into the repo." -ForegroundColor Green
121+
# copies com/ directory to java SDK repo, by following all the recursive paths
122+
Copy-Item $comDirectory -Destination $comDestinationDirectory -Recurse -Force
123+
Write-Host "Copied the generated com\ files into the repo. From: $comDirectory to: $comDestinationDirectory" -ForegroundColor Green
141124
142125
- task: PowerShell@2
143126
displayName: 'Git: stage and commit generated files'

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ Fixes #
1616

1717
<!-- Optional. Provide related links. This might be other pull requests, code files, StackOverflow posts. Delete this section if it is not used. -->
1818
### Other links
19+
20+
<!-- Is this PR adding a new hand crafted extension class? If so, please update $filesThatShouldNotBeDeleted variable in .azure-pipelines/generate-v1.0-models.yml file, so that it doesn't get deleted by auto generation pipeline.-->
1921
-
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.callrecords.models.extensions;
6+
import com.microsoft.graph.concurrency.*;
7+
import com.microsoft.graph.core.*;
8+
import com.microsoft.graph.http.*;
9+
import com.microsoft.graph.serializer.*;
10+
import java.util.Arrays;
11+
import java.util.EnumSet;
12+
import com.microsoft.graph.callrecords.models.generated.CallType;
13+
import com.microsoft.graph.callrecords.models.generated.Modality;
14+
import com.microsoft.graph.models.extensions.IdentitySet;
15+
import com.microsoft.graph.callrecords.models.extensions.Session;
16+
import com.microsoft.graph.models.extensions.Entity;
17+
import com.microsoft.graph.callrecords.requests.extensions.SessionCollectionResponse;
18+
import com.microsoft.graph.callrecords.requests.extensions.SessionCollectionPage;
19+
20+
21+
import com.google.gson.JsonObject;
22+
import com.google.gson.JsonElement;
23+
import com.google.gson.annotations.*;
24+
import java.util.HashMap;
25+
import java.util.Map;
26+
27+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
28+
29+
/**
30+
* The class for the Call Record.
31+
*/
32+
public class CallRecord extends Entity implements IJsonBackedObject {
33+
34+
35+
/**
36+
* The Version.
37+
* Monotonically increasing version of the call record. Higher version call records with the same id includes additional data compared to the lower version.
38+
*/
39+
@SerializedName("version")
40+
@Expose
41+
public Long version;
42+
43+
/**
44+
* The Type.
45+
* Indicates the type of the call. Possible values are: unknown, groupCall, peerToPeer, unknownFutureValue.
46+
*/
47+
@SerializedName("type")
48+
@Expose
49+
public CallType type;
50+
51+
/**
52+
* The Modalities.
53+
* List of all the modalities used in the call. Possible values are: unknown, audio, video, videoBasedScreenSharing, data, screenSharing, unknownFutureValue.
54+
*/
55+
@SerializedName("modalities")
56+
@Expose
57+
public java.util.List<Modality> modalities;
58+
59+
/**
60+
* The Last Modified Date Time.
61+
* UTC time when the call record was created. The DatetimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'
62+
*/
63+
@SerializedName("lastModifiedDateTime")
64+
@Expose
65+
public java.util.Calendar lastModifiedDateTime;
66+
67+
/**
68+
* The Start Date Time.
69+
* UTC time when the first user joined the call. The DatetimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'
70+
*/
71+
@SerializedName("startDateTime")
72+
@Expose
73+
public java.util.Calendar startDateTime;
74+
75+
/**
76+
* The End Date Time.
77+
* UTC time when the last user left the call. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'
78+
*/
79+
@SerializedName("endDateTime")
80+
@Expose
81+
public java.util.Calendar endDateTime;
82+
83+
/**
84+
* The Organizer.
85+
* The organizing party's identity.
86+
*/
87+
@SerializedName("organizer")
88+
@Expose
89+
public IdentitySet organizer;
90+
91+
/**
92+
* The Participants.
93+
* List of distinct identities involved in the call.
94+
*/
95+
@SerializedName("participants")
96+
@Expose
97+
public java.util.List<IdentitySet> participants;
98+
99+
/**
100+
* The Join Web Url.
101+
* Meeting URL associated to the call. May not be available for a peerToPeer call record type.
102+
*/
103+
@SerializedName("joinWebUrl")
104+
@Expose
105+
public String joinWebUrl;
106+
107+
/**
108+
* The Sessions.
109+
* List of sessions involved in the call. Peer-to-peer calls typically only have one session, whereas group calls typically have at least one session per participant. Read-only. Nullable.
110+
*/
111+
public SessionCollectionPage sessions;
112+
113+
114+
/**
115+
* The raw representation of this class
116+
*/
117+
private JsonObject rawObject;
118+
119+
/**
120+
* The serializer
121+
*/
122+
private ISerializer serializer;
123+
124+
/**
125+
* Gets the raw representation of this class
126+
*
127+
* @return the raw representation of this class
128+
*/
129+
public JsonObject getRawObject() {
130+
return rawObject;
131+
}
132+
133+
/**
134+
* Gets serializer
135+
*
136+
* @return the serializer
137+
*/
138+
protected ISerializer getSerializer() {
139+
return serializer;
140+
}
141+
142+
/**
143+
* Sets the raw JSON object
144+
*
145+
* @param serializer the serializer
146+
* @param json the JSON object to set this object to
147+
*/
148+
public void setRawObject(final ISerializer serializer, final JsonObject json) {
149+
this.serializer = serializer;
150+
rawObject = json;
151+
152+
153+
if (json.has("sessions")) {
154+
final SessionCollectionResponse response = new SessionCollectionResponse();
155+
if (json.has("sessions@odata.nextLink")) {
156+
response.nextLink = json.get("sessions@odata.nextLink").getAsString();
157+
}
158+
159+
final JsonObject[] sourceArray = serializer.deserializeObject(json.get("sessions").toString(), JsonObject[].class);
160+
final Session[] array = new Session[sourceArray.length];
161+
for (int i = 0; i < sourceArray.length; i++) {
162+
array[i] = serializer.deserializeObject(sourceArray[i].toString(), Session.class);
163+
array[i].setRawObject(serializer, sourceArray[i]);
164+
}
165+
response.value = Arrays.asList(array);
166+
sessions = new SessionCollectionPage(response, null);
167+
}
168+
}
169+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.callrecords.models.extensions;
6+
import com.microsoft.graph.concurrency.*;
7+
import com.microsoft.graph.core.*;
8+
import com.microsoft.graph.http.*;
9+
import com.microsoft.graph.serializer.*;
10+
import java.util.Arrays;
11+
import java.util.EnumSet;
12+
import com.microsoft.graph.callrecords.models.generated.ClientPlatform;
13+
import com.microsoft.graph.callrecords.models.generated.ProductFamily;
14+
import com.microsoft.graph.callrecords.models.extensions.UserAgent;
15+
16+
17+
import com.google.gson.JsonObject;
18+
import com.google.gson.JsonElement;
19+
import com.google.gson.annotations.*;
20+
import java.util.HashMap;
21+
import java.util.Map;
22+
23+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
24+
25+
/**
26+
* The class for the Client User Agent.
27+
*/
28+
public class ClientUserAgent extends UserAgent implements IJsonBackedObject {
29+
30+
31+
/**
32+
* The Platform.
33+
* Identifies the platform used by this endpoint. Possible values are: unknown, windows, macOS, iOS, android, web, ipPhone, roomSystem, surfaceHub, holoLens, unknownFutureValue.
34+
*/
35+
@SerializedName("platform")
36+
@Expose
37+
public ClientPlatform platform;
38+
39+
/**
40+
* The Product Family.
41+
* Identifies the family of application software used by this endpoint. Possible values are: unknown, teams, skypeForBusiness, lync, unknownFutureValue.
42+
*/
43+
@SerializedName("productFamily")
44+
@Expose
45+
public ProductFamily productFamily;
46+
47+
48+
/**
49+
* The raw representation of this class
50+
*/
51+
private JsonObject rawObject;
52+
53+
/**
54+
* The serializer
55+
*/
56+
private ISerializer serializer;
57+
58+
/**
59+
* Gets the raw representation of this class
60+
*
61+
* @return the raw representation of this class
62+
*/
63+
public JsonObject getRawObject() {
64+
return rawObject;
65+
}
66+
67+
/**
68+
* Gets serializer
69+
*
70+
* @return the serializer
71+
*/
72+
protected ISerializer getSerializer() {
73+
return serializer;
74+
}
75+
76+
/**
77+
* Sets the raw JSON object
78+
*
79+
* @param serializer the serializer
80+
* @param json the JSON object to set this object to
81+
*/
82+
public void setRawObject(final ISerializer serializer, final JsonObject json) {
83+
this.serializer = serializer;
84+
rawObject = json;
85+
86+
}
87+
}

0 commit comments

Comments
 (0)