public sealed class OSPolicy.Types.Resource.Types.File : IMessage<OSPolicy.Types.Resource.Types.File>, IEquatable<OSPolicy.Types.Resource.Types.File>, IDeepCloneable<OSPolicy.Types.Resource.Types.File>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud OS Config v1alpha API class OSPolicy.Types.Resource.Types.File.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eOSPolicy.Types.Resource.Types.File\u003c/code\u003e class within the Google Cloud OS Config v1alpha API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eOSPolicy.Types.Resource.Types.File\u003c/code\u003e class represents either a remote or local file in the OS Config environment.\u003c/p\u003e\n"],["\u003cp\u003eThis class supports different types of file sources, including local paths, generic remote files, and Cloud Storage objects, with varying properties for each.\u003c/p\u003e\n"],["\u003cp\u003eThere are multiple versions of this class available, with the latest being \u003ccode\u003e2.0.0-alpha06\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements several interfaces, such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, allowing for advanced functionality and interaction.\u003c/p\u003e\n"]]],[],null,["# Google Cloud OS Config v1alpha API - Class OSPolicy.Types.Resource.Types.File (2.0.0-alpha06)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0-alpha06 (latest)](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.File)\n- [2.0.0-alpha05](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/2.0.0-alpha05/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.File)\n- [1.0.0-alpha04](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/1.0.0-alpha04/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.File) \n\n public sealed class OSPolicy.Types.Resource.Types.File : IMessage\u003cOSPolicy.Types.Resource.Types.File\u003e, IEquatable\u003cOSPolicy.Types.Resource.Types.File\u003e, IDeepCloneable\u003cOSPolicy.Types.Resource.Types.File\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud OS Config v1alpha API class OSPolicy.Types.Resource.Types.File.\n\nA remote or local file. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e OSPolicy.Types.Resource.Types.File \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[OSPolicy](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types)[Resource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types)[File](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.File), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[OSPolicy](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types)[Resource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types)[File](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.File), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[OSPolicy](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types)[Resource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types)[File](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.File), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.OsConfig.V1Alpha](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha)\n\nAssembly\n--------\n\nGoogle.Cloud.OsConfig.V1Alpha.dll\n\nConstructors\n------------\n\n### File()\n\n public File()\n\n### File(File)\n\n public File(OSPolicy.Types.Resource.Types.File other)\n\nProperties\n----------\n\n### AllowInsecure\n\n public bool AllowInsecure { get; set; }\n\nDefaults to false. When false, files are subject to validations\nbased on the file type:\n\nRemote: A checksum must be specified.\nCloud Storage: An object generation number must be specified.\n\n### Gcs\n\n public OSPolicy.Types.Resource.Types.File.Types.Gcs Gcs { get; set; }\n\nA Cloud Storage object.\n\n### HasLocalPath\n\n public bool HasLocalPath { get; }\n\nGets whether the \"local_path\" field is set\n\n### LocalPath\n\n public string LocalPath { get; set; }\n\nA local path within the VM to use.\n\n### Remote\n\n public OSPolicy.Types.Resource.Types.File.Types.Remote Remote { get; set; }\n\nA generic remote file.\n\n### TypeCase\n\n public OSPolicy.Types.Resource.Types.File.TypeOneofCase TypeCase { get; }"]]