-
Notifications
You must be signed in to change notification settings - Fork 75
Nikithauc/typescript beta mainnamespace #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ public static class MultipleNamespacesTestRunner | |
// and generation process creates a single file with nested namespaces | ||
private const string MetadataWithSubNamespacesFile = "MetadataWithSubNamespaces.xml"; | ||
|
||
public static void Run(TestLanguage language, bool isPhpBeta = false) | ||
public static void Run(TestLanguage language, bool isBeta = false) | ||
{ | ||
string getMetadataFile(TestLanguage testLanguage) | ||
{ | ||
|
@@ -54,7 +54,7 @@ string getMetadataFile(TestLanguage testLanguage) | |
|
||
// Arrange | ||
var languageStr = language.ToString(); | ||
var directoryPostfix = isPhpBeta ? "PHPBeta" : languageStr; | ||
var directoryPostfix = languageStr + (isBeta ? "Beta" : string.Empty); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure if case sensitivity matters here but for php would languageStr be "PHP" so the string ends up exactly the same. Since it's a passed in parameter i don't know that's guaranteed and if it matters. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think this is answered looking at how it's called from the PHPMultipleNamespaces file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fed from an enum that is local to the tests, so nobody will be able to change it by changing a string parameter somewhere. The test caller needs to specify an enum value. Also this is only used as part of a directory name where case doesn't matter as long as you are on Windows :) |
||
var outputDirectoryName = OutputDirectoryPrefix + directoryPostfix; | ||
var testDataDirectoryName = TestDataDirectoryPrefix + directoryPostfix; | ||
|
||
|
@@ -74,9 +74,17 @@ string getMetadataFile(TestLanguage testLanguage) | |
if (language == TestLanguage.Java) | ||
options.EndpointVersion = "v1.0"; // fixes java generation test as the endpoint contains the version and the default options are not applied in this testing mode | ||
|
||
if (isPhpBeta) | ||
if (isBeta) | ||
{ | ||
options.Properties = new List<string> { "php.namespacePrefix:Beta" }; | ||
if (TestLanguage.PHP == language) | ||
{ | ||
options.Properties = new List<string> { "php.namespacePrefix:Beta" }; | ||
} | ||
|
||
if (TestLanguage.TypeScript == language) | ||
{ | ||
options.Properties = new List<string> { "typescript.namespacePostfix:beta" }; | ||
} | ||
} | ||
|
||
// Act | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
// Project: https://github.com/microsoftgraph/msgraph-typescript-typings | ||
// Definitions by: Microsoft Graph Team <https://github.com/microsoftgraph> | ||
// Michael Mainer <https://github.com/MIchaelMainer> | ||
// Peter Ombwa <https://github.com/peombwa> | ||
// Mustafa Zengin <https://github.com/zengin> | ||
// DeVere Dyett <https://github.com/ddyett> | ||
// Nikitha Udaykumar Chettiar <https://github.com/nikithauc> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.1 | ||
|
||
export as namespace microsoftgraphbeta; | ||
|
||
export type NullableOption<T> = T | null; | ||
|
||
export type Enum1 = "value0" | "value1"; | ||
export interface Entity { | ||
id?: string; | ||
} | ||
export interface TestType extends Entity { | ||
propertyAlpha?: NullableOption<DerivedComplexTypeRequest>; | ||
} | ||
// tslint:disable-next-line: no-empty-interface | ||
export interface EntityType2 extends Entity {} | ||
// tslint:disable-next-line: no-empty-interface | ||
export interface EntityType3 extends Entity {} | ||
export interface TestEntity extends Entity { | ||
testNav?: NullableOption<TestType>; | ||
testInvalidNav?: NullableOption<EntityType2>; | ||
testExplicitNav?: NullableOption<EntityType3>; | ||
} | ||
export interface Endpoint extends Entity { | ||
property1?: NullableOption<number>; | ||
} | ||
export interface SingletonEntity1 extends Entity { | ||
testSingleNav?: NullableOption<TestType>; | ||
} | ||
export interface SingletonEntity2 extends Entity { | ||
testSingleNav2?: NullableOption<EntityType3>; | ||
} | ||
export interface TimeOffRequest extends Entity { | ||
name?: NullableOption<string>; | ||
} | ||
export interface TimeOff extends Entity { | ||
name?: NullableOption<string>; | ||
} | ||
export interface Schedule extends Entity { | ||
enabled?: NullableOption<boolean>; | ||
timesOff?: NullableOption<TimeOff[]>; | ||
timeOffRequests?: NullableOption<TimeOffRequest[]>; | ||
} | ||
export interface Call extends Entity { | ||
subject?: NullableOption<string>; | ||
} | ||
export interface CloudCommunications extends Entity { | ||
calls?: NullableOption<Call[]>; | ||
callRecords?: NullableOption<CallRecords.CallRecord[]>; | ||
} | ||
export interface OnenotePage extends Entity { | ||
// The OneNotePage content. | ||
/// | ||
/// Test token string | ||
content?: NullableOption<any>; | ||
} | ||
// tslint:disable-next-line: no-empty-interface | ||
export interface PlannerGroup extends Entity {} | ||
// tslint:disable-next-line: no-empty-interface | ||
export interface EmptyBaseComplexTypeRequest {} | ||
export interface DerivedComplexTypeRequest extends EmptyBaseComplexTypeRequest { | ||
property1?: NullableOption<string>; | ||
property2?: NullableOption<string>; | ||
enumProperty?: NullableOption<Enum1>; | ||
} | ||
// tslint:disable-next-line: no-empty-interface | ||
export interface ResponseObject {} | ||
export interface Recipient { | ||
name?: NullableOption<string>; | ||
email?: NullableOption<string>; | ||
} | ||
// tslint:disable-next-line: no-empty-interface | ||
export interface EmptyComplexType {} | ||
// tslint:disable-next-line: interface-name | ||
export interface Identity { | ||
displayName?: NullableOption<string>; | ||
id?: NullableOption<string>; | ||
} | ||
// tslint:disable-next-line: interface-name | ||
export interface IdentitySet { | ||
application?: NullableOption<Identity>; | ||
device?: NullableOption<Identity>; | ||
user?: NullableOption<Identity>; | ||
} | ||
|
||
export namespace CallRecords { | ||
type CallType = "unknown" | "groupCall"; | ||
type ClientPlatform = "unknown" | "windows"; | ||
type FailureStage = "unknown" | "callSetup"; | ||
type MediaStreamDirection = "callerToCallee" | "calleeToCaller"; | ||
type NetworkConnectionType = "unknown" | "wired"; | ||
type ProductFamily = "unknown" | "teams"; | ||
type ServiceRole = "unknown" | "customBot"; | ||
type UserFeedbackRating = "notRated" | "bad"; | ||
type WifiBand = "unknown" | "frequency24GHz"; | ||
type WifiRadioType = "unknown" | "wifi80211a"; | ||
type Modality = "audio" | "video"; | ||
interface SingletonEntity1 extends microsoftgraphbeta.Entity { | ||
testSingleNav?: NullableOption<microsoftgraphbeta.TestType>; | ||
} | ||
interface CallRecord extends microsoftgraphbeta.Entity { | ||
version?: number; | ||
type?: CallType; | ||
modalities?: Modality[]; | ||
lastModifiedDateTime?: string; | ||
startDateTime?: string; | ||
endDateTime?: string; | ||
organizer?: NullableOption<microsoftgraphbeta.IdentitySet>; | ||
participants?: NullableOption<microsoftgraphbeta.IdentitySet[]>; | ||
joinWebUrl?: NullableOption<string>; | ||
sessions?: NullableOption<Session[]>; | ||
recipients?: NullableOption<microsoftgraphbeta.EntityType2[]>; | ||
} | ||
interface Session extends microsoftgraphbeta.Entity { | ||
modalities?: Modality[]; | ||
startDateTime?: string; | ||
endDateTime?: string; | ||
caller?: NullableOption<Endpoint>; | ||
callee?: NullableOption<Endpoint>; | ||
failureInfo?: NullableOption<FailureInfo>; | ||
segments?: NullableOption<Segment[]>; | ||
} | ||
interface Segment extends microsoftgraphbeta.Entity { | ||
startDateTime?: string; | ||
endDateTime?: string; | ||
caller?: NullableOption<Endpoint>; | ||
callee?: NullableOption<Endpoint>; | ||
failureInfo?: NullableOption<FailureInfo>; | ||
media?: NullableOption<Media[]>; | ||
refTypes?: NullableOption<microsoftgraphbeta.EntityType3[]>; | ||
refType?: NullableOption<microsoftgraphbeta.Call>; | ||
sessionRef?: NullableOption<Session>; | ||
photo?: NullableOption<Photo>; | ||
} | ||
// tslint:disable-next-line: no-empty-interface | ||
interface Option extends microsoftgraphbeta.Entity {} | ||
interface Photo extends microsoftgraphbeta.Entity { | ||
failureInfo?: NullableOption<FailureInfo>; | ||
option?: NullableOption<Option>; | ||
} | ||
interface Endpoint { | ||
userAgent?: NullableOption<UserAgent>; | ||
} | ||
interface UserAgent { | ||
headerValue?: NullableOption<string>; | ||
applicationVersion?: NullableOption<string>; | ||
} | ||
interface FailureInfo { | ||
stage?: FailureStage; | ||
reason?: NullableOption<string>; | ||
} | ||
interface Media { | ||
label?: NullableOption<string>; | ||
callerNetwork?: NullableOption<NetworkInfo>; | ||
callerDevice?: NullableOption<DeviceInfo>; | ||
streams?: NullableOption<MediaStream[]>; | ||
} | ||
interface NetworkInfo { | ||
connectionType?: NetworkConnectionType; | ||
wifiBand?: WifiBand; | ||
basicServiceSetIdentifier?: NullableOption<string>; | ||
wifiRadioType?: WifiRadioType; | ||
wifiSignalStrength?: NullableOption<number>; | ||
bandwidthLowEventRatio?: NullableOption<number>; | ||
} | ||
interface DeviceInfo { | ||
captureDeviceName?: NullableOption<string>; | ||
sentSignalLevel?: NullableOption<number>; | ||
speakerGlitchRate?: NullableOption<number>; | ||
} | ||
interface MediaStream { | ||
streamId?: NullableOption<string>; | ||
startDateTime?: NullableOption<string>; | ||
streamDirection?: MediaStreamDirection; | ||
packetUtilization?: NullableOption<number>; | ||
wasMediaBypassed?: NullableOption<boolean>; | ||
lowVideoProcessingCapabilityRatio?: NullableOption<number>; | ||
averageAudioNetworkJitter?: NullableOption<string>; | ||
} | ||
interface ParticipantEndpoint extends Endpoint { | ||
identity?: NullableOption<microsoftgraphbeta.IdentitySet>; | ||
feedback?: NullableOption<UserFeedback>; | ||
} | ||
interface UserFeedback { | ||
text?: NullableOption<string>; | ||
rating?: UserFeedbackRating; | ||
tokens?: NullableOption<FeedbackTokenSet>; | ||
} | ||
// tslint:disable-next-line: no-empty-interface | ||
interface FeedbackTokenSet {} | ||
// tslint:disable-next-line: no-empty-interface | ||
interface ServiceEndpoint extends Endpoint {} | ||
interface ClientUserAgent extends UserAgent { | ||
platform?: ClientPlatform; | ||
productFamily?: ProductFamily; | ||
} | ||
interface ServiceUserAgent extends UserAgent { | ||
role?: ServiceRole; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Please consider splitting this into multiple lines. And if you use null-conditional operator: